A device and method for isolating faults of RS485 bus terminal nodes

By using an intermediate machine and a daisy-chain connection, the problem of communication paralysis of the entire bus caused by damage to RS485 bus terminal equipment in harsh environments is solved, achieving fault isolation and rapid location, and ensuring the normal operation of other devices on the bus.

CN122247837APending Publication Date: 2026-06-19YUNLONG LAKE LAB OF DEEP UNDERGROUND SCI & ENG

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
YUNLONG LAKE LAB OF DEEP UNDERGROUND SCI & ENG
Filing Date
2026-05-14
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In harsh environments, RS485 bus terminal devices have a high failure rate, leading to the paralysis of the entire bus communication and affecting the normal operation of all terminal devices.

Method used

It adopts an intermediate machine device and a daisy chain connection method, with the intermediate machine connected to the terminal node. It has a power supply step-down module, a current monitoring module, a host communication module, an MCU processing system, a gating logic module, a data channel selection module, and a digital tube display module to achieve fault isolation and rapid location.

Benefits of technology

The failure of a single terminal does not affect other devices on the bus, allowing for quick location of the faulty terminal, reducing maintenance workload, and preventing the entire bus from becoming paralyzed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122247837A_ABST
    Figure CN122247837A_ABST
Patent Text Reader

Abstract

This invention relates to the field of communication technology, specifically to a device and method for fault isolation of RS485 bus terminal nodes. The method collects bus pair current measurements and terminal node communication status quantities within a preset detection period to generate line status quantities, and generates a terminal node fault identifier based on the line status quantities and preset fault discrimination rules. When the terminal node fault identifier indicates a fault state, the control isolating switch unit disconnects the electrical connection between the terminal node branch and the RS485 bus, and the control bypass terminal unit connects to the terminal matching resistor network to obtain a bypass bus. Differential transmission and reception are performed on the remaining nodes under the bypass bus, and the bypass operation status quantities are recorded. The device includes an RS485 bus interface, terminal node branches, an isolating switch unit, a bypass terminal unit, a fault discrimination unit, and a controller. This solution reduces the impact of terminal node damage on bus differential level dragging and terminal matching failure, improving bus communication stability and continuous operation capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of communication technology, specifically an RS485 bus terminal node fault isolation device and method. Background Technology

[0002] Currently, RS485 communication buses are widely used in various fields. Up to 128 device nodes can be connected on the same bus. The communication signal is a differential circuit, which makes the signal transmission relatively stable and less susceptible to interference. However, in some harsh environments, such as deep mining, thermal power plants, salt wells, steel mills, offshore ship equipment, milking parlors, and other environments with humidity, salt spray, and strong acids, the failure rate of terminal equipment is much higher than that under normal use conditions. Once an RS485 terminal is damaged, especially if the RS485 communication chip is damaged, it will basically affect the entire bus, making the entire bus unstable and causing all terminal devices on the bus to be unable to communicate. Summary of the Invention

[0003] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.

[0004] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a method for fault isolation of RS485 bus terminal nodes, comprising the following steps: After the intermediate machine is powered on, the number setting switch status is read to determine the intermediate machine number and the corresponding terminal node number range in the RS485 bus system. Depending on the test switch status, select to execute either the local test process or the host communication process; In the host communication process, the main line signal on the host communication interface is monitored, and the data sent by the host is parsed after the main line signal is detected; when the parsing result corresponds to the intermediate machine number, the target terminal node is determined, and the target terminal node is channel selected. After completing the channel selection, the host query command is transmitted to the target terminal node, and the node response data returned by the target terminal node is received; When the node replies with abnormal data or the power supply status of the target terminal node is abnormal, a corresponding fault command is generated and uploaded to the host. After the node replies with data upload or the fault command is uploaded, the intermediate machine returns to the host communication interface listening state.

[0005] As a preferred technical solution for RS485 bus terminal node fault isolation, the step of selecting to execute a local test procedure or a host communication procedure based on the test switch status includes: When the test switch is on, each terminal node is polled and selected sequentially according to the terminal node number range, and a test query command is sent to each terminal node. The test communication result is generated based on the node reply data corresponding to each terminal node. When the test switch is in the off state, the intermediate machine enters the host communication process.

