Communication bus slave station number distribution detection method and device

Through the use of automatic station number allocation bus and custom protocol information, the station number is allocated and verified by slave stations one by one, the problems of slave station configuration errors and resource waste in the existing technology are solved, and efficient and accurate station number allocation and system are achieved reliability.

CN119276837APending Publication Date: 2025-01-07FUZHOU WECON ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411286191.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

In a one-master-multiple slave RS485 system, it is difficult for the prior art to effectively configure and manage the unique station numbers of multiple slaves, resulting in configuration errors and waste of resources, and the configuration process is inefficient.

Method used

Using the automatic station number allocation bus method, the main station sends enable signals and custom protocol information, allocates station numbers one by one, and interactive verification is performed through the communication serial port line to ensure the accuracy and uniqueness of station number allocation and avoid hardware Use of dial switch.

Benefits of technology

The slave configuration process is simplified, the accuracy and efficiency of station number allocation is improved, resources are saved, the correctness of station number allocation and system reliability are ensured, and configuration errors and resource waste are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276837A_ABST
    Figure CN119276837A_ABST
Patent Text Reader

Abstract

The invention discloses a communication bus slave station number distribution detection method and device, and the method comprises the steps that a master station transmits an enabling signal to a first slave station through an enabling line in an automatic station number distribution bus, so that the first slave station opens a communication serial port line, and meanwhile, the master station transmits user-defined protocol information to the first slave station; the first slave station stores and sets a station number and a use address according to the user-defined protocol information, the configuration process is simplified, the configuration efficiency is improved, communication is carried out through an automatic station number distribution bus, and the problem that a dial switch occupies many slave station IO interfaces is solved; and interacting with the first slave station through the communication bus, taking the next slave station as the first slave station when the interaction succeeds, and repeating the execution steps of the method until each slave station in the communication bus performs station number distribution, thereby ensuring the correctness of station number distribution and improving the reliability of the device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of embedded technology, and in particular to a method and a device for detecting the distribution of station numbers of slave stations on a communication bus. Background Art

[0002] At present, the station number allocation method of the slave device based on RS485 is usually: the slave station configures its own station number, and the slave station configures the station number through other communication interfaces or hardware dial code development. However, this configuration method has defects. In a system structure with one master and multiple slaves, each slave station needs to have a different station number so that the master station can identify and obtain the data of the corresponding module according to the station number. For example: in a PLC as a master device and multiple slave devices are connected through an RS485 bus, each slave device sets its station number through a physical dial switch, and dialing to 1 represents the slave station number 1. When it needs to be expanded to 250 slave devices, it is not only easy to have the problem of station number configuration error, but also the configuration workload is large and the efficiency is low. In addition, the station number configuration of each slave device needs to occupy 8 switch quantities, resulting in a waste of resources and increasing the complexity of hardware connection. Therefore, there is an urgent need for a method and device for detecting the station number allocation of a communication bus slave station that can solve the above problems. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a method and device for detecting the station number allocation of slave stations on a communication bus, which can allocate a station number to each slave station through an automatic station number allocation bus, solve the problem that the station number allocation of multiple slave station devices is difficult and error-prone, thereby improving the accuracy and convenience of station number allocation.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0005] A method for detecting the station number allocation of a communication bus slave station, comprising the steps of:

[0006] S1. The master station sends an enable signal to the first slave station through an enable line in an automatic station number allocation bus, so that the first slave station turns on a communication serial port line. The automatic station number allocation bus includes an enable line and a communication serial port line.

[0007] S2, the master station sends the custom protocol information to the first slave station through the opened communication serial port line, so that the first slave station saves and sets the station number and the use address according to the custom protocol information;

[0008] S3. The master station interacts with the first slave station through the communication bus. If the interaction is successful, it is determined that the station number of the first slave station is successfully allocated, the first slave station closes the communication serial port line, the master station closes the enable signal of the first slave station and sends an enable signal to the next slave station, so that the next slave station acts as the first slave station and opens the communication serial port line, and repeats step S2 until each slave station in the communication bus is allocated a station number.

