CN112737912A - 485 bus system and fault diagnosis method thereof - Google Patents

485 bus system and fault diagnosis method thereof Download PDF

Info

Publication number
CN112737912A
CN112737912A CN202110008494.8A CN202110008494A CN112737912A CN 112737912 A CN112737912 A CN 112737912A CN 202110008494 A CN202110008494 A CN 202110008494A CN 112737912 A CN112737912 A CN 112737912A
Authority
CN
China
Prior art keywords
communication port
slave
bus
tested
fault
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110008494.8A
Other languages
Chinese (zh)
Inventor
韩旭
李闯
封迪
卢百吉
王亚倩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ENRIC(LANGFANG)ENERGY EQUIPMENT INTEGRATION CO LTD
Original Assignee
ENRIC(LANGFANG)ENERGY EQUIPMENT INTEGRATION CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ENRIC(LANGFANG)ENERGY EQUIPMENT INTEGRATION CO LTD filed Critical ENRIC(LANGFANG)ENERGY EQUIPMENT INTEGRATION CO LTD
Priority to CN202110008494.8A priority Critical patent/CN112737912A/en
Publication of CN112737912A publication Critical patent/CN112737912A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40169Flexible bus arrangements
    • H04L12/40176Flexible bus arrangements involving redundancy
    • H04L12/40189Flexible bus arrangements involving redundancy by using a plurality of bus systems

Abstract

The application discloses a 485 bus system and a fault diagnosis method thereof. The 485 bus system fault diagnosis method comprises the following steps: sending first detection data to a bus through a first communication port; if the second communication port does not receive data within the first preset time, judging that the bus connection fails; if the second communication port receives the second detection data within the first preset time, comparing whether the second detection data is consistent with the first detection data; if the second detection data is consistent with the first detection data, judging that the bus connection has no fault; and if the second detection data is inconsistent with the first detection data, judging that the bus connection is failed. According to the 485 bus system and the fault diagnosis method thereof, whether the bus connection of the 485 bus system is in fault or not is judged by sending the first detection data to the bus through the first communication port, so that the fault diagnosis of the 485 bus system is realized through a simple line connection structure and a convenient and quick method.

Description