[0006] As a preferred technical solution for a method of fault isolation of RS485 bus terminal nodes, the step of parsing the data sent by the host includes: Identify the data frame headers in the data sent by the host; When the data frame header meets the host-sent format, the intermediate machine number in the host-sent data is extracted and compared with the intermediate machine number; when the comparison result is consistent, the terminal node number in the host-sent data is extracted as the target terminal node number.

[0007] As a preferred technical solution for a method of fault isolation of RS485 bus terminal nodes, the step of channel selection for the target terminal node and transmitting the host query command to the target terminal node includes: A channel selection signal is generated based on the target terminal node number; The channel selection logic module and the data channel selection module control the channel selection signal to activate the communication channel corresponding to the target terminal node. After the communication channel is established, the host query command is transmitted to the target terminal node.

[0008] As a preferred technical solution for a method of RS485 bus terminal node fault isolation, the step of receiving node response data returned by the target terminal node and uploading the node response data to the host includes: After the host query command is transmitted, the node response data returned by the target terminal node is received within the first waiting period. The received node response data is combined with the intermediate machine number and the target terminal node number to generate a response data packet; The reply data packet is uploaded to the host via the host communication interface.

[0009] As a preferred technical solution for a method of fault isolation of RS485 bus terminal nodes, the node's response to abnormal data includes: If no response data is received from the node within the first waiting period, the host query command is sent to the target terminal node again. If no response data is received from the node after the host query command is issued again within the first waiting period, a communication anomaly judgment result is generated, and a communication failure command is generated and uploaded to the host.

[0010] As a preferred technical solution for a method of fault isolation of an RS485 bus terminal node, the abnormal power supply status of the target terminal node includes: After the target terminal node is selected, the power supply current measurement value corresponding to the target terminal node is collected; The measured power supply current value is compared with the current threshold; when the measured power supply current value is greater than the current threshold, a power supply anomaly judgment result is generated, and a power supply fault command is generated and uploaded to the host.

[0011] In a preferred embodiment of a method for isolating faults in RS485 bus terminal nodes, the terminal node numbering range is a set of numbers corresponding to the 16 terminal nodes connected to the intermediate machine. The fault commands include communication fault commands and power supply fault commands; The communication failure instruction corresponds to the judgment result that the target terminal node has not returned the node reply data after two host query instructions have been issued; The power supply fault command corresponds to the judgment result that the measured power supply current value is greater than the current threshold.

[0012] This invention discloses an apparatus for fault isolation of RS485 bus terminal nodes based on the aforementioned method, comprising: The system includes a host computer and an external power supply, intermediate units, and RS485 terminals. The host computer and external power supply are connected to multiple intermediate units via differential lines and power lines, and the intermediate units are connected to multiple RS485 terminals.

[0013] As a preferred technical solution for an RS485 bus terminal node fault isolation device, the intermediate machine includes a power supply step-down module, a current monitoring module, a host communication module, an MCU processing system, a gating logic module, a data channel selection module, a digital tube display module, and a 16-channel communication module. The power supply step-down module is connected to the MCU processing system through the current monitoring module. The host communication module, gating logic module, data channel selection module, and digital tube display module are connected to the MCU processing system. The 16-channel communication module is connected to the power supply step-down module, gating logic module, and data channel selection module.

[0014] The beneficial effects of this invention are: Using the method and apparatus of this invention, the failure of a single RS485 terminal will not affect the normal operation of other devices on the same bus, avoiding the problem of the entire bus being paralyzed. It also helps maintenance personnel quickly locate which RS485 terminal is faulty, reducing their workload. Attached Figure Description