[0009] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0010] A device for detecting station number allocation of a communication bus slave station comprises a master station and a slave station, and implements each step of the above-mentioned method for detecting station number allocation of a communication bus slave station.

[0011] The beneficial effects of the present invention are as follows: the present invention provides a method and device for detecting the station number allocation of a communication bus slave station. By using an automatic station number allocation bus, a master station can allocate a station number to each slave station according to a first configuration table, thereby simplifying the configuration process, avoiding configuration errors, and improving configuration accuracy and efficiency; utilizing an enable signal line and a communication serial port line for communication, thereby avoiding a large number of hardware dip switches, and solving the problem of the dip switches occupying many slave station IO interfaces, thereby saving resources; the master station interacts and verifies with the slave station through an RS485 bus to ensure the correctness of the station number allocation and improve the reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 A flow chart of a method for detecting the station number allocation of a communication bus slave station according to an embodiment of the present invention;

[0013] Figure 2 A schematic diagram of a device for detecting station number allocation of a communication bus slave station according to an embodiment of the present invention;

[0014] Figure 3 A bus framework diagram of a method for detecting station number allocation of a communication bus slave station according to an embodiment of the present invention;

[0015] Description of labels:

[0016] 1. A device for detecting the station number distribution of a communication bus slave station; 2. A master station; 3. A slave station. DETAILED DESCRIPTION

[0017] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0018] Please refer to Figure 1 The embodiment of the present invention provides a method for detecting the station number allocation of a communication bus slave station, comprising the steps of:

[0019] S1. The master station sends an enable signal to the first slave station through an enable line in an automatic station number allocation bus, so that the first slave station turns on a communication serial port line. The automatic station number allocation bus includes an enable line and a communication serial port line.

[0020] S2, the master station sends the custom protocol information to the first slave station through the opened communication serial port line, so that the first slave station saves and sets the station number and the use address according to the custom protocol information;

[0021] S3. The master station interacts with the first slave station through the communication bus. If the interaction is successful, it is determined that the station number of the first slave station is successfully allocated, the first slave station closes the communication serial port line, the master station closes the enable signal of the first slave station and sends an enable signal to the next slave station, so that the next slave station acts as the first slave station and opens the communication serial port line, and repeats step S2 until each slave station in the communication bus is allocated a station number.

[0022] From the above description, it can be seen that the beneficial effects of the present invention are: by using the automatic station number allocation bus, the master station can allocate a station number to each slave station according to the first configuration table, simplifying the configuration process, avoiding configuration errors, and improving configuration accuracy and efficiency; using enable signal lines and communication serial port lines for communication, avoiding a large number of hardware dip switches, and solving the problem of dip switches occupying many slave station IO interfaces, thereby saving resources; the master station interacts with the slave station through the RS485 bus to verify the correctness of the station number allocation and improve the reliability of the system.

[0023] Furthermore, the step S2 is specifically as follows:

[0024] The master station obtains the slave station number corresponding to the first slave station according to the first configuration table, and sends the custom protocol information to the first slave station through the communication serial port line, wherein the first configuration table includes the slave station position and the slave station number, and the custom protocol information includes identification information, version information, function code information, slave station number information, and verification information;

[0025] The first slave station saves and sets the station number and the use address according to the custom protocol information, and saves the station number information in a flash memory.

[0026] From the above description, it can be seen that data transmission through the communication serial port line can achieve fast data exchange and real-time communication, and can avoid the use of a large number of hardware dip switches, solve the problem of dip switches occupying more slave station IO interfaces, and improve communication efficiency; adopt custom protocols, flexibly design communication protocols according to actual needs, improve device flexibility and scalability, custom protocol information includes slave station number information and verification information, which can verify the transmitted data to ensure data integrity and accuracy, ensure accurate slave station number allocation, and save the station number information to flash memory to prevent data loss, and provide convenience for subsequent master station polling inquiries, thereby improving the reliability of the device.

[0027] Furthermore, the first slave station saves and sets the station number and the use address according to the custom protocol information, and saves the station number information in a flash memory, further comprising:

[0028] The first slave station returns a modification success signal to the master station, and when the master station does not receive the modification success signal, it stops sending an enable signal to the next slave station.

