Dynamic configuration method and device of bus address and storage medium

Through serial communication between the processor and the I/O expansion module, the bus address is dynamically configured, which solves the problems of poor bus address randomness and anti-interference in the prior art, realizes the stability and uniqueness of the bus address, and improves the reliability and maintainability of the system.

CN119988248AActive Publication Date: 2025-05-13ZHEJIANG SUPCON RES +1

Patent Information

Application Number
CN202510465702.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-05-13
Estimated Expiration
2045-04-15

AI Technical Summary

Technical Problem

In the prior art, there is randomness in the bus address allocation method, which causes the bus address to change after repeated power-up, which increases production and maintenance costs, and has poor anti-interference and limited bus scalability.

Method used

The processor location information is sent to the I/O expansion module through the serial port through the processor. The I/O expansion module obtains the expansion module location information based on the processor location information, and sends the bus address, expansion module type information, version information and location information to the processor. The processor modifies the bus address through logical configuration software and writes it to the nonvolatile memory of the I/O expansion module.

Benefits of technology

The dynamic configuration of the bus address is realized, ensuring the stability and uniqueness of the bus address, improving the reliability and maintainability of the system, reducing programming programs, and solving the problem of bus address conflict.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988248A_ABST
    Figure CN119988248A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of bus address allocation, in particular to a bus address dynamic configuration method and device and a storage medium, and the method comprises the steps that S1, after a PLC is powered on, a processor sends processor position information to an I / O extension module through a serial port, and the I / O extension module obtains extension module position information according to the processor position information; s2, the I / O extension module sends key data including the bus address to a processor, and the processor provides the key data for logic configuration software; and S3, modifying the first bus address according to the logic configuration software and the processor to obtain a second bus address, writing the second bus address into the I / O extension module, and storing the second bus address in the nonvolatile memory by the I / O extension module. According to the invention, the CPU allocates the bus address for each I / O extension module, and stores the allocated bus address, so that the problem of conflicts caused by the same factory bus addresses of the I / O extension modules can be solved, and the maintainability, stability and usability of the programmable controller system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of bus address allocation, and in particular to a bus address dynamic configuration method, device and storage medium. Background Art

[0002] In the field of modern industrial automation, programmable logic controller (PLC) plays a vital role. It is an electronic device for digital operation designed for use in industrial environments. It uses a programmable memory to execute logic operations, sequential control, timing, counting and arithmetic operations, and other operation instructions, and controls various types of machinery or production processes through digital and analog input and output.

[0003] In the application publication number CN116132404A, entitled "CAN bus node address allocation method, node device and computing device", a first address is randomly generated; a first broadcast message is received, wherein the first broadcast message carries a second address; the second address is obtained from the first broadcast message and stored; a second broadcast message is sent, wherein the second broadcast message carries the first address; based on the broadcast result of the second broadcast message and the second address, the first address is determined to be an available address; and the first address is used as the node address. However, this method will save the address in the memory after it is allocated, and does not have the function of being modifiable. The address allocation methods proposed in other prior arts have the problems of randomness and the possibility that the bus address may change after repeated power-on; they rely on each module having a unique UUID, and even I / O expansion modules of the same model require different firmware or programs, which increases the production and maintenance costs of the programmable controller; they rely on hard-wired connections between modules, and enable the configurable state of the next module through the logic level output by the previous module. This method has poor anti-interference performance, especially when the bus between modules is long, it has the problem of lack of reliability; it has the problem of high cost and a limited number of I / O expansion modules that can expand the bus. Summary of the invention

[0004] The purpose of the present invention is to solve the shortcomings of the prior art and provide a method for dynamically configuring a bus address, comprising the following steps: S1: After the PLC is powered on, the processor sends the processor position information to the I / O expansion module through the serial port, and the I / O expansion module obtains the expansion module position information according to the processor position information; S2: The I / O expansion module sends key data including bus address, expansion module type information, expansion module version information and expansion module location information to the processor, and the processor provides the key data to the logic configuration software; S3: modifying the first bus address according to the logic configuration software and the processor to obtain a second bus address, and writing the second bus address into the I / O expansion module, and the I / O expansion module saving the second bus address in a non-volatile memory.