485 bus system and fault diagnosis method thereof
Technical Field
The application relates to the field of bus communication, in particular to a 485 bus system and a fault diagnosis method thereof.
Background
The RS485 bus has wide application in the field of industrial automation control. When communication fails due to communication cable faults, bus short circuits, RS485 equipment abnormity and the like, the industrial automation control is greatly influenced. Therefore, how to diagnose the fault of the RS485 bus system conveniently and quickly becomes one of the research directions.
Disclosure of Invention
An object of the application is to provide a 485 bus system and a fault diagnosis method thereof, so as to solve the technical problems existing in the prior art: how to diagnose the fault of the 485 bus system conveniently and quickly.
In order to solve the technical problem, the following technical scheme is adopted in the application:
the embodiment of the application provides a 485 bus system. The 485 bus system comprises: the host comprises a first communication port and a second communication port, and a bus is connected in series between the first communication port and the second communication port; one or more slaves, each slave being connected to the bus and communicating with the master through the bus.
In some embodiments, the master further includes a switching module for switching a communication port used by the master for communicating with the slave. When a bus section between the first communication port and the first slave machine is in a fault state or in a maintenance state, the master machine can be switched to use the second communication port to communicate with the first slave machine through the switching module. When a bus section between the second communication port and a second slave machine is in a fault state or in a maintenance state, the master machine can be switched to use the first communication port to communicate with the second slave machine through the switching module.
In some embodiments, the master further includes a connection request module, and the connection request module is configured to send a request instruction for attempting a connection to the slave through the first communication port or the second communication port at preset intervals.
The embodiment of the application also provides a 485 bus system fault diagnosis method which is used for the 485 bus system in any embodiment. The 485 bus system fault diagnosis method comprises the following steps: sending first detection data to the bus through the first communication port; if the second communication port does not receive data within a first preset time, judging that the bus connection fails; if second detection data are received in the second communication port within first preset time, comparing whether the second detection data are consistent with the first detection data or not; if the second detection data is consistent with the first detection data, judging that the bus connection is faultless; and if the second detection data is inconsistent with the first detection data, judging that the bus connection is failed.
In some embodiments, when it is determined that the bus connection is not faulty, the method further comprises: sending a first request signal to a slave to be tested through the first communication port; if the first communication port does not receive a first response signal returned by the slave machine to be tested within a second preset time, a second request signal is sent to the slave machine to be tested through the second communication port; and if the second communication port does not receive a second response signal returned by the slave machine to be tested within a third preset time, judging that the slave machine to be tested has a fault.
In certain embodiments, the method further comprises: sending a first request signal to a slave to be tested through the first communication port; if the first communication port receives a response signal returned by the slave machine to be tested within a second preset time, judging that the bus between the first communication port and the slave machine to be tested has no fault; if the first communication port does not receive a first response signal returned by the slave machine to be tested within a second preset time, a second request signal is sent to the slave machine to be tested through the second communication port; if the second communication port receives a second response signal returned by the slave machine to be tested within a third preset time, it is determined that the bus connection between the first communication port and the slave machine to be tested is faulty and the bus connection between the second communication port and the slave machine to be tested is faultless.
In some embodiments, when it is determined that the bus connection between the first communication port and the slave under test is faulty, the method further includes: and acquiring a bus connection detection result of a front slave of the slave to be detected, and determining a fault section from the first communication port to the slave to be detected according to the bus connection detection result, wherein the front slave is another slave positioned between the first communication port and the slave to be detected.
In some embodiments, the determining a fault section between the first communication port and the slave device under test according to the bus connection detection result includes: and if the bus connection detection result indicates that the bus between the first communication port and the front slave machine has no fault, judging that the bus section between the front slave machine and the slave machine to be tested has a fault.
In certain embodiments, the method further comprises: sending a first request signal to one slave machine to be tested through the first communication port every fourth preset time to confirm that the slave machine to be tested can normally respond; and/or sequentially sending first request signals to all the slave machines to be tested through the first communication port every fifth preset time so as to confirm that all the slave machines to be tested can normally respond.
In certain embodiments, the method further comprises: if the slave to be tested can not normally respond, the host sends a second request signal to the slave to be tested through a second communication port; if the second communication port of the host receives a second response signal returned by the slave to be tested within a third preset time, the bus connection fault between the first communication port and the slave to be tested is judged, and the bus connection between the second communication port and the slave to be tested has no fault; if the second communication port of the host does not receive a second response signal returned by the slave to be tested within a third preset time, first detection data are sent to the bus through the first communication port of the host; if the second communication port receives the second detection data within the first preset time, comparing whether the second detection data is consistent with the first detection data; and if the second detection data is consistent with the first detection data, judging that the bus connection has no fault, and judging that the slave to be tested has the fault.
In certain embodiments, the method further comprises: the multimeter is controlled to detect a disconnection and/or short circuit condition of the cable at the fault of the bus.
In some embodiments, the bus includes first and second differential signal lines that are used together to transmit differential signals and/or differential data; the control multimeter detecting a disconnection and/or short circuit condition of a cable at a fault of the bus comprises: and controlling a multimeter to detect a short circuit condition between the first differential signal line and the second differential signal line, a broken circuit condition of the first differential signal line and a broken circuit condition of the second differential signal line at the fault of the bus.
According to the technical scheme, the method has at least the following advantages and positive effects:
according to the 485 bus system and the fault diagnosis method thereof, the first communication port sends the first detection data to the bus, and whether the second detection data is received by the second communication port and whether the received second detection data is consistent with the first detection data or not is used for judging whether the bus connection of the 485 bus system is faulty or not, so that fault diagnosis of the 485 bus system is realized through a simple line connection structure and a convenient and fast method.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a 485 bus system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a 485 bus system fault diagnosis method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a 485 bus system fault diagnosis method according to an embodiment of the present disclosure when determining that a bus connection is fault-free;
fig. 4 is a schematic flowchart of a bus fault determining method for a 485 bus system according to an embodiment of the present disclosure, where the bus fault determining method determines whether a bus between a first communication port and a slave device to be tested is faulty;
fig. 5 is a schematic flowchart of a bus connection fault between a first communication port and a slave device to be tested in a 485 bus system fault diagnosis method according to an embodiment of the present disclosure;
fig. 6 is a schematic flowchart illustrating a process of determining a fault section from a first communication port to a slave device to be tested according to a bus connection detection result in a 485 bus system fault diagnosis method according to an embodiment of the present application;
fig. 7 is a schematic flowchart of a process of determining that a slave to be tested can normally respond according to a 485 bus system fault diagnosis method according to an embodiment of the present application;
fig. 8 is a schematic flowchart of a 485 bus system fault diagnosis method according to an embodiment of the present application when a slave device to be tested cannot respond normally;
fig. 9 is a schematic flowchart of a 485 bus system fault diagnosis method for detecting an open circuit or a short circuit of the 485 bus system according to an embodiment of the present disclosure;
fig. 10 is a schematic flowchart of a method for diagnosing a fault of a 485 bus system according to an embodiment of the present disclosure, illustrating a process of detecting an open circuit or a short circuit of a differential signal line of the 485 bus system.
The reference numerals are explained below:
port A, first communication Port; PortB, a second communication port;
line1, a first differential signal Line; line2, a second differential signal Line.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the present application, it is to be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience in describing the present application and simplifying the description, but do not indicate or imply that the referred device or element must have a particular orientation, be constructed in a particular orientation, and be operated, and thus should not be construed as limiting the present application.
The terms "first", "second" and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", "third" may explicitly or implicitly include one or more of the features. In the description of the present application, "a plurality" means two or more unless otherwise specified.
In the description of the present application, it is to be noted that, unless otherwise explicitly specified or limited, the terms "communicate", "mount", "connect", and the like are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art.
In the 485 bus system in the related art, the host has a plurality of communication ports, and each communication port is connected to a corresponding slave, thereby forming a 485 bus system with a point-to-point structure, a tree structure or a star structure. The 485 bus system with the point-to-point structure, the tree structure or the star structure has more host communication ports, so that a port expansion card and a signal converter are generally required to be matched, and the cost of the 485 bus system is higher. In addition, the 485 bus system with the point-to-point structure, the tree structure or the star structure has more host communication ports, so that the wiring complexity is high, and more resources are occupied by the host.
The embodiment of the application provides a 485 bus system. The 485 bus system includes: the host comprises a first communication port and a second communication port, and the bus is connected in series between the first communication port and the second communication port; and one or more slave computers, wherein the slave computers are all connected with the bus and communicate with the host computer through the bus.
The embodiment of the application also provides a 485 bus system fault diagnosis method which is used for the 485 bus system in any one of the above embodiments. The 485 bus system fault diagnosis method comprises the following steps: sending first detection data to a bus through a first communication port; if the second communication port does not receive data within the first preset time, judging that the bus connection fails; if the second communication port receives the second detection data within the first preset time, comparing whether the second detection data is consistent with the first detection data; if the second detection data is consistent with the first detection data, judging that the bus connection has no fault; and if the second detection data is inconsistent with the first detection data, judging that the bus connection is failed.
According to the 485 bus system and the fault diagnosis method thereof, the first communication port sends the first detection data to the bus, and whether the second detection data is received by the second communication port and whether the received second detection data is consistent with the first detection data or not is used for judging whether the bus connection of the 485 bus system is faulty or not, so that fault diagnosis of the 485 bus system is realized through a simple line connection structure and a convenient and fast method.
The following is further described with reference to the accompanying drawings.
Referring to fig. 1, the 485 bus system includes a master, a bus, and a plurality of slaves: slave 1, slave 2, slave 3 … …, slave N. The host includes a first communication Port A and a second communication Port B. The bus is connected in series between the first communication Port A and the second communication Port B with the first communication Port A as a starting point and the second communication Port B as an ending point. The communication cables of the bus adopt a first differential signal Line1 and a second differential signal Line 2. All slaves are connected to the bus and communicate with the master through the bus. Compared with a traditional 485 bus system, the 485 bus system reduces 485 bus system port expansion cards and signal converters, saves wiring, reduces cost, is simple in line connection, easy to install and maintain, and can also facilitate the debugging in the installation process and the maintenance process due to simple line connection. In addition, the digital bus using the RS485 standard can effectively transmit signals under the remote condition and the environment with large electronic noise, and the 485 bus system has high reliability of signal transmission.
The host may also include a switch module. The switching module is used for switching a communication port used for communication between the host and the slave. When the bus section between the first communication Port A and the first slave machine is in fault or in a maintenance state, the master machine can be switched to use the second communication Port B to communicate with the first slave machine through the switching module. When the bus section between the second communication Port B and the second slave machine is in fault or in a maintenance state, the master machine can be switched to use the first communication Port A to communicate with the second slave machine through the switching module. The first slave is any one of a plurality of slaves connected with the host through a bus; the second slave is any one of a plurality of slaves connected to the master through a bus. In particular, the switching module may be a program or plug-in implanted on the host, etc. Therefore, the 485 bus system has line redundancy, when a bus section between the first communication Port A and the first slave machine is in a fault or in a maintenance state, the host and the first slave machine can still keep communication through the second communication Port B, and when a bus section between the second communication Port B and the first slave machine is in a fault or in a maintenance state, the host and the first slave machine can still keep communication through the first communication Port A, so that the host can still keep uninterrupted operation when partial lines are in a fault or in a maintenance state.
Further, the master may further include a connection request module, where the connection request module is configured to send a request instruction for attempting connection to the slave through the first communication Port a or the second communication Port B at preset intervals. Specifically, the connection request module may be a program or plug-in implanted on the host, or the like. Therefore, after the fault repair or overhaul of the bus section between the first communication Port and the slave is finished, when the connection request module sends a connection attempt request instruction to the slave through the first communication Port A at preset intervals, the slave responds to the instruction so that the host and the slave reestablish communication connection through the first communication Port A, and the communication between the host and the slave through the first communication Port is automatically recovered; similarly, after the fault repair or the maintenance of the bus section between the second communication Port and the slave is finished, when the connection request module sends a request instruction for trying to connect to the slave through the second communication Port B at preset interval time, the slave responds to the instruction so that the host and the slave reestablish communication connection through the second communication Port B, and the communication between the host and the slave is automatically recovered through the second communication Port, so that the communication connection between the host and the slave can be automatically recovered after the maintenance is finished or the fault repair is finished without restarting a software program in the host or the host, the system recovery time is saved, and the operation efficiency of the 485 bus system is improved.
Referring to fig. 2, the 485 bus system fault diagnosis method is applied to the 485 bus system according to any of the above embodiments. The 485 bus system fault diagnosis method comprises the following steps:
s01: sending first detection data to a bus through a first communication port;
s011: if the second communication port does not receive data within the first preset time, judging that the bus connection fails;
s012: if the second communication port receives the second detection data within the first preset time, comparing whether the second detection data is consistent with the first detection data;
s0121: if the second detection data is consistent with the first detection data, judging that the bus connection has no fault;
s0122: and if the second detection data is inconsistent with the first detection data, judging that the bus connection is failed.
Specifically, the main body for executing the 485 bus system fault diagnosis method may be a host, or may be a separate maintenance device other than the host, and this specification takes the main body for executing the 485 bus system fault diagnosis method as an example.
Referring to fig. 1, the host sends the first detection data to the bus through the first communication port PortA of the host. Then, the host computer detects and receives second detection data through a second communication port PortB; if the second communication Port B does not receive data within a first preset time, the host judges that the bus connection fails; if the second detection data is received in the second communication Port B within the first preset time, the host compares whether the second detection data is consistent with the first detection data. Then, if the second detection data is consistent with the first detection data, the host judges that the bus connection has no fault; and if the second detection data is inconsistent with the first detection data, the host judges that the bus connection fails. Therefore, the bus cable state of the 485 bus system can be diagnosed under the condition that the slave state is not influenced, namely whether the slave is connected or not, powered on or not and whether the equipment state is normal or not can be diagnosed, whether the bus communication cable of the 485 bus system is normal or not can be diagnosed, the fault diagnosis of the 485 bus system is realized through a convenient and fast method, the diagnosis method is simple in logic, high in reliability, small in occupied resource and energy consumption, and the diagnosis method is favorable for being executed periodically.
When the host judges that the bus connection is failed, the red light of the warning lamp can be controlled to be turned on, and the buzzer is controlled to buzz to perform sound-light alarm. In some embodiments, when the host determines that the bus connection is faulty, the host may perform a fault notification, for example, an alarm notification may appear on a display connected to the host, and the text "bus connection fault" is displayed. When other types of faults are judged, for example, a certain bus section fault or a certain slave fault, the master machine can also alarm or prompt according to the above. When it is determined that there is a fault or no fault in the 485 bus system, the host may also prompt the diagnosis result on the display as described above.
When the host judges that the bus connection has no fault, the green light of the warning light can be controlled to be turned on, and the buzzer is controlled to be turned off. In some embodiments, when the host determines that the bus connection is not faulty, the appearance on a display connected to the host may display the text "bus connection is not faulty".
The 485 bus system can adopt an RS485 master-slave communication mode, and one master machine is provided with a plurality of slave machines. In some embodiments, the master sends a request to the slave, and the slave can only respond to the request of the master and cannot actively initiate the request.
It can be understood that, under the condition that the line of the bus of the 485 bus system is normal, the host can send communication data to the slave through the first communication Port a or the second communication Port B, so that the 485 bus system has line redundancy and can have higher reliability, and when one of the communication ports fails to work or the line between one of the communication ports and the slave fails, the host can still communicate with the slave through the other communication Port, thereby avoiding the influence on the normal operation of the system when part of the communication ports or the line of the system fails. Furthermore, when a line between one communication port or one communication port of the 485 bus system and the slave is overhauled, the host can still communicate with the slave through the other communication port, so that the 485 bus system can operate uninterruptedly when communication cables are overhauled.
The first communication Port A and the second communication Port B can not occupy the RS485 bus at the same time, when the first communication Port A is used for communication normally, the first communication Port A is continuously used for communication, and the first communication Port A is used as a main communication Port. And when the first communication Port A fails to communicate, or the first communication Port A is in a maintenance state, namely the first communication Port A cannot be used for communicating, the second communication Port B can be used for communicating, and therefore line redundancy of the 485 bus system is achieved.
Referring to fig. 3, in some embodiments, when it is determined that the bus connection is not faulty, the 485 bus system fault diagnosis method further includes:
s02: sending a first request signal to a slave to be tested through a first communication port;
s021: if the first communication port does not receive the first response signal returned by the slave machine to be tested within the second preset time, a second request signal is sent to the slave machine to be tested through the second communication port;
s022: and if the second communication port does not receive a second response signal returned by the slave machine to be tested within the third preset time, judging that the slave machine to be tested has a fault.
When it is determined through step S0121 that the bus connection is failure-free, step S02 may be executed to send a first request signal to the slave under test through the first communication Port a. And if the first communication Port A does not receive the first response signal returned by the slave machine to be tested within the second preset time, the second communication Port A sends a second request signal to the slave machine to be tested through the second communication Port B. And then, if the second communication Port B does not receive a second response signal returned by the slave machine to be tested within a third preset time, judging that the slave machine to be tested has a fault. It is understood that in the case where it has been determined through step S0121 that the bus connection is not faulty, the case where the cable fault has been eliminated is explained, and therefore, when the slave to be tested does not respond to both the first request signal transmitted through the first communication Port a and the second request signal transmitted through the second communication Port B, it may be determined that the slave to be tested is faulty. Specifically, the slave to be tested may have a device fault, an interface fault, and the like. The slave to be tested may be any one of the slave 1, the slave 2 and the slave 3 … …, which will be the same as described later. Therefore, if the host computer uses the first communication Port A to request the slave computer to be tested to fail, the host computer uses the second communication Port B to send a request to the slave computer to be tested, and fault diagnosis of the 485 bus system is realized according to the slave computer response result of the secondary request. .
Further, the host sends a first request signal to the slave to be tested through the first communication port, and if the first communication port receives a first response signal returned by the slave to be tested within a second preset time, the host can continue to use the first communication port to communicate with the slave to be tested. The host machine sends a first request signal to the slave machine to be tested through the first communication port, if the first communication port does not receive a first response signal returned by the slave machine to be tested within a second preset time, the host machine sends a second request signal to the slave machine to be tested through the second communication port, if the second communication port receives a second response signal returned by the slave machine to be tested within a third preset time, the host machine uses the second communication port to communicate with the slave machine to be tested, and when the request signal is sent to the next slave machine, the request signal can be sent through the first communication port or the second communication port. Therefore, the request signal is sent first, and whether the slave to be tested responds to the request signal or not is used for determining whether the current communication port is continuously used or the communication port is replaced for next communication, so that communication between the host and the slave to be tested is kept smooth, loss of communication data can be prevented, when the 485 bus system fails, the fault can be timely found through whether the slave responds, and the 485 bus system can be conveniently diagnosed in the next step such as step S021, step S022 and the like.
Referring to fig. 4, in some embodiments, the 485 bus system fault diagnosis method further includes:
s03: sending a first request signal to a slave to be tested through a first communication port;
s031: if the first communication port receives a response signal returned by the slave machine to be tested within a second preset time, the bus between the first communication port and the slave machine to be tested is judged to have no fault;
s032: if the first communication port does not receive the first response signal returned by the slave machine to be tested within the second preset time, a second request signal is sent to the slave machine to be tested through the second communication port;
s0321: if the second communication port receives a second response signal returned by the slave machine to be tested within a third preset time, the bus connection fault between the first communication port and the slave machine to be tested is judged, and the bus connection fault between the second communication port and the slave machine to be tested is avoided.
The master can send a first request signal to the slave to be tested through the first communication Port A whether the bus is judged to be faulty or not. If the first communication Port A receives a response signal returned by the slave machine to be tested within a second preset time, the host machine judges that the bus between the first communication Port A and the slave machine to be tested has no fault; and if the first communication Port A does not receive the first response signal returned by the slave machine to be tested within the second preset time, the host machine sends a second request signal to the slave machine to be tested through the second communication Port B. Then, if the second communication Port B receives a second response signal returned by the slave to be tested within a third preset time, the host determines that the bus connection between the first communication Port a and the slave to be tested is faulty and the bus connection between the second communication Port B and the slave to be tested is faultless. Therefore, if the host computer uses the first communication Port A to request the slave computer to be tested to fail, the host computer uses the second communication Port B to send a request to the slave computer to be tested, and whether the 485 bus system fails or the failure reason is diagnosed according to the response result of the slave computer of the secondary request.
Referring to fig. 5, in some embodiments, when determining that the bus connection between the first communication port and the slave device under test is faulty, the 485 bus system fault diagnosis method further includes:
s04: and acquiring a bus connection detection result of a front slave of the slave to be detected, and determining a fault section between the first communication port and the slave to be detected according to the bus connection detection result. The front slave is the other slave between the first communication port and the slave to be tested.
When the bus connection fault between the first communication Port A and the slave to be tested is determined through the step S0321 or other methods, the host may obtain the bus connection detection result of the slave before the slave to be tested, and determine the fault section between the first communication Port A and the slave to be tested according to the bus connection detection result. The front slave is other slave between the first communication Port A and the slave to be tested. For example, when the host determines that the bus connection between the first communication Port a and the slave to be tested 3 is faulty through the step S0321, the host may obtain the bus connection detection result of the previous slave 1 and the previous slave 2 of the slave to be tested 3, and then determine the faulty section between the first communication Port a and the slave to be tested according to the bus connection detection result. Thereby, bus segment faults between slaves of the 485 bus system can be diagnosed.
Referring to fig. 6, specifically, the obtaining a bus connection detection result of a front slave of the slave to be tested, and determining a fault section between the first communication port and the slave to be tested according to the bus connection detection result (i.e. step S04), may include:
s041: acquiring a bus connection detection result of a front slave of a slave to be detected;
s042: and if the bus connection detection result indicates that the bus between the first communication port and the front slave has no fault, judging that the bus section between the front slave and the slave to be tested has fault.
For example, when the host determines that the bus connection between the first communication Port a and the slave device 3 to be tested is faulty through the step S0321, the host may obtain the bus connection detection results of the front slave device 1 and the front slave device 2 of the slave device 3 to be tested. If the bus connection detection result of the front slave 1 is that the bus between the first communication Port A and the front slave has no fault, the host judges that the bus section between the front slave and the slave to be tested has fault; if the bus connection detection result of the front slave 2 is that the bus between the first communication Port a and the front slave has no fault, the master judges that the bus section between the front slave and the slave to be tested has a fault. Therefore, the fault section between the first communication Port A and the slave machine to be tested is determined by obtaining the bus connection detection result of the front slave machine of the slave machine to be tested, and the fault position of the 485 bus system is further diagnosed by simple and reliable logic.
Referring to fig. 7, in some embodiments, the 485 bus system fault diagnosis method further includes:
s05: sending a first request signal to a slave to be tested through a first communication port every fourth preset time to confirm that the slave to be tested can normally respond;
s06: and sequentially sending first request signals to all the slave machines to be tested through the first communication port every fifth preset time so as to confirm that all the slave machines to be tested can normally respond.
Specifically, the fourth preset time may be shorter than the fifth preset time. The host can send a first request signal to a slave to be tested through the first communication Port A every hour to confirm that the slave to be tested can normally respond; and simultaneously, the first communication Port A sends first request signals to all the slave machines to be tested in sequence every other day so as to confirm that all the slave machines to be tested can normally respond. Or the host can send a first request signal to a slave to be tested through the first communication Port A every 10min, 15min, 20min, 25min or 30min to confirm that the slave to be tested can normally respond; and simultaneously, sequentially sending first request signals to all the slave machines to be tested through the first communication Port A every 6 hours to confirm that all the slave machines to be tested can normally respond. The slave to be tested can normally respond, namely the slave to be tested can return a first response signal aiming at the first request signal, so that the host can receive the first response signal to confirm that the slave to be tested can normally respond. Therefore, the master machine can perform spot check on the slave machine once every fourth preset time, and the master machine performs polling on the slave machine once every fifth preset time, so that the fault of the 485 bus system can be timely found to be convenient for processing the fault when the fault occurs, the 485 bus system can be always kept in a normal operation state, and the stable operation of the 485 bus system is facilitated.
Referring to fig. 8, in some embodiments, the 485 bus system fault diagnosis method further includes:
s07: if the slave to be tested can not normally respond, the host sends a second request signal to the slave to be tested through the second communication port;
s071: if the second communication port of the host receives a second response signal returned by the slave to be tested within a third preset time, the bus connection fault between the first communication port and the slave to be tested is judged, and the bus connection between the second communication port and the slave to be tested has no fault;
s072: if the second communication port of the host does not receive a second response signal returned by the slave to be tested within a third preset time, first detection data are sent to the bus through the first communication port of the host; if the second communication port receives the second detection data within the first preset time, comparing whether the second detection data is consistent with the first detection data; and if the second detection data is consistent with the first detection data, judging that the bus connection has no fault, and judging that the slave to be tested has the fault.
After step S05 or step S06, if one or more slaves to be tested cannot respond normally, the master may send a second request signal to the slave to be tested that cannot respond normally through the second communication Port B. If the second communication Port B of the host receives a second response signal returned by the slave to be tested within a third preset time, the bus connection fault between the first communication Port A and the slave to be tested is judged, and the bus connection fault between the second communication Port B and the slave to be tested is avoided. If the second communication Port B of the host does not receive the second response signal returned by the slave to be tested within the third preset time, step S01 is executed, and the first detection data is sent to the bus through the first communication Port a of the host. If the second detection data is received in the second communication Port B within the first preset time, comparing whether the second detection data is consistent with the first detection data or not; and if the second detection data is consistent with the first detection data, judging that the bus connection has no fault, and judging that the slave to be tested has the fault. It can be understood that the slave to be tested can be judged to have a fault based on the fact that the bus connection has no fault and the slave to be tested cannot respond normally. Therefore, the bus fault section of the 485 bus system can be diagnosed, or a faulty slave to be tested can be diagnosed.
Referring to fig. 9, in some embodiments, the 485 bus system fault diagnosis method further includes:
s08: the multimeter is controlled to detect open and/or short circuit conditions of the cable at the fault of the bus.
Because the starting of the bus cable is beside the host, the universal meter is used for measuring the on-off between the starting points of the bus, and whether the bus has an open circuit condition can be identified. For the specific fault position of the bus and the detection of the specific fault condition, after the host judges the fault condition of the 485 bus system and points out the fault position of the 485 bus system, the host can control the universal meter to detect the open circuit and/or short circuit condition of the cable at the fault position of the bus. Specifically, electrical measurement points can be arranged on the bus of the 485 bus system and at the interface of the bus and the host or the slave, and the electrical measurement points can be directly electrically connected with a universal meter, so that the universal meter can conveniently measure the path, the open circuit or the short circuit condition between the measurement points, and further the open circuit, the short circuit or the open circuit and the short circuit condition of the cable at the fault position of the bus can be obtained, further the fault reason and the specific fault position of the 485 bus system can be further confirmed, and the accurate diagnosis of the fault reason and the fault position is realized.
Specifically, the bus includes a first differential signal line and a second differential signal line, which are commonly used to transmit differential signals and/or differential data. Referring to FIG. 10, controlling a multimeter to detect a disconnection and/or short circuit condition of a cable at a fault in a bus (step S08) includes:
s081: the multimeter is controlled to detect a short circuit condition between a first differential signal line and a second differential signal line at a fault of the bus, a broken circuit condition of the first differential signal line, and a broken circuit condition of the second differential signal line.
The bus may include bus segments, such as a bus segment from the first communication port to the slave under test, a bus segment from the second communication port to the slave under test, or a bus segment between two slaves under test. In some embodiments, the 485 bus system fault diagnosis method can also control a multimeter to detect short circuit conditions between different bus segments. Since the first differential signal Line1 and the second differential signal Line2 are both started at the host, the disconnection of the first differential signal Line1, the disconnection of the second differential signal Line2, or the short circuit between the first differential signal Line1 and the second differential signal Line2 can be recognized by using the multimeter to measure the Line disconnection.
The first differential signal Line1 and the second differential signal Line2 can be provided with electrical measurement points, and the electrical measurement points can be directly electrically connected with a multimeter, so that the multimeter can conveniently measure the path, the open circuit or the short circuit condition between the measurement points, and further can obtain the open circuit, the short circuit or the open circuit and the short circuit condition of the cable at the fault position of the first differential signal Line1 and the second differential signal Line2, and further can further confirm the fault reason and the specific fault position of the 485 bus system, and realize the accurate diagnosis of the fault reason and the fault position.
For example, if the bus fault between the first communication Port a of the host and the slave 1 to be tested is diagnosed, the multimeter is controlled to measure the Line connection between the first communication Port a and the slave 1 to be tested, and then specific fault reasons such as a short circuit of the first differential signal Line1, a broken circuit, a short circuit of the second differential signal Line2, a broken circuit, or a short circuit between the first differential signal Line1 and the second differential signal Line2 can be diagnosed, so that the specific fault reasons of the 485 bus system can be accurately located.
In summary, according to the 485 bus system and the fault diagnosis method thereof in the embodiments of the present application, the first communication port sends the first detection data to the bus, and whether the second communication port receives the second detection data and whether the received second detection data is consistent with the first detection data is used to determine whether the bus connection of the 485 bus system is faulty, so that fault diagnosis of the 485 bus system is achieved through a simple line connection structure and a convenient and fast method.
In the description of embodiments of the present application, any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes additional implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processing module-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection having one or more wires (control method), a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the embodiments of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. A 485 bus system, wherein said 485 bus system comprises:
the host comprises a first communication port and a second communication port, and a bus is connected in series between the first communication port and the second communication port;
one or more slaves, each slave being connected to the bus and communicating with the master through the bus.
2. The 485 bus system of claim 1, wherein the master further comprises a switching module for switching a communication port through which the master communicates with the slave;
when a bus section between the first communication port and a first slave machine is in a fault state or in a maintenance state, the master machine can be switched to use the second communication port to communicate with the first slave machine through the switching module;
when a bus section between the second communication port and a second slave machine is in a fault state or in a maintenance state, the master machine can be switched to use the first communication port to communicate with the second slave machine through the switching module.
3. The 485 bus system of claim 2, wherein the master further comprises a connection request module, and the connection request module is configured to send a connection attempt request command to the slave through the first communication port or the second communication port at preset intervals.
4. A 485 bus system fault diagnosis method, which is used for the 485 bus system of any one of claims 1-3, and the 485 bus system fault diagnosis method comprises the following steps:
sending first detection data to the bus through the first communication port;
if the second communication port does not receive data within a first preset time, judging that the bus connection fails;
if second detection data are received in the second communication port within first preset time, comparing whether the second detection data are consistent with the first detection data or not;
if the second detection data is consistent with the first detection data, judging that the bus connection is faultless;
and if the second detection data is inconsistent with the first detection data, judging that the bus connection is failed.
5. The 485 bus system fault diagnosis method of claim 4, wherein when it is determined that the bus connection is fault free, the method further comprises:
sending a first request signal to a slave to be tested through the first communication port;
if the first communication port does not receive a first response signal returned by the slave machine to be tested within a second preset time, a second request signal is sent to the slave machine to be tested through the second communication port;
and if the second communication port does not receive a second response signal returned by the slave machine to be tested within a third preset time, judging that the slave machine to be tested has a fault.
6. The 485 bus system fault diagnosis method of claim 4, wherein said method further comprises:
sending a first request signal to a slave to be tested through the first communication port;
if the first communication port receives a response signal returned by the slave machine to be tested within a second preset time, judging that the bus between the first communication port and the slave machine to be tested has no fault;
if the first communication port does not receive a first response signal returned by the slave machine to be tested within a second preset time, a second request signal is sent to the slave machine to be tested through the second communication port;
if the second communication port receives a second response signal returned by the slave machine to be tested within a third preset time, it is determined that the bus connection between the first communication port and the slave machine to be tested is faulty and the bus connection between the second communication port and the slave machine to be tested is faultless.
7. The 485 bus system fault diagnosis method according to claim 6, wherein when it is determined that the bus connection between the first communication port and the slave device to be tested is faulty, the method further comprises:
and acquiring a bus connection detection result of a front slave of the slave to be detected, and determining a fault section from the first communication port to the slave to be detected according to the bus connection detection result, wherein the front slave is another slave positioned between the first communication port and the slave to be detected.
8. The 485 bus system fault diagnosis method according to claim 7, wherein the determining the fault section between the first communication port and the slave device to be tested according to the bus connection detection result includes:
and if the bus connection detection result indicates that the bus between the first communication port and the front slave machine has no fault, judging that the bus section between the front slave machine and the slave machine to be tested has a fault.
9. The 485 bus system fault diagnosis method of claim 6, wherein said method further comprises:
sending a first request signal to one slave machine to be tested through the first communication port every fourth preset time to confirm that the slave machine to be tested can normally respond; and/or
And sequentially sending first request signals to all the slave machines to be tested through the first communication port every fifth preset time so as to confirm that all the slave machines to be tested can normally respond.
10. The 485 bus system fault diagnostic method of claim 9, further comprising:
if the slave to be tested can not normally respond, the host sends a second request signal to the slave to be tested through a second communication port;
if the second communication port of the host receives a second response signal returned by the slave to be tested within a third preset time, the bus connection fault between the first communication port and the slave to be tested is judged, and the bus connection between the second communication port and the slave to be tested has no fault;
if the second communication port of the host does not receive a second response signal returned by the slave to be tested within a third preset time, first detection data are sent to the bus through the first communication port of the host; if the second communication port receives the second detection data within the first preset time, comparing whether the second detection data is consistent with the first detection data; and if the second detection data is consistent with the first detection data, judging that the bus connection has no fault, and judging that the slave to be tested has the fault.
11. The 485 bus system fault diagnosis method according to any one of claims 4 to 10, wherein the method further comprises:
the multimeter is controlled to detect a disconnection and/or short circuit condition of the cable at the fault of the bus.
12. The 485 bus system fault diagnosis method according to claim 11, wherein the bus comprises a first differential signal line and a second differential signal line, the first differential signal line and the second differential signal line are commonly used for transmitting differential signals and/or differential data;
the control multimeter detecting a disconnection and/or short circuit condition of a cable at a fault of the bus comprises:
and controlling a multimeter to detect a short circuit condition between the first differential signal line and the second differential signal line, a broken circuit condition of the first differential signal line and a broken circuit condition of the second differential signal line at the fault of the bus.
CN202110008494.8A 2021-01-05 2021-01-05 485 bus system and fault diagnosis method thereof Pending CN112737912A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110008494.8A CN112737912A (en) 2021-01-05 2021-01-05 485 bus system and fault diagnosis method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110008494.8A CN112737912A (en) 2021-01-05 2021-01-05 485 bus system and fault diagnosis method thereof