[0029] From the above description, it can be seen that by returning the modification success information to the master station through the first slave station, the master station can confirm that the first slave station has correctly received the custom protocol information sent by the master station, thereby ensuring the reliability of communication; when the master station does not receive the modification success signal, it stops sending the enable signal to the next slave station, providing an error detection and processing mechanism to avoid abnormal operation of the device due to configuration errors and improve the stability of the device.

[0030] Furthermore, the step S3 further includes:

[0031] All slave stations connected to the communication bus are polled through the automatic station number allocation bus to obtain the station number of each slave station, and the station number is filled in the corresponding position of the second configuration table, the second configuration table is traversed, the station number in the second configuration table is checked, and when an illegal station number exists, the corresponding illegal station number is returned.

[0032] From the above description, it can be seen that all slave stations are polled and queried through the automatic station number allocation bus to obtain the station number information of each slave station and store it in the second configuration table. By traversing and checking the second configuration table, illegal station numbers in the table are effectively identified, and incorrect configurations or potential faulty equipment in the device are discovered in time, and the corresponding illegal station number is returned to quickly locate the error position, thereby taking processing measures to improve the stability of the device and ensure the operation of the device.

[0033] Furthermore, the checking of the station number of the second configuration table further includes: when there is a duplicate station number, returning the slave station position corresponding to the duplicate station number, and resetting the station number for the slave station.

[0034] From the above description, it can be seen that by traversing and checking the second configuration table, the problem of duplicate station numbers can be discovered and handled in a timely manner, thereby avoiding device failure or data loss due to configuration errors, and improving device reliability and stability; when there is a duplicate station number, the station number position corresponding to the duplicate station number is returned, and the station number is reset for it to ensure that each slave station number is unique, so as to facilitate management and tracking of the status of each slave station.

[0035] Please refer to Figure 2 Another embodiment of the present invention provides a device for detecting the station number allocation of a communication bus slave station, including a master station and a slave station, to implement the various steps of the above-mentioned method for detecting the station number allocation of a communication bus slave station.

[0036] The method and device for detecting the station number allocation of a communication bus slave station of the present invention are suitable for solving the problem of difficulty and error in allocating station numbers of multiple slave devices in the embedded field, and are described below through specific implementation methods:

[0037] Embodiment 1

[0038] Please refer to Figure 1 , a method for detecting the station number allocation of a communication bus slave station, comprising the steps of:

[0039] S1. The master station sends an enable signal to the first slave station through an enable line in an automatic station number allocation bus, so that the first slave station opens a communication serial port line. The automatic station number allocation bus includes an enable line and a communication serial port line.

[0040] In this embodiment, please refer to Figure 3 , Figure 3The invention discloses a bus framework diagram of a method for detecting the station number allocation of a communication bus slave station. The bus framework specifically includes a communication bus and a universal I / O interface, wherein the communication bus includes RS485 and RS232, a master station and multiple slave stations use RS485 bus cascade connection, and are connected to an automatic station number allocation bus (ACS bus), the automatic station number allocation bus includes an enable line (EN line) and a communication serial port line (USART serial port, including a TX line and an RX line, the TX line and the RX line are the sending line and the receiving line of RS232 respectively), the enable line is connected from the master station to slave station 1, and from station 1 to slave station 2, and so on, the slave station has a signal line for receiving and outputting an enable signal. When the enable line is turned on, the master station interacts with the slave station through the communication serial port line, and only one slave station will reply data, ensuring one-to-one communication and no data conflict. Therefore, the master station sends an enable signal to the first slave station through the enable line in the automatic station number allocation bus, so that the first slave station opens the communication serial port line, so that when the master station sends data subsequently, the slave station can receive data and return a response signal to ensure smooth communication. Among them, the enable signal is a GPIO, the master station has only output, and the first slave station has input and output. The signal received by the first slave station is the enable signal output by the master station.

[0041] S2. The master station sends the custom protocol information to the first slave station through the opened communication serial port line, so that the first slave station saves and sets the station number and the use address according to the custom protocol information.