[0015] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 This is a schematic diagram of the method logic block diagram in this invention; Figure 2 This is a schematic diagram of a traditional RS485 bus connection. Figure 3 This is a schematic diagram of the working principle of the device in this invention; Figure 4 This is a schematic diagram of the intermediate machine hardware circuit structure in this invention; Figure 5 This is a schematic diagram of the intermediate machine power supply circuit structure in this invention; Figure 6 This is a schematic diagram of the current monitoring circuit structure in this invention; Figure 7 This is a schematic diagram of the RS485 level conversion chip circuit structure in this invention; Figure 8 This is a schematic diagram of the MCU module circuit structure in this invention; Figure 9 This is a schematic diagram of the circuit structure of the gating module and the data channel selection module in this invention; Figure 10 This is a schematic diagram of the circuit structure of the 16-channel communication module in this invention; Figure 11 This is a schematic diagram of the installation of 32 nodes in this invention; Figure 12 This is a schematic diagram of the DIP switch settings for the SW4 intermediate unit in this invention. Detailed Implementation

[0016] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0017] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0018] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0019] Secondly, the present invention is described in detail with reference to the schematic diagrams. When detailing the embodiments of the present invention, for ease of explanation, the cross-sectional views illustrating the device structure may be partially enlarged, not according to the usual scale. Furthermore, the schematic diagrams are merely examples and should not limit the scope of protection of the present invention. In addition, actual fabrication should include three-dimensional spatial dimensions of length, width, and depth.

[0020] Example 1

[0021] Reference Figures 1-12 This embodiment provides a device and method for solving the problem of communication paralysis of the entire RS485 bus due to the failure of one node in the field. In addition to this function, the present invention also has node fault identification and information reporting functions, which facilitates maintenance personnel to quickly locate the damaged node for repair or replacement.

[0022] Traditional RS485 bus connection method, such as Figure 2 As shown, the master and slave terminal nodes are all connected to a single bus, with a maximum of 128 nodes. This connection method is convenient, but if the RS485 level conversion chip of one node fails, the communication of the entire bus will be paralyzed, affecting the normal operation of other nodes.

[0023] The system of the present invention is as follows Figure 3As shown. Compared with the traditional RS485 bus, the device of this invention adds an intermediate unit, and the connection method is also changed. The original daisy-chain (hand-in-hand) connection method is changed to a system where the host connects to the intermediate unit, and each terminal node connects to the intermediate unit. Multiple intermediate units on the same bus are connected to the host in the traditional daisy-chain (hand-in-hand) manner. This connection method is used primarily because the terminal units need to be installed on the device under test in harsh environments such as vibration, humidity, salt spray, strong acid, and dust, making them highly susceptible to damage. The intermediate unit, however, only performs data relay and switching / selection, and can be installed in a more favorable environment or in a monitoring room, effectively avoiding damage caused by environmental problems that could affect bus communication.

[0024] Each intermediate unit can connect to 16 terminal nodes. Each node has its own independent number and is isolated from the others by analog switches and gating switches of the intermediate unit, so they will not affect each other. The intermediate unit also isolates the terminal from the host, so even if the terminal is damaged, it will not affect the host's system bus.

[0025] After receiving the signal from the host, the intermediate machine selects the corresponding RS485 terminal for data communication and transparent transmission based on the parsed communication data.

[0026] The hardware circuit composition of the intermediate machine is as follows: Figure 4 As shown, the hardware circuit consists of a step-down module, a current monitoring module, a host communication module, an MCU processing system, a gating logic module, a data channel selection module, a digital fast display module, and a 16-channel communication module.

[0027] step-down modules such as Figure 5 As shown, the input is 24V AC power. After passing through the rectifier bridge and filter circuit, the output is DC voltage. After being stepped down by the DC-DC converter chip, the output is DC 5V voltage. Part of the DC 5V voltage is supplied to each RS485 communication module through the common mode inductor, and part of the DC 5V voltage is supplied to the 1117 chip, which converts it into DC 3.3V voltage to supply the MCU.

[0028] Current monitoring circuit Figure 6 As shown, the current monitoring uses a TP181A1 chip to monitor the voltage difference across the R208 power resistor and transmit it to the MCU in real time for monitoring power consumption.