Publications (1)

Publication Number Publication Date
CN112737912A true CN112737912A (en) 2021-04-30

Family

ID=75589785

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110008494.8A Pending CN112737912A (en) 2021-01-05 2021-01-05 485 bus system and fault diagnosis method thereof

Country Status (1)

Country Link
CN (1) CN112737912A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100246408A1 (en) * 2007-10-02 2010-09-30 Smsc Europe Gmbh System and Method for Signal Failure Detection in a Ring Bus System
WO2011011915A1 (en) * 2009-07-29 2011-02-03 华为技术有限公司 Data communication method, communication equipment and communication system
CN102710483A (en) * 2012-05-21 2012-10-03 周明 RS485 (Recommended Standard 485) intelligent loop
CN105871623A (en) * 2016-05-18 2016-08-17 广州数控设备有限公司 Occasional fault diagnosis method of field bus
CN108234232A (en) * 2016-12-21 2018-06-29 杭州海康威视数字技术股份有限公司 Fault location, loop detecting method, device, system and equipment based on bus
CN108259265A (en) * 2017-12-08 2018-07-06 中国航空工业集团公司成都飞机设计研究所 A kind of military 1394B bus network channel integrity detection method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100246408A1 (en) * 2007-10-02 2010-09-30 Smsc Europe Gmbh System and Method for Signal Failure Detection in a Ring Bus System
WO2011011915A1 (en) * 2009-07-29 2011-02-03 华为技术有限公司 Data communication method, communication equipment and communication system
CN102710483A (en) * 2012-05-21 2012-10-03 周明 RS485 (Recommended Standard 485) intelligent loop
CN105871623A (en) * 2016-05-18 2016-08-17 广州数控设备有限公司 Occasional fault diagnosis method of field bus
CN108234232A (en) * 2016-12-21 2018-06-29 杭州海康威视数字技术股份有限公司 Fault location, loop detecting method, device, system and equipment based on bus
CN108259265A (en) * 2017-12-08 2018-07-06 中国航空工业集团公司成都飞机设计研究所 A kind of military 1394B bus network channel integrity detection method