[0042] In this embodiment, the master station obtains the slave station number corresponding to the first slave station according to the first configuration table, and sends the custom protocol information to the first slave station through the opened communication serial port line, and transmits data through the communication serial port line to achieve fast data interaction and real-time communication, and avoids the use of a large number of hardware dip switches, solving the problem of the dip switches occupying many slave station IO interfaces. The first configuration table is set by the user to the master station, including the slave station position and the slave station number, which is used to store the station number information of each slave station, and the corresponding station number is assigned to it according to the slave station position. The station number can be configured at will but cannot be repeated. , if the setting is repeated, the master station will report an error; the custom protocol information includes identification information, version information, function code information, slave station number information, and verification information. The communication protocol is flexibly designed according to actual needs to improve the flexibility and scalability of the device. The transmission data is checked using the slave station number information and verification information to ensure the integrity and accuracy of the data and the accurate allocation of the slave station number; the first slave station saves and sets the station number and the use address according to the custom protocol information, and saves the station number information to the flash memory to prevent data loss, facilitate subsequent polling inquiries by the master station, and improve the reliability of the device. For example, the master station modifies the station number of the first slave station according to the first configuration table. The content of the first configuration table is shown in Table 1:

[0043] Table 1 First configuration table

[0044] Slave Location Station No. 1 2 2 19 3 3 4 5 n 6

[0045] The master station sends the identification + version + function code + slave station number + inspection information to the slave station through the communication serial port line of the automatic station number allocation bus according to the custom protocol. After receiving this information, the slave station saves the value to the flash memory and sets it as the slave station address. The slave station number is changed from 1 to 2.

[0046] Furthermore, in this embodiment, the first slave station saves and sets the station number and the usage address according to the custom protocol information, and saves the station number information in the flash memory, and also includes: the first slave station returns a modification success signal to the master station, and when the master station does not receive the modification success signal, it stops sending the enable signal to the next slave station. The main body confirms through the modification success signal that the first slave station has correctly received the custom protocol information it sent, thereby ensuring the reliability of communication, and providing an error detection and processing mechanism to avoid abnormal operation of the device due to configuration errors, thereby improving the stability of the device.

[0047] S3, the master station interacts with the first slave station through the communication bus, if the interaction is successful, it is determined that the station number of the first slave station is successfully allocated, the first slave station closes the communication serial port line, the master station closes the enable signal of the first slave station and sends an enable signal to the next slave station, so that the next slave station acts as the first slave station and opens the communication serial port line, and repeats step S2. Until each slave station in the communication bus is assigned a station number.

[0048] In this embodiment, the master station performs verification interaction with the slave station through the communication bus to ensure the correctness of the station number allocation. Only when the interaction is successful, the station number allocation operation of the next slave station is performed until the station number allocation of each slave station is completed, thereby improving the reliability of the system.

[0049] Furthermore, in the present embodiment, the step S3 also includes: polling all slave stations connected to the communication bus through the automatic station number allocation bus, reading the station number frame format as: frame identification + frame version + function code + CRC check, obtaining the station number of each slave station, and filling the station number into the corresponding position of the second configuration table, traversing the second configuration table, checking the station number in the second configuration table, and when there is an illegal station number, returning the corresponding illegal station number, and returning the frame information format as: frame identification + frame version + function code + slave station number + CRC check, so as to quickly locate the error position, timely discover the wrong configuration in the device, take processing measures, improve the stability of the device, and ensure the operation of the device.

[0050] Furthermore, in the present embodiment, the checking of the station number of the second configuration table also includes: when there is a duplicate station number, returning the slave station position corresponding to the duplicate station number, and resetting the station number for the slave station, promptly discovering and handling the problem of duplicate station numbers, avoiding device failure and / or data loss due to configuration errors, improving device reliability and stability, and ensuring that each slave station number is unique, so as to facilitate management and tracking of the status of each slave station.