[0029] Host communication module circuit, such as Figure 7 As shown, the RS485 level conversion chip used in the communication module is an isolated RS485 chip manufactured by Analog Devices, model ADM2483.

[0030] MCU module such as Figure 8 As shown, the MUC module consists of an STM32F108C8T6 microcontroller and peripheral circuits, and adds several DIP switches. The SW4 DIP switch is used to set the intermediate unit number. SW1 and SW2 are used for communication function testing and maintenance testing after installation. SW3 is a jog button used for enabling and resetting the microcontroller.

[0031] The selection module and data channel selection module circuits are as follows: Figure 9 As shown, the gating module uses two SN74HC138-Q1 3-to-8 decoders for channel selection, while the data channel selection module uses two ADG1607 3-to-8 analog switches. Using chips similar to these 3-to-8 decoders can reduce the pin occupancy of the MCU chip and maximize resource utilization.

[0032] Communication module circuit diagram as follows Figure 10 As shown, the 16-channel communication modules are identical, using pull-up and pull-down circuits on the differential lines for external communication, and adding TVS diodes at the AB line terminals to prevent static electricity and surges from interfering with the lines.

[0033] MCU program logic block diagram as follows Figure 1 As shown. The MCU program's operating logic is as follows: After power-on, the program initializes each functional module, then reads the status of the DIP switch set for this intermediate unit's number to determine its number in the RS485 bus system and the number range of its subordinate terminal devices. After determining its own number, it continues to read whether the test switch is on. If the test switch is on, it performs a local test, polling the 16 subordinate nodes to check if they can communicate normally. This function is generally used for testing after installation and for periodic maintenance. If the test switch is not on, it enters the host communication interface listening state. When a signal is detected on the main line, the signal is parsed. The data frame header is checked to see if it contains the intermediate machine's serial number instruction. If it does, the next byte of data is parsed to determine which node the host is querying. Communication is then selected for that node, and data is passed through, transmitting the host's query instruction to the subordinate terminal node. The intermediate machine waits for a data response from the subordinate node and transmits the received response data to the host through the host's communication port. If no data is returned from the subordinate node after selection, a second data transmission is performed. If no response is received, a node communication fault instruction is reported to the host. During communication with subordinate nodes, the power supply current of each node must be constantly monitored. If the current exceeds a threshold, a fault instruction is sent directly to the host, indicating a power supply abnormality at that node. After data transmission is complete, the intermediate machine continues to receive data through the host port.

[0034] This invention solves the problem of damage to a single RS485 terminal affecting the entire bus in field applications. Using the method and apparatus of this invention, the failure of a single RS485 terminal will not affect the normal operation of other devices on the same bus, avoiding the problem of the entire bus being paralyzed. It also helps maintenance personnel quickly locate which RS485 terminal is damaged, reducing their workload.

[0035] As an extension, multiple backup terminal nodes can be added to critical equipment. When the primary node is detected to be damaged, the backup node is automatically activated, reducing various losses caused by downtime for maintenance due to terminal node failure.

[0036] Example 2

[0037] A method for fault isolation of an RS485 bus terminal node includes the following steps: After the intermediate machine is powered on, the number setting switch status is read to determine the intermediate machine number and the corresponding terminal node number range in the RS485 bus system. Depending on the test switch status, select to execute either the local test process or the host communication process; In the host communication process, the main line signal on the host communication interface is monitored, and the data sent by the host is parsed after the main line signal is detected; when the parsing result corresponds to the intermediate machine number, the target terminal node is determined, and channel selection is performed on the target terminal node; After completing the channel selection, the host query command is transmitted to the target terminal node, and the node reply data returned by the target terminal node is received; When a node responds with abnormal data or the power supply status of the target terminal node is abnormal, a corresponding fault command is generated and uploaded to the host. After the node replies with data upload or fault command upload, the intermediate machine returns to the host communication interface listening state.