[0005] Preferably, in step S1, the I / O expansion module obtains the expansion module position information according to the processor position information, further comprising: The first I / O expansion module adjacent to the processor receives the processor position information with a value of 1, adds 1 to its own expansion module position information to obtain the first expansion module position information, and sends the first expansion module information to the second I / O expansion module; The second I / O expansion module receives the first expansion module information, adds 1 to its own expansion module position information to obtain the second expansion module position information, and sends the second expansion module information to the next I / O expansion module through the serial port until the expansion module position information allocation is completed; The factory settings of the processor location information and the I / O expansion module location information are 1, and the processor location information cannot be changed.

[0006] Preferably, in step S2, the I / O expansion module sends key data including bus address, expansion module type information, expansion module version information and expansion module location information to the processor, further comprising: S21: After the processor is powered on, it waits for the heartbeat message of the I / O expansion module, and after receiving the heartbeat message to confirm that the I / O expansion module is normal, it sends a scanning broadcast frame; S22: After receiving the scanning broadcast frame, the I / O expansion module sends a response frame including bus address, expansion module type information, expansion module version information and expansion module location information; S23: After receiving the response frame, the processor determines the number of I / O expansion modules, the location information of the expansion modules and the bus address.

[0007] Preferably, in step S3, modifying the bus address according to the logic configuration software and the processor, and writing the second bus address into the I / O expansion module further comprises: S31: the logic configuration software displays the software I / O expansion modules on the operation interface according to the expansion module information including the first expansion module information and the second expansion module information and the number of the I / O expansion modules; S32: selecting a first software I / O expansion module whose software bus address needs to be modified from the software I / O expansion modules, and writing the legal bus address to obtain a first software bus address; S33: The processor finds the target I / O expansion module through the expansion module information, modifies the first bus address according to the first software bus address to obtain a second bus address, and writes the second bus address into the target I / O expansion module.

[0008] Preferably, in step S33, the processor finds the I / O expansion module through the expansion module information, further comprising: S331: The processor sends an SDO query message including the bus address, the expansion module type information, the hardware version, the software version, the manufacturer ID and the module model; S332: The I / O expansion module receives the SDO query message, determines whether there is a bus address conflict according to the bus address, processes the conflict if there is a bus address conflict, and performs configuration according to the configuration message if there is no bus address conflict.

[0009] Preferably, in step S332, judging whether there is a bus address conflict according to the bus address, processing is performed if there is a bus address conflict, and configuring is performed according to the SDO query message if there is no bus address conflict, further comprising: The I / O expansion modules with the same bus address data receive the SDO query message. If at least two modules in the I / O expansion modules receive the SDO query message, it is determined that there is a bus address conflict, and an alarm prompt is processed according to the position information of the expansion module. If there is no bus address conflict, configuration is performed according to the configuration message.

[0010] Preferably, performing alarm prompt processing according to the expansion module position information further includes: If it is detected that the bus address of the current I / O expansion module conflicts with that of other I / O expansion modules, the current I / O expansion module is in a safety protection state. At this time, the current I / O expansion module can receive information from the bus, but will not process data messages, that is, it will not perform actions based on data messages, and will only receive the configuration message that configures the bus address.

[0011] Preferably, receiving the configuration message for configuring the bus address further comprises: The CPU sends the configuration message including the location information of the expansion module, the bus address, the configuration command and the configuration parameters, and the current I / O expansion module is configured according to the configuration message.

[0012] Based on the same concept, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the dynamic configuration method of the bus address as described in any one of the embodiments.

[0013] Based on the same concept, the present invention also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, enables the one or more processors to execute the steps of the method for dynamically configuring a bus address as described in any one of the embodiments.

[0014] Compared with the prior art, the present invention has the following beneficial effects: The present invention uses a processor to send processor position information to an I / O expansion module through a serial port, and the I / O expansion module obtains expansion module position information based on the processor position information, so that during use, even if the serial port is disturbed and the position information is changed by mistake, the module bus address will not change, normal communication will not be affected, and the reliability is very high.

[0015] The present invention sends key data including bus address, expansion module type information, expansion module version information and expansion module position information to a processor through an I / O expansion module, and the processor provides the key data to logic configuration software, thereby realizing display of the I / O expansion module through the logic configuration software.