Similar Documents

Publication Publication Date Title
CN109162818B (en) Control system and control method of engine and engine
US7502669B1 (en) Apparatus and method for graphically displaying disk drive enclosures and cabling in a data storage system
US6643465B1 (en) Method for checking a ring optical network line for data transmission between a plurality of network subscribers in a motor vehicle
US5079759A (en) Multiplex transmission system for vehicles having a failure diagnosis function
CN209543136U (en) The test device and test equipment of the controller of vehicle
US6744735B1 (en) Diagnostic device, diagnostic method, and network system having diagnostic facility
CN112034388A (en) Automatic wire harness detection system and detection method
CN111016658B (en) High-voltage interlocking loop, fault detection method and vehicle
JP4345502B2 (en) Fault diagnosis method for vehicle communication network
JP3965772B2 (en) Fault diagnosis device for vehicles
CN106324420B (en) A kind of display fault detection method
CN111669299B (en) Communication failure detection device
CN112737912A (en) 485 bus system and fault diagnosis method thereof
CN116149301A (en) Fault diagnosis device and method and vehicle
CN111142504A (en) Bus detection device and method
WO2006129999A1 (en) Network bus diagnosis system
CN112383462B (en) Network device and bus configuration method
CN114838848A (en) Temperature sampling control method, device, equipment and storage medium
CN112711502B (en) Gao Wenkao machine testing method, control end, tooling end and system for iMS-CPU board
CN113711209A (en) Electronic control device
CN117929887A (en) Fault detection method and device, storage medium and vehicle
US20120284445A1 (en) Redundant Electrical Network Between Remote Electrical Systems and a Method of Operating Same
KR101603549B1 (en) In-vehicle network system and method for diagnosing the same
JPH1127184A (en) Data transmitter
CN114168070A (en) Storage device, master-slave determination method, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210430