[0038] Based on the test switch status, select to execute either the local test procedure or the host communication procedure, including: When the test switch is on, each terminal node is polled and selected sequentially according to the terminal node number range, and a test query command is sent to each terminal node. The test communication result is generated based on the node reply data corresponding to each terminal node. When the test switch is in the off state, the intermediate machine enters the host communication process.

[0039] Parsing the data sent by the host includes: Identify the data frame headers in the data sent by the host; When the data frame header meets the host-sent format, the intermediate machine number in the host-sent data is extracted and compared with the intermediate machine number. If the comparison results are consistent, the terminal node number in the host-sent data is extracted and used as the target terminal node number.

[0040] Channel selection is performed on the target terminal node, and host query commands are transmitted to the target terminal node, including: Generate a channel selection signal based on the target terminal node number; The gating logic module and the data channel selection module control the gating signal to activate the communication channel corresponding to the target terminal node. After the communication channel is established, the host query command is transmitted to the target terminal node.

[0041] Receive node response data returned by the target terminal node and upload the node response data to the host, including: After the host query command is transmitted, the node reply data returned by the target terminal node is received within the first waiting time. The received node response data is combined with the intermediate machine number and the target terminal node number to generate a response data packet; The reply data packet is uploaded to the host via the host communication interface.

[0042] The first waiting time is redundantly set based on the overall communication time, taking into account factors such as data transmission baud rate and byte length.

[0043] In this embodiment, the first waiting time in the experimental example is set to 2 seconds. This is based on the fact that the data transmission baud rate used in the example is 9600, which is equivalent to 1.04 milliseconds per byte. With 24 bytes, the total duration of each data segment is 24.96 milliseconds. If the terminal is a temperature sensor, after receiving the data sent by the intermediate machine, it first parses the data, then organizes 16 hours of temperature data, encodes it, and sends it to the intermediate machine. The data processing time + data encoding time + data transmission time takes approximately 80 milliseconds. Therefore, the entire communication time is approximately 110 milliseconds. If the communication rate decreases or the number of data bits transmitted increases, the communication time will increase. To accommodate various terminal products, the waiting time is set to 2 seconds.

[0044] The node responded with abnormal data, including: If no response data is received from the node within the first waiting period, a host query command is sent to the target terminal node again; If no response data is received from the node after the host query command is issued again, a communication anomaly judgment result is generated and a communication failure command is generated and uploaded to the host.

[0045] The target terminal node has an abnormal power supply status, including: After the target terminal node is selected, the power supply current measurement value corresponding to the target terminal node is collected; The measured power supply current is compared with the current threshold. When the measured power supply current is greater than the current threshold, a power supply anomaly judgment result is generated, and a power supply fault command is generated and uploaded to the host.

[0046] The range of terminal node numbers is the set of numbers corresponding to the 16 terminal nodes connected to the intermediate machine; Fault commands include communication fault commands and power supply fault commands; The communication failure command corresponds to the judgment result that the target terminal node has not returned node reply data after two host query commands have been issued; The power supply fault command corresponds to the judgment result that the measured value of the power supply current is greater than the current threshold.

[0047] Furthermore, the current threshold setting is related to the terminal device. The current threshold is set in the embedded code of the MCU. The specific value of the current threshold depends on the power consumption of the terminal communication chip. Generally speaking, the power consumption of the RS485 level conversion chip is between 0.3-5mA. The total power consumption of the entire intermediate machine's MCU and its peripheral circuits is about 60mA (excluding the digital tube, which has a large power consumption and is powered separately, so it is not within the current detection range). The output short-circuit current of the RS485 level conversion chip is about 250mA. Taking all factors into consideration, a current threshold setting of 100mA is sufficient. Different usage scenarios or different application circuit components have different power consumption, and users need to set it according to the actual value.