[0016] The present invention also modifies the first bus address according to the logic configuration software and the processor to obtain the second bus address, and writes the second bus address into the I / O expansion module, which can not only solve the problem of the ID configuration of the programmable controller system module, but also can repeatedly configure the bus ID configuration scheme, and when the system module configuration is adjusted, the modification of the programming program can be minimized.

[0017] The present invention saves the allocated bus address through the I / O expansion module and uses it for subsequent data interaction with the CPU control unit, which can solve the problem of conflict caused by the same factory bus address of the I / O expansion module and improve the maintainability, stability and ease of use of the programmable controller system. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the following detailed description of the preferred embodiment.The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting the invention.

[0019] Figure 1 A structural diagram of a method for dynamically configuring a bus address according to the present invention; Figure 2The present invention is a flowchart of a method for dynamically configuring a bus address. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0021] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0022] First embodiment In a programmable logic controller system, in order to realize data interaction between the processor CPU and the I / O expansion module, the processor CPU and the I / O expansion module are often connected in series through a bus, such as a CAN bus and an RS485 bus. In bus communication, the processor CPU acts as the master and the I / O expansion module acts as the slave. In order to realize communication between a master role and multiple slave roles, a bus address must be assigned to each slave role.

[0023] See also Figure 1 The programmable controller PLC of this embodiment includes a CPU control unit (processor), an I / O control module, and a bus cable (CAN bus), wherein the CPU control unit and the I / O expansion module are connected in series in sequence through the bus cable. In other embodiments, a Profibus bus may also be used.

[0024] Preferably, the position information of the CPU control unit is 1, and the CPU control unit sends its own position information to I / O expansion module 1 through the serial port. At this time, the position information of I / O expansion module 1 is 2. I / O expansion module 1 sends its own position information to I / O expansion module 2 through the serial port. At this time, the position information of I / O expansion module 1 is 2, from which it can be inferred that the position information of I / O expansion module n is n+1.

[0025] See also Figure 2 As shown, the method for dynamically configuring the bus address provided in this embodiment includes the following steps: S1: After the PLC is powered on, the processor sends the processor position information to the I / O expansion module through the serial port. The I / O expansion module obtains the expansion module position information based on the processor position information. Specifically, in this embodiment, the processor formats the position information according to a certain serial port communication protocol. Serial port communication needs to set appropriate parameters such as baud rate, data bit, stop bit and check bit to ensure that the I / O expansion module can correctly receive data. The serial port communication can increase the check so that the I / O signal has very strong anti-interference ability. The I / O expansion module obtains the position information of other I / O expansion modules through the serial port, but the I / O expansion module position information only participates in the communication during the active configuration of the bus address. Even if the serial port is interfered with during use and the position information is changed by mistake, the module bus address will not change and will not affect normal communication. It has very high reliability.

[0026] Preferably, in step S1, the I / O expansion module obtains the expansion module position information according to the processor position information, further comprising: The first I / O expansion module adjacent to the processor receives the processor position information with a value of 1, adds 1 to its own expansion module position information to obtain the first expansion module position information, and sends the first expansion module information to the second I / O expansion module. Specifically, in this embodiment, the first I / O expansion module actually adjacent to the CPU control unit is also at the second position in the PLC system. The I / O expansion module receives the processor position information through its serial port receiving part, parses the received data according to the same communication protocol, and extracts the processor position information, that is, the connection is through a certain network topology, and the position relationship is defined based on the connection relationship of the network nodes, and the position of the expansion module is determined according to the network topology rule; The second I / O expansion module receives the first expansion module information, adds 1 to its own expansion module position information to obtain the second expansion module position information, and sends the second expansion module information to the next I / O expansion module through the serial port until the expansion module position information allocation is completed. Specifically, in this embodiment, the nth I / O expansion module will receive the I / O expansion module n sent by the previous module, and the nth I / O expansion module will change its own position information to n+1. The I / O expansion module simply obtains the position information through the serial port, and also obtains a unique identification number in the bus. The CPU control unit can configure each expansion module through the unique identification number. This process does not require negotiation and arbitration, and is highly efficient. Among them, the factory settings of the processor location information and the I / O expansion module location information are 1, and the processor location information cannot be changed. Specifically, in this embodiment, the location information of other I / O expansion modules is obtained through the I / O expansion module to achieve module differentiation. The processor can obtain the location information of the I / O expansion module and directly send the configuration message to the corresponding module to achieve configurability of the bus address.

