A method, device, and storage medium for dynamically configuring a bus address
Through the serial communication and logical configuration software of the processor and I/O expansion module, the bus address is modified, and the randomness and reliability of bus address allocation in the prior art is solved, dynamic configuration and efficient module ID management are realized, and the stability and ease of use of the system are improved.
Patent Information
- Application Number
- CN202510465702.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-04-15
AI Technical Summary
In the prior art, the bus address allocation method has problems such as randomness, no mutability, poor anti-interference ability, high cost and limited scalability based on hardwired connections, and is not reliable, especially when the bus between modules is long.
The position information is sent to the I/O expansion module through the serial port through the processor. The I/O expansion module obtains the module position information based on the processor position information, and modifies the bus address through the logical configuration software, and saves it in non-volatile memory to achieve dynamic configuration.
Improves the reliability and maintainability of bus address configuration, reduces programming changes, resolves module ID configuration conflicts, and improves the stability and ease of use of the system.
Smart Images

Figure CN119988248B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of bus address allocation, and particularly to a method, device, and storage medium for dynamically configuring a bus address. Background Art
[0002] In the field of modern industrial automation, programmable logic controllers (PLCs) play a crucial role. It is an electronic device for digital operation designed specifically for industrial environments, using a programmable memory to execute operation instructions such as logical operations, sequential control, timing, counting, and arithmetic operations internally, and controlling various types of machinery or production processes through digital and analog inputs and outputs.
[0003] In the patent application publication number CN116132404A, titled "CAN Bus Node Address Allocation Method, Node Device, and Computing Device", a first address is randomly generated; a first broadcast message is received, where 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, where the second broadcast message carries the first address; based on the broadcast result of the second broadcast message and the second address, it is determined that the first address is an available address; and the first address is used as the node address. However, this method will be saved in the memory after the address is allocated and does not have the function of being changeable. Other existing address allocation methods have problems such as randomness, and the bus address may change after repeated power-on; depending on each module having a unique UUID, even the same model I / O expansion modules require different firmware or programs, increasing the production and maintenance costs of the programmable controller; depending on the hardwired connection between modules, enabling the configurable state of the next module through the logic level output by the previous module, this method has poor anti-interference performance and is not reliable especially when the bus length between modules is long; having a large cost and a limited number of bus-expandable I / O expansion modules. Summary of the Invention
[0004] The purpose of the present invention is to solve the deficiencies in the prior art, and provides a method for dynamically configuring a bus address, including the following steps:
[0005] S1: After the PLC is powered on, the processor sends the processor location information to the I / O expansion module through the serial port, and the I / O expansion module obtains the expansion module location information according to the processor location information;
[0006] 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;
[0007] S3: Modify the first bus address according to the logic configuration software and the processor to obtain a second bus address, and write the second bus address into the I / O expansion module. The I / O expansion module stores the second bus address in a non-volatile memory.
[0008] Preferably, in step S1, the I / O expansion module obtains the expansion module location information according to the processor location information, and further includes:
[0009] The first I / O expansion module adjacent to the processor receives the processor location information with a value of 1, adds 1 to its own expansion module location information to obtain the first expansion module location information, and sends the first expansion module information to the second I / O expansion module;
[0010] The second I / O expansion module receives the first expansion module information, adds 1 to its own expansion module location information to obtain the second expansion module location information, and sends the second expansion module information to the next I / O expansion module through the serial port until the expansion module location information allocation is completed;
[0011] Wherein, 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.
[0012] 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, and further includes:
[0013] S21: After the processor is powered on, wait for the heartbeat message of the I / O expansion module. When the heartbeat message is received and it is confirmed that the I / O expansion module is normal, send a scan broadcast frame;
[0014] S22: After the I / O expansion module receives the scan broadcast frame, send a response frame including bus address, expansion module type information, expansion module version information, and expansion module location information;
[0015] S23: After the processor receives the response frame, determine the number of I / O expansion modules, the expansion module location information, and the bus address.
[0016] 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 includes:
[0017] S31: The logic configuration software displays 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;
[0018] S32: Select a first software I / O expansion module whose software bus address needs to be modified from the software I / O expansion modules, and write a legal bus address to obtain a first software bus address;
[0019] S33: The processor finds the target I / O expansion module through the expansion module information, then 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.
[0020] Preferably, in step S33, the processor finds the I / O expansion module through the expansion module information, further includes:
[0021] 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;
[0022] S332: The I / O expansion module receives the SDO query message, determines whether there is a bus address conflict according to the bus address, and if there is a bus address conflict, processes it, and if there is no bus address conflict, configures according to the configuration message.
[0023] Preferably, in step S332, determining whether there is a bus address conflict according to the bus address, and if there is a bus address conflict, processing it, and if there is no bus address conflict, configuring according to the SDO query message further includes:
[0024] 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 alarm prompt processing is performed according to the expansion module position information. If there is no bus address conflict, configuration is performed according to the configuration message.
[0025] Preferably, performing alarm prompt processing according to the expansion module position information further includes:
[0026] When it is detected that there is a bus address conflict between the current I / O expansion module and other I / O expansion modules, the current I / O expansion module is in a security protection state. At this time, the current I / O expansion module can receive information from the bus, but it will not process data packets, that is, it will not execute actions according to data packets, and only receives the configuration packets for configuring the bus address.
[0027] Preferably, receiving the configuration packet for configuring the bus address further includes:
[0028] The CPU sends the configuration packet including the expansion module location information, the bus address, configuration commands, and configuration parameters, and the current I / O expansion module is configured according to the configuration packet.
[0029] Based on the same concept, the present invention also provides a computer device, including a memory and a processor. Computer-readable instructions are stored in the memory. 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.
[0030] Based on the same concept, the present invention also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the dynamic configuration method of the bus address as described in any one of the embodiments.
[0031] Compared with the prior art, the beneficial effects of the present invention are:
[0032] In the present invention, the processor sends the processor location information to the I / O expansion module through the serial port, and the I / O expansion module obtains the expansion module location information according to the processor location information. During use, even if the serial port is interfered and the location information is accidentally modified, the module bus address will not change, and normal communication will not be affected, which has very high reliability.
[0033] In the present invention, 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, and the processor provides the key data to the logic configuration software to realize the display of the I / O expansion module through the logic configuration software.
[0034] The present invention also obtains the second bus address by modifying the first bus address according to the logic configuration software and the processor, and writes the second bus address into the I / O expansion module. This can not only solve the problem of module ID configuration in the programmable controller system, but also a bus ID configuration scheme that can be repeatedly configured. When the system module configuration is adjusted, the modification of the programming program can be minimized.
[0035] 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 conflicts caused by the same factory bus address of the I / O expansion module, and improve the maintainability, stability and usability of the programmable controller system. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered as limiting the present invention.
[0037] Figure 1 It is a structural diagram of the dynamic configuration method of the bus address of the present invention;
[0038] Figure 2 It is a flowchart of the dynamic configuration method of the bus address of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0039] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the scope of protection of the present application.
[0040] Those skilled in the art of the present technology can understand that unless specifically stated, the singular forms "a", "an", and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present invention means the presence of the described 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 their groups.
[0041] The First Embodiment
[0042] In a programmable logic controller system, in order to achieve 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 role, and the I / O expansion module acts as the slave role. In order to achieve communication between one master role and multiple slave roles, a bus address must be assigned to each slave role.
[0043] Please refer to Figure 1The programmable logic controller (PLC) of this embodiment includes a CPU control unit (processor), an I / O control module, and a bus cable (CAN bus). The CPU control unit and the I / O expansion module are connected in series in sequence through the bus cable. In other embodiments, the Profibus bus can also be used.
[0044] Preferably, the position information of the CPU control unit is 1. The CPU control unit sends its own position information to the I / O expansion module 1 through the serial port. At this time, the position information of the I / O expansion module 1 is 2. The I / O expansion module 1 sends its own position information to the I / O expansion module 2 through the serial port. At this time, the position information of the I / O expansion module 1 is 2. From this, it can be deduced that the position information of the I / O expansion module n is n + 1.
[0045] Please refer to Figure 2 As shown, the method for dynamically configuring the bus address provided in this embodiment includes the following steps:
[0046] 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 according to the processor position information. Specifically, in this embodiment, the processor formats the position information according to a certain serial communication protocol. Serial communication requires setting appropriate parameters such as baud rate, data bits, stop bits, and parity bits to ensure that the I / O expansion module can correctly receive data. By adding parity through serial communication, 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. However, the I / O expansion module position information only participates in communication during the process of actively configuring the bus address. Even if the serial port is interfered during use and the position information is accidentally modified, the module bus address will not change and normal communication will not be affected, which has very high reliability.
[0047] Preferably, in step S1, the I / O expansion module obtaining the expansion module position information according to the processor position information further includes:
[0048] 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 in the second position in the PLC system. The I / O expansion module receives the processor position information through its serial port receiver, parses the received data according to the same communication protocol, extracts the position information of the processor, that is, through a certain network topology connection, and the position relationship is defined based on the connection relationship of network nodes. The position of the expansion module is determined according to the network topology rules.
[0049] The second I / O expansion module receives the first expansion module information, adds 1 to its own expansion module location information to obtain the second expansion module location information, and sends the second expansion module information to the next I / O expansion module through the serial port until the allocation of the expansion module location information 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. The nth I / O expansion module changes its own location information to n + 1. The I / O expansion module simply obtains the location information through the serial port and thus obtains a unique identification number in the bus. The CPU control unit can configure each expansion module through the unique identification number. This process has no negotiation and arbitration and is highly efficient;
[0050] 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 the differentiation of the modules. 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 the configurability of the bus address.
[0051] S2: The I / O expansion module sends the 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 the display of the configuration software information. 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. Since the location information obtained by each I / O expansion module is different, the identification information is also different. According to the different identification information, the CPU control unit can automatically allocate the bus address for each expansion module or manually adjust the bus address of any module.
[0052] More preferably, the bus address is the unique identifier of the I / O expansion module in the entire bus communication architecture, which is used for the processor to accurately interact and communicate with it. The expansion module type information clarifies the functional type it possesses, such as digital input / output type, analog input / output type, or a composite type with multiple functions, etc. The expansion module version information is used to understand the update of its functions and the compatibility with other modules or software, etc.
[0053] Preferably, in step S2, the I / O expansion module sends the key data including the bus address, expansion module type information, expansion module version information, and expansion module location information to the processor, which further includes:
[0054] 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 it detects that data is sent, it performs a receiving operation according to the corresponding communication protocol, parses and checks the received data, removes possible redundant information such as check bits, and extracts valid information;
[0055] 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;
[0056] 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.
[0057] 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.
[0058] 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:
[0059] 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;
[0060] S32: Select the first software I / O expansion module for which the software bus address needs to be modified from the software I / O expansion module, and write the legal bus address to obtain the first software bus address. Specifically, in this embodiment, the logic configuration software will perform real-time legality checks on the input content. For example, it checks whether the input format meets the requirements (such as whether it is in the correct hexadecimal or decimal representation form, depending on the system regulations), whether the input value is within the determined legal bus address range, etc. If the requirements are not met, it will prompt the user to make modifications in a timely manner. For example, a prompt box will pop up to inform the user that the input is incorrect 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 through a certain algorithm based on the existing device bus address allocation situation in the system. For example, the software will traverse the list of allocated bus addresses, find free address spaces, and then determine a suitable new bus address in sequence or according to specific rules (such as allocating addresses in sequence according to function partitions, etc.) as the candidate address to be written and present it to the user for confirmation (the generated address can be displayed through a prompt box for the user to choose whether to use it);
[0061] S33: The processor finds the target I / O expansion module through the expansion module information, then modifies the first bus address according to the first software bus address to obtain the second bus address, and writes the second bus address to the target I / O expansion module.
[0062] Preferably, in step S33, the processor finds the I / O expansion module through the expansion module information, which further includes:
[0063] 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.
[0064] S332: The I / O expansion module receives the SDO query message, judges whether there is a bus address conflict according to the bus address. If there is a bus address conflict, it will be processed. If there is no bus address conflict, it will be configured according to the configuration message.
[0065] Preferably, in step S332, judging whether there is a bus address conflict according to the bus address, if there is a bus address conflict, it will be processed, if there is no bus address conflict, it will be configured according to the SDO query message, which further includes:
[0066] 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 judged that there is a bus address conflict, and alarm prompt processing is performed according to the expansion module position information. If there is no bus address conflict, it is configured according to the configuration message.
[0067] Preferably, performing alarm prompt processing according to the extended module location information further includes:
[0068] When it is detected that the current I / O extended module has a bus address conflict with other I / O extended modules, the current I / O extended module is in a security protection state. At this time, the current I / O extended module can receive the information on the bus, but will not process data packets, that is, will not perform actions according to data packets, and only receive configuration packets for configuring the bus address.
[0069] Preferably, receiving the configuration packet for configuring the bus address further includes:
[0070] The CPU sends a configuration packet including the extended module location information, bus address, configuration command, and configuration parameters, and the current I / O extended module is configured according to the configuration packet.
[0071] The I / O extended module location information is only used for uploading module information and changing the module bus address after the module is powered on. The location information of the I / O extended module does not participate in the data interaction during the normal operation of the programmable logic controller system, is compatible with the standard bus protocol, and does not increase the bus load.
[0072] During the normal operation stage of the programmable logic controller system PLC, the main operations are the collection and transmission of various control signals and data, and the execution of corresponding actions according to the control logic. For example, for a digital I / O extended module, it will continuously receive external digital signal inputs and transmit them to the programmable logic controller for processing, or receive output instructions from the programmable logic controller to control the on / off state of external devices; for an analog I / O extended module, it is to perform the conversion and transmission between analog signals and digital signals, such as collecting the analog voltage and current values transmitted by sensors and converting them into digital quantities to provide to the programmable logic controller, and then converting the digital quantities output by the programmable logic controller into analog signals to drive actuators, etc.
[0073] In these conventional data interaction processes, the location information of the I / O extended module does not participate because it has no direct association with these real-time control and data processing operations. The focus of the system is on the input and output data itself and the corresponding logical relationships, 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 data sending and receiving tasks, 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 increase the additional processing burden in the normal data interaction process.
[0074] Second Embodiment
[0075] In some embodiments of the present application, a computer device is further provided, including a memory and a processor. Computer-readable instructions are stored in the memory. When the computer-readable instructions are executed by the processor, the processor is caused to execute the steps of the dynamic configuration method of the bus address in an embodiment of the present invention.
[0076] The present invention also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to execute the steps of the dynamic configuration method of the bus address in an embodiment of the present invention.
[0077] It can be understood that for the aforementioned dynamic configuration method of the bus address, if it is implemented in the form of software functional modules 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, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs, etc., which are various media that can store program codes.
[0078] A computer-readable storage medium may include data signals carried in a baseband or as part of a carrier wave, in which the readable program code is carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium may also be any readable medium other than the readable storage medium, and this readable medium may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination of the above.
[0079] The above are only the preferred embodiments of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions falling within the concept of the present invention belong to the protection scope of the present invention. It should be noted that for those of ordinary skill in the art in this technical field, several improvements and refinements made without departing from the principle of the present invention should also be regarded as within the protection scope of the present invention.
Claims
1. A method for dynamically configuring a bus address, characterized in that It includes the following steps: S1: After the PLC is powered on, the processor sends the processor location information to the I / O expansion module through the serial port, and the I / O expansion module obtains the expansion module location information according to the processor location information; S2: The I / O expansion module sends the key data including the 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: 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, and the I / O expansion module stores the second bus address in the non-volatile memory; In step S1, the I / O expansion module obtains the expansion module location information according to the processor location information, which further includes: The first I / O expansion module adjacent to the processor receives the processor location information with a value of 1, adds 1 to its own expansion module location information to obtain the first expansion module location information, and sends the first expansion module location information to the second I / O expansion module; The second I / O expansion module receives the first expansion module location information, adds 1 to its own expansion module location information to obtain the second expansion module location information, and sends the second expansion module location information to the next I / O expansion module through the serial port until the expansion module location information allocation is completed; Among them, the factory settings of the processor location information and the expansion module location information are 1, and the processor location information cannot be changed; In step S2, the I / O expansion module sends the key data including the bus address, expansion module type information, expansion module version information, and expansion module location information to the processor, which further includes: S21: After the processor is powered on, wait for the heartbeat message of the I / O expansion module. When the heartbeat message is received and it is confirmed that the I / O expansion module is normal, send a scan broadcast frame; S22: After the I / O expansion module receives the scan broadcast frame, send a response frame including the bus address, expansion module type information, expansion module version information, and expansion module location information; S23: After the processor receives the response frame, determine the number of I / O expansion modules, the expansion module location information, and the bus address; In step 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 further includes: S31: The logic configuration software displays the software I / O expansion module on the operation interface according to the expansion module location information including the first expansion module location information and the second expansion module location information and the number of I / O expansion modules; S32: Select the first software I / O expansion module whose software bus address needs to be modified from the software I / O expansion module, and write the legal bus address to obtain the first software bus address; S33: The processor locates the target I / O expansion module based on the expansion module location information, then 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.
2. The dynamic configuration method of the bus address according to claim 1, wherein In step S33, the processor locates the target I / O expansion module based on the expansion module location information, which further includes: 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. If there is a bus address conflict, it will be processed. If there is no bus address conflict, it will be configured according to the configuration message.
3. The dynamic configuration method of the bus address according to claim 2, wherein In step S332, determining whether there is a bus address conflict according to the bus address. If there is a bus address conflict, it will be processed. If there is no bus address conflict, it will be configured according to the configuration message, which further includes: 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 process is performed according to the expansion module location information. If there is no bus address conflict, it is configured according to the configuration message.
4. The dynamic configuration method of the bus address according to claim 3, characterized in that, Performing the alarm prompt process according to the expansion module location information, which further includes: When it is detected that the current I / O expansion module has a bus address conflict with other I / O expansion modules, the current I / O expansion module is in a security protection state. At this time, the current I / O expansion module can receive the information of the bus, but will not process data messages, that is, it will not execute actions according to the data messages, and only receives the configuration message for configuring the bus address.
5. The dynamic configuration method of the bus address according to claim 4, characterized in that Receiving the configuration message for configuring the bus address, which further includes: The CPU sends the configuration message including the expansion module location information, the bus address, the configuration command, and the configuration parameters, and the current I / O expansion module is configured according to the configuration message.
6. A computer device, characterized in that, It includes a memory and a processor. Computer-readable instructions are stored in the memory. 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 claims 1 to 5.
7. 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 execute the steps of the dynamic configuration method of the bus address as described in any one of claims 1 to 5.
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
Online detection configuration file management method for production field of aeronautical manufacturing industry
CN117331614A