[0048] It should be noted that the gating module has two gating modes: one is the enable gating of the RS485 level conversion chip, and the other is the data gating. Both must be enabled simultaneously for normal communication. If either one fails to perform the gating function, normal communication will not be possible. First, the enable gating of the RS485 level conversion chip uses a 3 / 8 decoder to pull high the enable pin of the selected chip, putting the chip in a communicable state. Second, the data gating uses a multiplexed analog switch, which in this example is a double-pole double-throw switch. Only when the pin of the selected channel is selected can the switch close, allowing data to pass through. If the channel is not selected, there is no connection and no communication, thus physically isolating the intermediate unit from the selected channel and preventing it from affecting the bus. Therefore, physical on / off can be achieved by controlling whether the selection is enabled; the specific method can be found in the circuit diagram shown in the attached diagram of the manual.

[0049] The following are actual use cases: In practical use, a communication protocol needs to be defined first. The communication protocol used in this case is shown in Table 1 below. Each byte in the communication protocol is represented in hexadecimal. The first bit is the frame header, indicating that the host is sending data; the second bit is the intermediate machine model; the third bit is the terminal machine number; the fourth to twenty-seventh bits are data bits; and the twenty-eighth and twenty-ninth bits are CRC check bits.

[0050]

[0051] Table 1. Communication Protocol between Host and Intermediate Machine Suppose a deep-ground mining transfer station requires the installation of 32 terminal monitoring instruments to monitor environmental parameters such as temperature, humidity, and motor vibration. The communication bus used is RS485. After the construction personnel install and secure the terminal instruments according to their locations, they connect the cables as follows... Figure 11 Connect to the intermediate unit and connect the cables between the host and the intermediate unit.

[0052] After the cable connection is completed, switch 1 of the SW4 DIP switch on intermediate unit 1 to 1, and set the other switches to 0; switch 2 of the SW4 DIP switch on intermediate unit 2 to 1, and set the other switches to 0.

[0053] Specifically, such as Figure 12 As shown, after the cable connection is completed, switch 1 of the SW4 DIP switch of intermediate unit 1 to 1, and set the other switches to 0. Then power off and restart. In this case, intermediate unit 1 will only be responsible for the signal transmission of terminals 1-16. Similarly, switch 2 of the SW4 DIP switch of intermediate unit 2 to 1, and set the other switches to 0. Then power off and restart. In this case, intermediate unit 2 will only be responsible for the signal transmission of terminals 17-32.

[0054] For example, the fourth node of intermediate machine 2 is a temperature and humidity node. The host needs to query the current temperature and humidity. The host needs to send the data shown in Table 2 to intermediate machine 2. The communication protocol of the temperature and humidity terminal instrument can be the communication protocol of the instrument manufacturer. If the communication protocol of the temperature and humidity terminal instrument is less than 24 bits, it is padded with 0000.

[0055] Table 2 Example Communication Protocol Intermediate machine 1 and intermediate machine 2 will receive this communication command simultaneously. After parsing the second byte of this protocol, intermediate machine 1 will stop parsing the command. Intermediate machine 2, after parsing the second byte, will continue parsing and receive all data for CRC verification. After verification, it will open the fourth channel and send the entire "Temperature and Humidity Terminal Instrument Protocol" to the temperature and humidity terminal instrument on the fourth channel. After sending, it will wait for reception and monitor the current in real time. After receiving the return data from the fourth channel, it will encode the data into a data packet and then upload it to the host. The data packet uploaded to the host and the host are shown in Table 3.

[0056]

[0057] Table 3 Data packets sent from intermediate machine 2 to the host The first byte, 50, represents the uploaded data; the second byte represents intermediate machine 2; the third byte represents the fourth channel; the middle bytes, from the fourth to the twenty-seventh, are the uploaded data packets of the temperature and humidity terminal instrument; and the last two bytes are the CRC check performed by the intermediate machine.

[0058] Damage status; If the current is abnormal after the fourth channel of intermediate machine 2 is opened, intermediate machine 2 will send the data shown in Table 4 to the host. The functions of the first three bytes are as shown above. The fourth byte FF represents a fault, the fifth byte 10 represents a power supply abnormality, and the sixth and seventh bits are CRC check bits.

[0059]