[0027] S2: The I / O expansion module sends key data including the bus address, expansion module type information, expansion module version information and expansion module location information to the processor. The processor provides the key data to the logic configuration software for configuration software information display. Specifically, in this embodiment, the I / O expansion module address information is different from the bus address information. The identification information of the expansion I / O module at this time is the I / O expansion module address information plus the bus address information. Because the location information obtained by each I / O expansion module is different, the identification information is also different. According to different identification information, the CPU control unit can automatically assign a bus address to each expansion module, or manually adjust the bus address of any module.

[0028] Preferably, the bus address is the unique identifier of the I / O expansion module in the entire bus communication architecture, which is used by the processor to accurately communicate with it. The expansion module type information is to clarify the type of function it has, such as digital input and output type, analog input and output type, or a composite type with multiple functions, etc. The expansion module version information is used to understand the update status of its functions and compatibility with other modules or software.

[0029] Preferably, in step S2, the I / O expansion module sends key data including bus address, expansion module type information, expansion module version information and expansion module location information to the processor, further comprising: S21: After the processor is powered on, it waits for the heartbeat message of the I / O expansion module. When the heartbeat message is received to confirm that the I / O expansion module is normal, a scanning broadcast frame is sent. Specifically, in this embodiment, the processor starts a timer or uses its own time management mechanism to set a reasonable waiting time threshold, and continuously monitors the communication link from the I / O expansion module. If the heartbeat message has not been received within this time range, it means that the I / O expansion module is faulty or the communication link has a problem. The processor subsequently takes corresponding error handling measures, such as issuing an alarm message, etc. Once data is detected to be sent, the receiving operation is performed according to the corresponding communication protocol, the received data is parsed and checked, and possible redundant information such as check bits are removed to extract valid information. S22: After receiving the scanning broadcast frame, the I / O expansion module sends a response frame including the bus address, expansion module type information, expansion module version information and expansion module location information; S23: After receiving the response frame, the processor determines the number of I / O expansion modules, the location information of the expansion modules, and the bus address.

[0030] S3: Modify the first bus address according to the logic configuration software and the processor to obtain the second bus address, and write the second bus address into the I / O expansion module, which saves the second bus address into a non-volatile memory. Specifically, in this embodiment, the bus address is saved in the non-volatile storage of each expansion module, and each restart does not require obtaining the location information and configuration information again, so the startup speed is fast.

[0031] Preferably, in step S3, the bus address is modified according to the logic configuration software and the processor, and the second bus address is written into the I / O expansion module, further comprising: S31: the logic configuration software displays the software I / O expansion modules on the operation interface according to the expansion module information including the first expansion module information and the second expansion module information and the number of I / O expansion modules. Specifically, in this embodiment, the position information is arranged according to the expansion module information and the number of I / O expansion modules, and the arranged I / O expansion modules are displayed on the operation page; S32: Select the first software I / O expansion module whose software bus address needs to be modified from the software I / O expansion module, write the legal bus address to obtain the first software bus address. Specifically, in this embodiment, the logic configuration software will perform a real-time legality check on the input content, such as checking whether the input format meets the requirements (such as whether it is the correct hexadecimal or decimal representation, depending on the system regulations), whether the input value is within the determined legal bus address range, etc. If it does not meet the requirements, the user will be prompted to make changes in a timely manner, such as popping up a prompt box to inform the user of the input error and explain the correct format and range requirements. The logic configuration software can also generate an unused bus address that meets the address range requirements based on the existing device bus address allocation in the system through a certain algorithm. For example, the software will traverse the allocated bus address list, find the free address space, and then determine a suitable new bus address in order or according to a specific rule (such as allocating addresses in sequence according to functional partitions, etc.) as a candidate address to be written, and present it to the user for confirmation (the generated address can be displayed through a prompt box to let the user choose whether to use it); S33: The processor finds the target I / O expansion module through the expansion module information, modifies the first bus address according to the first software bus address to obtain a second bus address, and writes the second bus address into the target I / O expansion module.