[0051] Furthermore, in this embodiment, the master station polls all the slave stations connected to the communication bus through the automatic station number allocation bus. In addition to obtaining the station number information, it also includes monitoring the operating status of each slave station, reading the status information and error information of each slave station, and reporting it to the master station. The master station starts polling every 100ms, enables the first slave station, reads the status information and error information, stores it in the master station, reads the second station after completion, and so on, to obtain the status information of all slave stations without affecting the communication of the communication bus, wherein the station number reading frame format is: frame identification + frame version + function code + CRC check, and the slave station return frame information format is: frame identification + frame version + function code + status information + error information + CRC check.

[0052] Take the injection molding extruder as an example. Under normal circumstances, when the extruder needs to use 256 channels of temperature detection, since a module generally only provides 4 channels, 64 modules are needed at this time. When the master station is PLC, the modbus protocol is used for communication, and the station numbers of 64 units need to be configured. If the above-mentioned method of detecting the station number allocation of the communication bus slave is applied to the extruder, specifically: use a PLC as the master station, cascade the RS485 of the 64 slave modules with the RS485 of the PLC, cascade the communication serial port line of the automatic station number allocation bus with the RS232 of the PLC, and connect the enable line to the output Y point of the PLC. The PLC automatically configures the station numbers of the 64 slaves through the communication bus and the enable line. At this time, the temperature data of all slaves is read by using the RS485 bus. After reading the data, you can choose to remove the automatic station number allocation bus to release the interface of the PLC.

[0053] Therefore, in the method for detecting the station number allocation of the communication bus slave station of this embodiment, a unicast method is used to introduce another bus to configure the station number of the slave station, which has the following advantages:

[0054] 1. Reduce workload: If the station number is configured by broadcasting, when a slave fails, it will be replaced by a slave without a station number, and the station numbers of all slaves need to be reallocated. However, if the station number is configured by unicasting, the station number can be allocated for a single slave separately.

[0055] 2. Know the wrong slave station: When the same station number device appears in the slave station, the corresponding station number information is obtained through the return frame information transmitted through the communication serial port line, so as to determine which slave station has an error;

[0056] 3. Monitor the running status of slave stations: The master station polls all slave stations through the automatic station number allocation bus at regular intervals to monitor the running status of each slave station. It uses unicast to transmit data without affecting the running logic of the original RS485 bus.

[0057] Embodiment 2

[0058] Please refer to Figure 2 A device 1 for detecting the station number allocation of a communication bus slave station includes a master station 2 and a slave station 3, and implements each step of a method for detecting the station number allocation of a communication bus slave station in embodiment 1.

[0059] In summary, the present invention provides a method and device for detecting the station number allocation of a communication bus slave station. The master station sends an enable signal to the first slave station so that the first slave station opens the communication serial port line. The master station sends custom protocol information through the opened communication serial port line, and allocates a station number to the first slave station according to a first configuration table. The first slave station saves and sets the station number and the use address according to the custom protocol information, which simplifies the configuration process, solves the problem of difficulty and error in station number allocation for multiple slave station devices, improves configuration efficiency, and performs data transmission through the communication serial port line, avoiding the use of a large number of hardware dip switches, and solving the problem of dip switches. The switch occupies too many IO interfaces of the slave station, and the communication efficiency is improved; the master station verifies and interacts with the slave station through the communication bus to ensure the correctness of the station number allocation. Only when the interaction is successful, the station number allocation operation of the next slave station is carried out until the station number allocation of each slave station is completed, thereby improving the reliability of the system; all configured slave stations are polled to obtain the station number information, and fill it into the second configuration table. By traversing and checking the second configuration table, the station numbers in the table are detected to be illegal and repeated, and corresponding processing methods are provided to improve the reliability and stability of the device, ensure that each slave station number is unique, so as to facilitate the management and tracking of the status of each slave station.

[0060] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for detecting the station number allocation of a communication bus slave station, characterized in that: Includes steps: S1. The master station sends an enable signal to the first slave station through an enable line in an automatic station number allocation bus, so that the first slave station turns on a communication serial port line. The automatic station number allocation bus includes an enable line and a communication serial port line. S2, the master station sends the custom protocol information to the first slave station through the opened communication serial port line, so that the first slave station saves and sets the station number and the use address according to the custom protocol information; S3. The master station interacts with the first slave station through the communication bus. If the interaction is successful, it is determined that the station number of the first slave station is successfully allocated, the first slave station closes the communication serial port line, the master station closes the enable signal of the first slave station and sends an enable signal to the next slave station, so that the next slave station acts as the first slave station and opens the communication serial port line, and repeats step S2 until each slave station in the communication bus is allocated a station number.