[0060] Table 4 Current Fault Data Packet If the current is normal and there is no response after two seconds, the intermediate unit sends the command again. If there is no response after two attempts, the intermediate unit determines that there is a communication failure and sends the command shown in Table 5 to the host. The functions of the first three bytes are as shown above, the fourth byte FF represents a fault, the fifth byte 20 represents a communication error, and the sixth and seventh bytes are CRC check bits.

[0061]

[0062] Table 5 Abnormal Communication Data Packets In summary, the examples above demonstrate that even if a terminal node fails, it will not affect other nodes or the overall bus communication. Furthermore, data reported by the intermediate machine can be used to remotely shut down the communication of the damaged node, and it can also help maintenance personnel quickly locate the faulty terminal, significantly reducing replacement and repair work.

[0063] Reference Figure 1 The specific process is described as follows: I. Power-on startup and self-test phase: Self-determines its own serial number and working status.

[0064] Power-on initialization: After the system is powered on, it first performs a "self-check" and "basic settings" to prepare for communication.

[0065] Identification: Read the hardware switch to determine its unique number (e.g., host number 01).

[0066] Status display: Displays its own number on the digital tube for easy viewing by personnel.

[0067] Mode selection: Check the "Test Switch": If test mode is enabled: the system will actively poll and check whether the 16 terminal modules under its jurisdiction are online and working properly.

[0068] If in normal working mode: proceed to the next step and wait for instructions from the superior.

[0069] II. Core Workflow (Forwarding and Coordination) The system spends most of its time in a cycle of "listening-forwarding-replying".

[0070] Step 1: Receive Instructions The system continuously listens for instruction data packets from the host computer (such as a computer or main controller).

[0071] Step 2: Verify the address Upon receiving the instruction, the first step is to check whether the "target address" in the data packet matches its own number.

[0072] If there is no match: it means that this instruction is sent to another intermediate machine, so ignore it and continue to wait.

[0073] If a match is found: This means the instruction was indeed sent to yourself; proceed to the next step.

[0074] Step 3: Execute forwarding Parse the "terminal address" in the instruction and activate the corresponding terminal device (e.g., open a dedicated channel to terminal 03).

[0075] Display the number of the terminal currently being processed on the digital tube (e.g., display "03").

[0076] The instructions from the host are forwarded to the specified terminal as is.

[0077] While opening the channel, check whether the power supply current of the channel interrupter exceeds the threshold.

[0078] Step 4: Wait for a response and processing After forwarding, a 2-second countdown begins, waiting for a response from the terminal.

[0079] Scenario A (Successfully received reply, and current does not exceed threshold): The system will verify the integrity of the response data (CRC check, similar to checking if a package is intact).

[0080] After successful verification, the terminal's response data (or processing results) is organized, packaged, and sent back to the host computer to complete a full communication cycle.

[0081] Scenario B (No response received after timeout, but current does not exceed threshold): Second transmission: Wait 2 seconds again. If there is still no reply, the terminal is considered to have a communication failure.

[0082] The system will proactively send a "No data for terminal 03" message to the host, informing the host that the terminal is out of contact and preventing the host from waiting indefinitely.

[0083] Case C (Successfully received a reply, but the current exceeds the threshold): The system will verify the integrity of the response data (CRC check, similar to checking if a package is intact).

[0084] After successful verification, the terminal's response data (or processing results) is organized, packaged, and sent back to the host computer to complete a full communication cycle.

[0085] The intermediate unit sends a fault command for the current exceeding the threshold of channel 03 to the host unit.

[0086] Case D (No response received after timeout, and current exceeds threshold): The intermediate unit sends channel 03 fault and current over-threshold fault commands to the host.

[0087] It should be understood that numerous specific implementation decisions can be made during the development of any practical implementation, such as in any engineering or design project. Such development efforts may be complex and time-consuming, but for those of ordinary skill in the art who benefit from this disclosure, the development effort will be a routine task in design, manufacturing, and production without requiring extensive experimentation.