[0032] Preferably, in step S33, the processor finds the I / O expansion module through the expansion module information, further comprising: S331: The processor sends an SDO query message including the bus address, expansion module type information, hardware version, software version, manufacturer ID and module model; S332: The I / O expansion module receives the SDO query message, determines whether there is a bus address conflict according to the bus address, processes if there is a bus address conflict, and configures according to the configuration message if there is no bus address conflict.

[0033] Preferably, in step S332, judging whether there is a bus address conflict according to the bus address, processing is performed if there is a bus address conflict, and configuring is performed according to the SDO query message if there is no bus address conflict, further comprising: The I / O expansion modules with the same bus address data receive SDO query messages. If at least two modules in the I / O expansion modules receive SDO query messages, the bus address conflict is determined, and an alarm prompt is processed according to the location information of the expansion module. If the bus address does not conflict, configuration is performed according to the configuration message.

[0034] Preferably, performing alarm prompt processing according to the expansion module position information further includes: If it is detected that the bus address of the current I / O expansion module conflicts with that of other I / O expansion modules, the current I / O expansion module is in a safety protection state. At this time, the current I / O expansion module can receive bus information, but will not process data messages, that is, it will not perform actions based on data messages, and will only receive configuration messages for configuring the bus address.

[0035] Preferably, receiving a configuration message for configuring a bus address further comprises: The CPU sends a configuration message including the location information of the expansion module, the bus address, the configuration command and the configuration parameters, and the current I / O expansion module is configured according to the configuration message.

[0036] The I / O expansion module location information is only used for module information upload and module bus address change after the module is powered on. The I / O expansion module location information does not participate in data interaction during normal operation of the programmable controller system. It is compatible with standard bus protocols and does not increase the bus load.

[0037] During the normal operation stage of the programmable controller system PLC, the main operations are the collection and transmission of various control signals and data, as well as the execution of corresponding actions according to the control logic. For example, for the digital I / O expansion module, it will continuously receive external digital signal input and transmit it to the programmable controller for processing, or receive output instructions from the programmable controller to control the switch state of external devices; for the analog I / O expansion module, it converts and transmits between analog signals and digital signals, such as collecting the analog voltage and current values ​​from the sensor and converting them into digital quantities to provide to the programmable controller, and then converting the digital quantity output by the programmable controller into analog signals to drive the actuator, etc.

[0038] In these regular data interaction processes, the location information of the I / O expansion module does not participate in them because it is not directly related to these real-time control and data processing operations. The system focuses on the input and output data itself and the corresponding logical relationship, rather than the specific location of the module. As long as the module can communicate normally through its bus address and other identifiers and complete the task of sending and receiving data, the normal operation of the system can be guaranteed. Therefore, the location information is in an "idle" state at this stage and will not occupy communication resources or add additional processing burden in the normal data interaction process.

[0039] Second embodiment In some embodiments of the present application, a computer device is also provided, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the dynamic configuration method of the bus address in one embodiment of the present invention.

[0040] The present invention also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, enables the one or more processors to execute the steps of the bus address dynamic configuration method in one embodiment of the present invention.

[0041] It is understandable that, for the aforementioned bus address dynamic configuration method, if it is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0042] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.

[0043] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for dynamically configuring a bus address, characterized in that: The following steps are involved: S1: After the PLC is powered on, the processor sends the processor position information to the I / O expansion module through the serial port, and the I / O expansion module obtains the expansion module position information according to the processor position information; S2: The I / O expansion module sends key data including bus address, expansion module type information, expansion module version information and expansion module location information to the processor, and the processor provides the key data to the logic configuration software; S3: modifying the first bus address according to the logic configuration software and the processor to obtain a second bus address, and writing the second bus address into the I / O expansion module, and the I / O expansion module saving the second bus address in a non-volatile memory.

