An address registration method based on RS485 ring bus
By implementing dual-port collaborative operation of the host and slave port state switching logic, automatic address registration of slave nodes in an RS485 bus ring network is achieved, solving the problems of address configuration errors and network topology changes in existing technologies, and improving the flexibility and reliability of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN BENAN TECH DEV CO LTD
- Filing Date
- 2026-02-27
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, the slave address configuration process of RS485 bus ring networks is prone to errors and cannot adapt to changes in network topology, resulting in high engineering debugging complexity and low system reliability.
The host works collaboratively through dual ports, combined with the slave ABI/ABO port status switching logic, so that the registration command is transmitted sequentially along the ring bus. Each slave automatically increments the received address code by 1 as its own identifier and feeds back its identity information through the response command, thus completing the address registration of the slave nodes in the entire link.
It significantly reduces the complexity of industrial field cabling and debugging, avoids conflicts or errors that may be caused by manual address configuration, improves the flexibility and reliability of the system, and ensures the uniqueness and integrity of address allocation.
Smart Images

Figure CN121728065B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to an address registration method based on an RS485 ring bus. Background Technology
[0002] Among related technologies, CN121125393A, published on 2025-12-12, describes a master-slave communication circuit and method for constructing a ring network based on an RS485 bus. This circuit allows for short circuits or open circuits at any point in the network without affecting system communication. To ensure the normal operation of the network, all slave devices connected to the network must have a unique address code to facilitate inspection and control by the master.
[0003] Address codes can be implemented in several ways. Previously, DIP switches were commonly used. This method, typically set on-site, was prone to errors due to incorrect settings or quality issues with the switches themselves, making on-site troubleshooting difficult. Therefore, it has been gradually phased out. Later, an internal electronic address code was developed, where address codes were written one by one on-site according to the construction drawings using specialized equipment. This method requires an external dedicated code writer, and equipment from different manufacturers is incompatible, making debugging inconvenient. Since the electronic code cannot be directly seen from the external markings, troubleshooting errors and duplicates is even more difficult. The latest method is the ID code, whose uniqueness is determined during manufacturing. It contains more information, requiring multiple bytes, typically 10-16 bits of BCD code. This is unsuitable for direct application in industrial control communication protocols. The conventional approach is to map the address to a single-byte address code, facilitating communication, management, and exchange.
[0004] The simplest and most direct way to obtain the ID codes of field devices from the main controller is to manually copy down the ID code of each device one by one and then enter it into the control host. While this method is simple, it is prone to errors due to the long length of the ID codes, and finding errors afterward is even more difficult. If the ID codes of the field devices are not explicitly displayed on the slave devices, this method will not work. Therefore, how the main controller can quickly obtain the ID codes of all slave devices in the field becomes an engineering requirement. Summary of the Invention
[0005] To avoid conflicts or errors that may result from manual address configuration, this application provides an address registration method suitable for "a master-slave communication circuit and method for constructing a ring network based on RS485 bus", which adopts the following technical solution:
[0006] An address registration method based on an RS485 ring bus includes executing S1-S3 during the initial debugging after the master-slave wiring is completed:
[0007] S1, initial power-on state, all slave ABI and ABO terminals are in receiving state, the slave at the first position of the ring bus receives the registration communication command sent by the master RS485 port 1, the registration communication command includes the master's ID information and the sender's address code.
[0008] S2, start the registration process of the host. RS485 port 1 sends the registration communication command. After the command is sent, it is in the waiting state to receive the response command sent by the host in response to the registration communication command from the slave.
[0009] S3, enter the registration process. The slave device receives the registration communication command, stores the host ID information code, and increments the sender's address code by 1 to obtain its own address code. Then, it executes the following actions sequentially:
[0010] S31, Set the ABI port to output state, and send the response command to the front bus through the ABI port according to the predetermined communication protocol. The response command includes the ID information code of this slave device and the address code of this slave device.
[0011] S32 sets the ABO terminal to output mode and forwards the received registration communication command to the bus behind the ABO terminal. The address code of the sender in the forwarded registration communication command is the address code of this slave device itself. After forwarding, the ABO terminal is set to receive mode.
[0012] S33, the unresponsive slave continues the S3 process until the last slave; the registration communication command forwarded by the last slave through the ABO end is received by the master RS485 port 2.
[0013] By adopting the above technical solution, during the initial commissioning phase, the host computer works collaboratively through dual ports. Combined with the status switching logic of the slave's ABI / ABO ports, the registration command is transmitted sequentially along the ring bus. Each slave automatically increments the received address code by 1 as its own identifier and responds with an answer command to provide its identity information, ultimately completing the address registration of all slave nodes in the entire link. This not only significantly reduces the complexity of cabling and commissioning in industrial fields and avoids conflicts or errors that may result from manual address configuration, but also adapts to changes in network topology, improving the system's flexibility and reliability. Simultaneously, the coordinated sending and receiving of the host's dual ports ensures closed-loop verification of the registration process, effectively guaranteeing the uniqueness and integrity of address allocation.
[0014] Optionally, the address registration method further includes:
[0015] S4, Reset process: After the host obtains the ID information codes of all slave devices, the host sends a reset command from RS485 port 2 according to the predetermined communication protocol. The reset command includes the slave device ID information code and the corresponding encoded address.
[0016] All slave devices will compare the slave ID information code in the received reset command with their own ID code. If the comparison matches, the encoded address sent by the reset command will be stored in the local machine as the address code for subsequent normal inspections, and the local machine registration will be marked as complete.
[0017] The slave device that confirms the reset command sends a response command from its local ABI terminal. The response command is received by the master device's RS485 port 1, and RS485 port 2 repeatedly sends the next slave device's reset command.
[0018] After resetting the addresses of all slave devices, the master RS485 port 2 sends a normal operation mode command, and all slave devices set their ABI end to receive and their ABO end to send, and the master enters normal operation mode.
[0019] By adopting the above technical solution, after the host obtains all slave ID information, it sends a reset command containing the slave ID and its corresponding coded address through RS485 port 2. The slaves accurately write the address by comparing the IDs, ensuring that the final coded address of each slave node is completely consistent with the system plan. Simultaneously, after correctly receiving the address reset command, the slaves send a response to the host's RS485 port 1 through the ABI, forming a two-way verification mechanism to avoid address configuration deviations caused by transmission errors or node anomalies. Finally, through a unified normal working mode command, all slaves automatically switch to the standard state of ABI receiving and ABO sending.
[0020] Optionally, the address registration method further includes:
[0021] After completing the registration and reset process, the slave device will be set to receive mode on the ABI side and send mode on the ABO side each time it is powered on.
[0022] By adopting the above technical solution, smooth communication of the ring bus from RS485 port 1 to RS485 port 2 is ensured, so as to meet the working requirements of the relevant technologies cited in the background of this application.
[0023] Optionally, the address registration method further includes:
[0024] During the registration process, monitor in real time whether the registration progress of the host is stalled;
[0025] If so, a fault warning will be triggered;
[0026] After troubleshooting, re-execute S1-S3.
[0027] By adopting the above technical solution, during the registration process, the host interface displays the registration progress and the received slave device information. Under normal circumstances, the registration process is very fast, checking one slave device approximately every 0.1 seconds. If a slave device or a line issue prevents the process from proceeding, the host registration process will stall. Therefore, if a stall in the host registration process is detected, a fault warning is triggered. After manually troubleshooting the fault, the registration process is restarted. Because the registration process is incomplete, after the system is powered on again, all slave devices' ABI and ABO ends are in receiving mode, re-entering the registration process until it is successfully completed.
[0028] Optionally, the address registration method further includes:
[0029] When the host is in normal working mode, the host performs a confirmation registration process every time it is powered on, checking whether the ID information of the field slave is consistent with the information registered inside the host.
[0030] If yes, it will enter normal working mode; otherwise, the host will display an error message.
[0031] By adopting the above technical solution, we can prevent the application of unregistered products and also prevent address code confusion that could lead to alarm errors.
[0032] Optionally, the address registration method further includes:
[0033] When a new slave device is added or replaced in the ring bus, the master device checks whether the slave device ID information code stored in its own memory matches the current slave device ID information code.
[0034] If so, then the current slave device is determined to be a slave device that has been registered in the system and whose encoding address has been reset. When the current slave device is powered on, the ABI end is set to receive mode and the ABO end is set to send mode.
[0035] If not, then determine that the current slave device is a slave device in the system that has not been registered and whose coded address has not been reset, and execute S1-S4.
[0036] By adopting the above technical solution, for a ring bus that has been debugged and is in operation, there may be opportunities to add or replace devices. Device replacement includes replacing old devices and replacing new devices. Replacing old devices refers to replacing slave devices that have been registered and have their coded addresses reset in this system; that is, repairing the original slave devices and reconnecting them to the system. Replacing new devices refers to replacing slave devices that have not been registered and have their coded addresses reset in this system; that is, replacing the original slave devices with entirely new ones. For replacing slave devices that have already been registered and have their coded addresses reset in this system, the system can identify the device through a registration confirmation process, without affecting the operation of the original system. For replacing slave devices that have not been registered and have their coded addresses reset in this system, or for adding new devices, the device's ID information code is not present in the host, indicating that the device has not been registered and its coded address reset, and both the ABI and ABO ends are in receive mode upon power-up. Regardless of the location of newly added or replaced devices in the ring bus system, the number of devices, or whether they are in consecutive positions, based on the status of each slave device as described above, the communication channel between the master RS485 port 1 and the first newly added or replaced device on the ring bus is unobstructed. The master RS485 port 1 sends a re-registration communication command, which will be received by the first newly added or replaced device and all slave devices preceding it. Other slave devices that have already been registered will no longer respond to the re-registration communication command. The first newly added or replaced device responds to the master's communication command, completes the registration of all newly added or replaced devices according to the registration process, and then completes the reset process. All newly added or replaced devices, together with the existing devices, form a new system and enter normal operating mode. This process is a solution based on actual engineering needs when there are replaced or added devices on the bus. It is a branch of the registration confirmation process, making the solution more practical.
[0037] In summary, this application includes at least one of the following beneficial technical effects:
[0038] 1. During the initial commissioning phase, the host computer works collaboratively through dual ports. Combined with the status switching logic of the slave's ABI / ABO ports, registration commands are transmitted sequentially along the ring bus. Each slave automatically increments the received address code by 1 as its own identifier and responds with an answer command to provide its identity information, ultimately completing the address registration of all slave nodes in the entire link. This not only significantly reduces the complexity of cabling and commissioning in industrial fields, avoiding conflicts or errors that may result from manual address configuration, but also adapts to changes in network topology, improving the system's flexibility and reliability. Furthermore, the registration process determines the positional order of all slaves on the ring bus, facilitating engineering inspection.
[0039] 2. Reset the process and reassign the inspection address codes according to the system design requirements to simplify the engineering debugging process;
[0040] 3. Confirm the registration process to prevent the use of unregistered products and address code confusion, which could lead to incorrect alarms.
[0041] 4. Re-register the product to ensure that any new or replaced products on the bus can smoothly enter the working state. Attached Figure Description
[0042] Figure 1 This is a flowchart of the address registration method for this application;
[0043] Figure 2 This is a diagram illustrating one application method of the registration process. Detailed Implementation
[0044] To make the purpose, technical solution, and advantages of this application clearer, the following description is provided in conjunction with the appendix. Figures 1-2 The present application will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the application.
[0045] This application discloses an address registration method based on an RS485 ring bus. This method aims to address the problem of an undefined address registration mechanism in the related technology "A Master-Slave Communication Circuit and Method for Constructing a Ring Network Based on an RS485 Bus," thereby further improving the engineering debugging efficiency of the RS485 ring bus. In the related technology, the master needs to know the address code of each slave in advance, whether it originates from its own ID or a mapped short-coded address, and uses this address for inspection and fault diagnosis. However, the specific registration process for the address code is not defined. This application focuses on this aspect, proposing a method for obtaining the slave ID information code and reassigning address codes to it. This process aims to enable the master to clearly understand the device composition on the bus and assign valid addresses for inspection responses to each slave, thereby more completely supporting and optimizing the implementation process of the related technology. It should be noted that this application directly uses the master-slave communication circuit from the related technology, so its system structure will not be described in detail.
[0046] Reference Figure 1 The address registration method includes executing S1-S4 during the initial debugging after the master-slave connection is completed:
[0047] S1, initial power-on state;
[0048] All slave devices are in receive mode on both the ABI and ABO ends. The slave device at the first position on the ring bus receives the registration communication command sent by the master RS485 port 1. The registration communication command includes the master's ID information and the sender's address code.
[0049] S2, Initiate the host registration process;
[0050] RS485 port 1 sends a registration communication command. After sending, it enters a waiting state to receive the response command sent by the master in response to the registration communication command from the slave device.
[0051] S3, proceeding with the registration process;
[0052] The slave device receives the registration communication command, stores the host ID information code, and increments the sender's address code by 1 to obtain its own address code. This address code is actually equivalent to the slave device's sequence code in the ring bus. Then, it sequentially executes the following actions:
[0053] S31, set the ABI port to output state, and send the response command to the front bus through the ABI port according to the predetermined communication protocol. The response command includes the ID information code of this slave device and the address code of this slave device.
[0054] S32 sets the ABO terminal to output mode and forwards the received registration communication command to the bus behind the ABO terminal. The address code of the sender in the forwarded registration communication command is the address code of this slave device. After forwarding, the ABO terminal is set to receive mode.
[0055] S33, the unresponsive slave continues the S3 process until the last slave; the registration communication command forwarded by the last slave through the ABO end is received by the master RS485 port 2;
[0056] S4, reset process;
[0057] After the host obtains the ID information codes of all slave devices, the host sends a reset command from RS485 port 2 according to the predetermined communication protocol. The reset command includes the slave ID information code and the corresponding encoded address.
[0058] All slave devices will compare the slave ID information code in the received reset command with their own ID code. If the comparison matches, the encoded address sent by the reset command will be stored in the local machine as the address code for subsequent normal inspections, and the local machine registration will be marked as complete.
[0059] The slave device that confirms the reset command sends a response command from its local ABI terminal. The response command is received by the master device's RS485 port 1, and RS485 port 2 repeatedly sends the next slave device's reset command.
[0060] After resetting the addresses of all slave devices, the master RS485 port 2 sends a normal working mode command. All slave devices set their ABI end to receive and their ABO end to send. The master is in normal working mode, which is the working mode described in the related technology "A master-slave communication circuit and method for constructing a ring network based on RS485 bus".
[0061] It should be noted that in the registration process S1-S3, the host is only the initiator of the process. That is, the host only needs to issue an instruction once. After receiving the registration instruction, the slave device immediately adjacent to the host first responds to the host, and then forwards the registration communication instruction to the slave devices behind the bus. Subsequent slave devices complete the same process in turn, and the host receives the response information from the slave devices in turn.
[0062] In addition, after completing the registration and reset process, the slave device will be set to receive mode on the ABI side and send mode on the ABO side each time it is powered on.
[0063] Furthermore, the address registration method also includes:
[0064] During the registration process, monitor in real time whether the registration progress of the host is stalled;
[0065] If so, a fault warning will be triggered, and S1-S3 will be re-executed after the fault is resolved.
[0066] Specifically, registration is the first debugging after the system wiring is completed. It is possible that the registration process cannot be completed in one go due to a problem with a slave device or the line.
[0067] During the registration process, the host interface displays the registration progress and the received slave device information. Normally, the progress is very fast, checking one slave device approximately every 0.1 seconds. If a slave device or a line issue prevents the process from continuing, the host will pause, issue a fault warning after a delay, and restart the registration process after manual assistance to resolve the problem. Because the registration process is incomplete, after the system is powered on again, all slave devices' ABI and ABO ends will be in receiving mode, and the registration process will restart until it is successfully completed.
[0068] After the registration process, the host obtains the ID information codes of all slave devices and their position order in the ring bus, which are then displayed as a sequential list. Debugging personnel can reassign address codes to each slave device according to the requirements of the construction drawings, or they can use the sequence number as the address code to identify the drawings, ensuring consistency between the drawing number and the address code.
[0069] After confirmation, a reset process is initiated, which involves resetting the address code for bus inspection using the slave device's ID information code as an identifier. The reset command includes the slave device's ID information code and address code. The slave device determines whether the ID information code received from the master device matches its own ID information code, and then resets the address code, using it as the address code for future inspections.
[0070] Furthermore, the address registration method also includes:
[0071] When the host is in normal working mode, the host performs a confirmation registration process every time it is powered on, checking whether the ID information of the field slave is consistent with the information registered inside the host.
[0072] If yes, it will enter normal working mode; otherwise, the host will display an error message and wait for manual confirmation.
[0073] The registration confirmation process involves two types of exceptions:
[0074] 1. The slave device has been registered in other systems. After power-on, the ABI terminal is in receive mode and the ABO terminal is in transmit mode. Although it can ensure smooth communication from RS485 port 1 to RS485 port 2 in a loop, the ID information code of the slave device does not correspond to the ID information code stored in the host of this system. The host will trigger an alarm and remind manual intervention.
[0075] 2. If the slave device has never been registered, i.e., it is a new device, then after power-on, both the ABI and ABO ends will be in receive mode, causing the ring communication to be interrupted, the system to malfunction, the host to alarm, and prompt manual intervention; this situation can be resolved by re-registering.
[0076] It should be noted that the registration confirmation process can be called as an independent subroutine according to actual project needs.
[0077] Furthermore, the address registration method also includes:
[0078] When a new slave device is added or replaced in the ring bus, the master device checks whether the slave device ID information code stored in its own memory matches the current slave device ID information code.
[0079] If so, then the current slave device is determined to be a slave device that has been registered in the system and whose encoding address has been reset. When the current slave device is powered on, the ABI end is set to receive mode and the ABO end is set to send mode.
[0080] If not, then the current slave device is determined to be a slave device in the system that has not been registered and whose coded address has not been reset, and the re-registration process (S1-S4) is executed.
[0081] Specifically, for systems that have been debugged and are in operation, there may be the possibility of adding or replacing equipment. Replacement equipment includes replacing old equipment and replacing new equipment.
[0082] For replacing old devices, i.e., replacing slave devices that have been registered and had their coded addresses reset in this system, the devices can be reconnected to the system after the maintenance is completed. The system can recognize the device through the registration confirmation process, without affecting the operation of the original system.
[0083] For newly replaced devices, i.e., replacement of slave devices that have not been registered and recoded in this system, or newly added devices, the device's ID information code is not in the host of this system, and no corresponding coding address has been assigned. The registration process needs to be carried out again to obtain the coding address.
[0084] For newly added or replaced devices, their status is "unregistered and address not reset," and both the ABI and ABO terminals are in receive mode upon power-up. For slave devices that have already been registered in this system and have had their address reset, the ABI terminal is in receive mode and the ABO terminal is in transmit mode upon power-up.
[0085] Regardless of the location of any newly added or replaced device in the ring bus system, the number of devices, or whether they are in consecutive positions, the communication channel between the master RS485 port 1 and the first newly added or replaced device on the ring bus remains open, based on the status of each slave device as described above. Therefore, after re-entering the registration process, the re-registration communication command sent by the master RS485 port 1 can be received by the first newly added or replaced device on the ring bus and all slave devices preceding it. Other slave devices that have already been registered will no longer respond to the re-registration communication command. The first newly added or replaced device responds to the master's communication command, completes the registration of all newly added or replaced devices according to the registration process, and then, as needed, manually sets the encoding address, completes the reset process, and all newly added or replaced devices form a new system with the existing devices, entering normal working mode.
[0086] Reference Figure 2 Application instructions:
[0087] To facilitate the explanation of the registration process, the transmission of information at each step and the corresponding RS485 port directionality are illustrated in diagrams. An example of one master and four slaves is used here. The green lines in the diagram represent information transmission; the direction of information transmission must be considered in conjunction with the direction control terminals of both the master and slaves. In the diagram, a vertical line at the bottom of the box indicates that the slave is receiving information; a vertical line at the top of the box indicates that the slave is sending information. The direction of information sent by the slave must be considered in conjunction with the direction control terminals of both the master and slaves. The red directional arrows in the diagram indicate changes sent by the direction control terminals of the corresponding master or slave after the previous step. It should be noted that the slave direction control terminals have been described in the relevant technologies cited in the background section of this application.
[0088] Step S1: The host RS485 port 1 sends a registration communication command, which is received by slave 1. Both the ABI and ABO ports of slave 1 are in receive mode.
[0089] Step S2: The host RS485 port 1 is switched to receive mode, the slave 1 ABI is switched to transmit mode, the slave 1 sends an acknowledgment command from the ABI, and this information is received by the host RS485 port 1.
[0090] Step S3: Slave 1 changes the ABI end to receive mode and the ABO end to send mode; Slave 1 forwards the registration communication command, which is sent from the ABO end and received by slave 2.
[0091] Step S4: Slave 1 changes the ABI end to transmit mode and the ABO end to receive mode; Slave 2 changes the ABI end to transmit mode and sends an acknowledgment command from the ABI end. This information is received by the host RS485 port 1.
[0092] Step S5: Slave 2 changes the ABI end to receive mode and the ABO end to send mode; Slave 2 forwards the registration communication command, which is sent from the ABO end and received by slave 3.
[0093] Step S6: Slave 2 changes the ABI end to transmit mode and the ABO end to receive mode; Slave 3 changes the ABI end to transmit mode and sends an acknowledgment command from the ABI end. This information is received by the host RS485 port 1.
[0094] Step S7: Slave 3 changes the ABI end to receive mode and the ABO end to send mode; Slave 3 forwards the registration communication command, which is sent from the ABO end and received by slave 4.
[0095] Step S8: Slave 3 changes the ABI end to transmit mode and the ABO end to receive mode; Slave 4 changes the ABI end to transmit mode and sends an acknowledgment command from the ABI end. This information is received by the host RS485 port 1.
[0096] Step S9: Slave 4 changes the ABI end to receive mode and the ABO end to send mode; Slave 4 forwards the registration communication command, which is sent from the ABO end and received by the host RS485 port 2.
[0097] Step S10: Slave device 4 changes its ABI port to transmit mode and its ABO port to receive mode; host RS485 port 2 changes to transmit mode, and the registration process ends. Prepare for the reset process from RS485 port 2.
[0098] It should be noted that the registration process and its derivative auxiliary processes (confirmation registration process, re-registration process) are all independent subroutines. They can be called by the "related technology" "A master-slave communication circuit and method for constructing a ring network based on RS485 bus" during engineering debugging, or when necessary. They do not interfere with the normal operation of "A master-slave communication circuit and method for constructing a ring network based on RS485 bus" or affect its function. Their purpose is only to make "A master-slave communication circuit and method for constructing a ring network based on RS485 bus" more practical.
[0099] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce a good effect.
[0100] The above are all preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features unless specifically stated otherwise. That is, unless specifically stated otherwise, each feature is only one example of a series of equivalent or similar features.
Claims
1. An address registration method based on an RS485 ring bus, characterized in that, include: S1, initial power-on state, all slave ABI and ABO terminals are in receiving state, the slave at the first position of the ring bus receives the registration communication command sent by the master RS485 port 1, the registration communication command includes the master's ID information and the sender's address code. S2, start the registration process of the host. RS485 port 1 sends the registration communication command. After the command is sent, it is in the waiting state to receive the response command sent by the host in response to the registration communication command from the slave. S3, enter the registration process. The slave device receives the registration communication command, stores the host ID information code, and increments the sender's address code by 1 to obtain its own address code. Then, it executes the following actions sequentially: S31, Set the ABI port to output state, and send the response command to the front bus through the ABI port according to the predetermined communication protocol. The response command includes the ID information code of this slave device and the address code of this slave device. S32 sets the ABO terminal to output mode and forwards the received registration communication command to the bus behind the ABO terminal. The address code of the sender in the forwarded registration communication command is the address code of this slave device itself. After forwarding, the ABO terminal is set to receive mode. S33, the unresponsive slave continues the S3 process until the last slave; the registration communication command forwarded by the last slave through the ABO end is received by the master RS485 port 2; S4, Reset process: After the host obtains the ID information codes of all slave devices, the host sends a reset command from RS485 port 2 according to the predetermined communication protocol. The reset command includes the slave device ID information code and the corresponding encoded address. All slave devices will compare the slave ID information code in the received reset command with their own ID code. If the comparison matches, the encoded address sent by the reset command will be stored in the local machine as the address code for subsequent normal inspections, and the local machine registration will be marked as complete. The slave device that confirms the reset command sends a response command from its local ABI terminal. The response command is received by the master device's RS485 port 1, and RS485 port 2 repeatedly sends the next slave device's reset command. After completing the address reset of all slave devices, the master RS485 port 2 sends a normal working mode command, and all slave devices set the ABI end to receive and the ABO end to transmit, and the master is in normal working mode. After completing the registration and reset process, the slave device will be set to receive mode on the ABI side and send mode on the ABO side each time it is powered on.
2. The address registration method based on an RS485 ring bus according to claim 1, characterized in that, The address registration method further includes: During the registration process, monitor in real time whether the registration progress of the host is stalled; If so, a fault warning will be triggered; After troubleshooting, re-execute S1-S3.
3. The address registration method based on an RS485 ring bus according to claim 1, characterized in that, The address registration method further includes: When the host is in normal working mode, the host performs a confirmation registration process every time it is powered on, checking whether the ID information of the field slave is consistent with the information registered inside the host. If yes, it will enter normal working mode; otherwise, the host will display an error message.
4. The address registration method based on an RS485 ring bus according to claim 3, characterized in that, The address registration method further includes: When a new slave device is added or replaced in the ring bus, the master device checks whether the slave device ID information code stored in its own memory matches the current slave device ID information code. If so, then the current slave device is determined to be a slave device that has been registered in the system and whose encoding address has been reset. When the current slave device is powered on, the ABI end is set to receive mode and the ABO end is set to send mode. If not, then determine that the current slave device is a slave device in the system that has not been registered and whose coded address has not been reset, and execute S1-S4.