[0088] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for fault isolation of RS485 bus terminal nodes, characterized in that, Includes the following steps: After the intermediate machine is powered on, the number setting switch status is read to determine the intermediate machine number and the corresponding terminal node number range in the RS485 bus system. Depending on the test switch status, select to execute either the local test process or the host communication process; In the host communication process, the main line signal on the host communication interface is monitored, and the data sent by the host is parsed after the main line signal is detected; when the parsing result corresponds to the intermediate machine number, the target terminal node is determined, and the target terminal node is channel selected. After completing the channel selection, the host query command is transmitted to the target terminal node, and the node response data returned by the target terminal node is received; When the node replies with abnormal data or the power supply status of the target terminal node is abnormal, a corresponding fault command is generated and uploaded to the host. After the node replies with data upload or the fault command is uploaded, the intermediate machine returns to the host communication interface listening state.

2. The method according to claim 1, characterized in that, The step of selecting to execute a local test process or a host communication process based on the test switch status includes: When the test switch is on, each terminal node is polled and selected sequentially according to the terminal node number range, and a test query command is sent to each terminal node. The test communication result is generated based on the node reply data corresponding to each terminal node. When the test switch is in the off state, the intermediate machine enters the host communication process.

3. The method according to claim 2, characterized in that, The parsing of data sent by the host includes: Identify the data frame headers in the data sent by the host; When the data frame header meets the host-sent format, the intermediate machine number in the host-sent data is extracted and compared with the intermediate machine number; when the comparison result is consistent, the terminal node number in the host-sent data is extracted as the target terminal node number.

4. The method according to claim 3, characterized in that, The step of channel selection for the target terminal node and transmitting the host query command to the target terminal node includes: A channel selection signal is generated based on the target terminal node number; The channel selection logic module and the data channel selection module control the channel selection signal to activate the communication channel corresponding to the target terminal node. After the communication channel is established, the host query command is transmitted to the target terminal node.

5. The method according to claim 4, characterized in that, The step of receiving node response data returned by the target terminal node and uploading the node response data to the host includes: After the host query command is transmitted, the node response data returned by the target terminal node is received within the first waiting period. The received node response data is combined with the intermediate machine number and the target terminal node number to generate a response data packet; The reply data packet is uploaded to the host via the host communication interface.

6. The method according to claim 5, characterized in that, The node's response data is abnormal, including: If no response data is received from the node within the first waiting period, the host query command is sent to the target terminal node again. If no response data is received from the node after the host query command is issued again within the first waiting period, a communication anomaly judgment result is generated, and a communication failure command is generated and uploaded to the host.

7. The method according to claim 6, characterized in that, The power supply status of the target terminal node is abnormal, including: After the target terminal node is selected, the power supply current measurement value corresponding to the target terminal node is collected; The measured supply current value is compared with a current threshold. When the measured value of the power supply current is greater than the current threshold, a power supply anomaly judgment result is generated, and a power supply fault command is generated and uploaded to the host.

8. The method according to claim 7, characterized in that, The range of terminal node numbers is the set of numbers corresponding to the 16 terminal nodes connected to the intermediate machine; The fault commands include communication fault commands and power supply fault commands; The communication failure instruction corresponds to the judgment result that the target terminal node has not returned the node reply data after two host query instructions have been issued; The power supply fault command corresponds to the judgment result that the measured power supply current value is greater than the current threshold.

9. An apparatus for fault isolation of RS485 bus terminal nodes based on any one of claims 1 to 8, characterized in that, include: The system includes a host computer and an external power supply, intermediate units, and RS485 terminals. The host computer and external power supply are connected to multiple intermediate units via differential lines and power lines, and the intermediate units are connected to multiple RS485 terminals.

10. The apparatus according to claim 9, characterized in that, The intermediate machine includes a power supply step-down module, a current monitoring module, a host communication module, an MCU processing system, a gating logic module, a data channel selection module, a digital tube display module, and a 16-channel communication module. The power supply step-down module is connected to the MCU processing system through the current monitoring module. The host communication module, gating logic module, data channel selection module, and digital tube display module are connected to the MCU processing system. The 16-channel communication module is connected to the power supply step-down module, gating logic module, and data channel selection module.