2. The method for dynamically configuring a bus address according to claim 1, characterized in that: In step S1, the I / O expansion module obtains expansion module position information according to the processor position information, further comprising: The first I / O expansion module adjacent to the processor receives the processor position information with a value of 1, adds 1 to its own expansion module position information to obtain the first expansion module position information, and sends the first expansion module information to the second I / O expansion module; The second I / O expansion module receives the first expansion module information, adds 1 to its own expansion module position information to obtain the second expansion module position information, and sends the second expansion module information to the next I / O expansion module through the serial port until the expansion module position information allocation is completed; The factory settings of the processor location information and the I / O expansion module location information are 1, and the processor location information cannot be changed.

3. The method for dynamically configuring a bus address according to claim 2, characterized in that: In step S2, the I / O expansion module sends key data including bus address, expansion module type information, expansion module version information and expansion module location information to the processor, further comprising: S21: After the processor is powered on, it waits for the heartbeat message of the I / O expansion module, and after receiving the heartbeat message to confirm that the I / O expansion module is normal, it sends a scanning broadcast frame; S22: After receiving the scanning broadcast frame, the I / O expansion module sends a response frame including bus address, expansion module type information, expansion module version information and expansion module location information; S23: After receiving the response frame, the processor determines the number of I / O expansion modules, the location information of the expansion modules and the bus address.

4. The method for dynamically configuring a bus address according to claim 3, characterized in that: In step S3, modifying the bus address according to the logic configuration software and the processor, and writing the second bus address into the I / O expansion module further comprises: S31: the logic configuration software displays the software I / O expansion modules on the operation interface according to the expansion module information including the first expansion module information and the second expansion module information and the number of the I / O expansion modules; S32: selecting a first software I / O expansion module whose software bus address needs to be modified from the software I / O expansion modules, and writing the legal bus address to obtain a first software bus address; S33: The processor finds the target I / O expansion module through the expansion module information, modifies the first bus address according to the first software bus address to obtain a second bus address, and writes the second bus address into the target I / O expansion module.

5. The method for dynamically configuring a bus address according to claim 4, characterized in that: In step S33, the processor finds the I / O expansion module through the expansion module information, further comprising: S331: The processor sends an SDO query message including the bus address, the expansion module type information, the hardware version, the software version, the manufacturer ID and the module model; S332: The I / O expansion module receives the SDO query message, determines whether there is a bus address conflict according to the bus address, processes the conflict if there is a bus address conflict, and performs configuration according to the configuration message if there is no bus address conflict.

6. The method for dynamically configuring a bus address according to claim 5, characterized in that: In step S332, judging whether there is a bus address conflict according to the bus address, processing is performed if there is a bus address conflict, and configuring is performed according to the SDO query message if there is no bus address conflict, further comprising: The I / O expansion modules with the same bus address data receive the SDO query message. If at least two modules in the I / O expansion modules receive the SDO query message, it is determined that there is a bus address conflict, and an alarm prompt is processed according to the position information of the expansion module. If there is no bus address conflict, configuration is performed according to the configuration message.

7. The method for dynamically configuring a bus address according to claim 6, characterized in that: Performing alarm prompt processing according to the expansion module position information further includes: If it is detected that the bus address of the current I / O expansion module conflicts with that of other I / O expansion modules, the current I / O expansion module is in a safety protection state. At this time, the current I / O expansion module can receive information from the bus, but will not process data messages, that is, it will not perform actions based on data messages, and will only receive the configuration message that configures the bus address.

8. The method for dynamically configuring a bus address according to claim 7, characterized in that: Receiving the configuration message for configuring the bus address further comprises: The CPU sends the configuration message including the location information of the expansion module, the bus address, the configuration command and the configuration parameters, and the current I / O expansion module is configured according to the configuration message.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the method for dynamically configuring a bus address as claimed in any one of claims 1 to 8.

10. A storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the steps of the method for dynamically configuring a bus address according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • CAN bus node address allocation method, node equipment and computing equipment

    CN116132404A

  • System for being in communication with PLC extended module and implementation method thereof

    CN104090519A

  • Server-based microkernel operating system deployment method and operating system

    CN113127077A

  • Online detection configuration file management method for production field of aeronautical manufacturing industry

    CN117331614A

  • Backboard bus extension system, management method and device, server and storage medium

    CN117743246A

Cited By

  • PLC system control method and device based on dynamic address allocation and storage medium

    CN120315365A