2. A method for detecting the station number allocation of a communication bus slave station according to claim 1, characterized in that: The step S2 is specifically as follows: The master station obtains the slave station number corresponding to the first slave station according to the first configuration table, and sends the custom protocol information to the first slave station through the communication serial port line, wherein the first configuration table includes the slave station position and the slave station number, and the custom protocol information includes identification information, version information, function code information, slave station number information, and verification information; The first slave station saves and sets the station number and the use address according to the custom protocol information, and saves the station number information in a flash memory.

3. A method for detecting the station number allocation of a communication bus slave station according to claim 2, characterized in that: The first slave station saves and sets the station number and the use address according to the custom protocol information, and saves the station number information in the flash memory, and also includes: The first slave station returns a modification success signal to the master station, and when the master station does not receive the modification success signal, it stops sending an enable signal to the next slave station.

4. A method for detecting the station number allocation of a communication bus slave station according to claim 1, characterized in that: The step S3 further includes: All slave stations connected to the communication bus are polled through the automatic station number allocation bus to obtain the station number of each slave station, and the station number is filled in the corresponding position of the second configuration table, the second configuration table is traversed, the station number in the second configuration table is checked, and when an illegal station number exists, the corresponding illegal station number is returned.

5. A method for detecting the allocation of slave station numbers on a communication bus according to claim 4, characterized in that: The checking of the station number of the second configuration table further includes: when there is a repeated station number, returning the slave station position corresponding to the repeated station number, and resetting the station number for the slave station.

6. A device for detecting the allocation of slave station numbers on a communication bus, characterized in that: Including the master station and the slave station, implement the following steps: S1. The master station sends an enable signal to the first slave station through an enable line in an automatic station number allocation bus, so that the first slave station turns on a communication serial port line. The automatic station number allocation bus includes an enable line and a communication serial port line. S2, the master station sends the custom protocol information to the first slave station through the opened communication serial port line, so that the first slave station saves and sets the station number and the use address according to the custom protocol information; S3, the master station interacts with the first slave station through the communication bus. If the interaction is successful, it is determined that the station number of the first slave station is successfully allocated, the first slave station closes the communication serial port line, the master station closes the enable signal of the first slave station and sends an enable signal to the next slave station, so that the next slave station opens the communication serial port line as the first slave station, and repeats step S2 until each slave station in the communication bus is allocated a station number.

7. A communication bus slave station number allocation detection device according to claim 6, characterized in that: The step S2 is specifically as follows: The master station obtains the slave station number corresponding to the first slave station according to the first configuration table, and sends the custom protocol information to the first slave station through the communication serial port line, wherein the first configuration table includes the slave station position and the slave station number, and the custom protocol information includes identification information, version information, function code information, slave station number information, and verification information; The first slave station saves and sets the station number and the use address according to the custom protocol information, and saves the station number information in a flash memory.

8. A communication bus slave station number allocation detection device according to claim 7, characterized in that: The first slave station saves and sets the station number and the use address according to the custom protocol information, and saves the station number information in the flash memory, and also includes: The first slave station returns a modification success signal to the master station, and when the master station does not receive the modification success signal, it stops sending an enable signal to the next slave station.

9. The device for detecting the allocation of slave station numbers on a communication bus according to claim 6, characterized in that: The step S3 further includes: All slave stations connected to the communication bus are polled through the automatic station number allocation bus to obtain the station number of each slave station, and the station number is filled in the corresponding position of the second configuration table, the second configuration table is traversed, the station number in the second configuration table is checked, and when an illegal station number exists, the corresponding illegal station number is returned.

10. The device for detecting the allocation of slave station numbers on a communication bus according to claim 9, characterized in that: The checking of the station number in the second configuration table further includes: when there is a duplicate station number, returning the slave station position corresponding to the duplicate station number, and resetting the station number for the slave station.