CN115701566A - Method and device for detecting equipment with RS485 communication circuit - Google Patents

Method and device for detecting equipment with RS485 communication circuit Download PDF

Info

Publication number
CN115701566A
CN115701566A CN202110878956.1A CN202110878956A CN115701566A CN 115701566 A CN115701566 A CN 115701566A CN 202110878956 A CN202110878956 A CN 202110878956A CN 115701566 A CN115701566 A CN 115701566A
Authority
CN
China
Prior art keywords
communication circuit
equipment
communication
resistor
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
CN202110878956.1A
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.)
Beijing RSlaser Opto Electronics Technology Co Ltd
Original Assignee
Beijing RSlaser Opto Electronics Technology 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 Beijing RSlaser Opto Electronics Technology Co Ltd filed Critical Beijing RSlaser Opto Electronics Technology Co Ltd
Priority to CN202110878956.1A priority Critical patent/CN115701566A/en
Publication of CN115701566A publication Critical patent/CN115701566A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the application provides a method and a device for detecting equipment with an RS485 communication circuit. In the embodiment of the application, under the condition that the RS485 communication circuit is detected, the first RS485 communication circuit is controlled to be in communication connection with the second RS485 communication circuit, and the first RS485 communication circuit is the RS485 communication circuit to be detected; and sending detection data to the first RS485 communication circuit, and determining that the first RS485 communication circuit has a fault when the detection data received by the first RS485 communication circuit forwarded by the second RS485 communication circuit is not received. And when the detection data received by the first RS485 communication circuit forwarded by the second RS485 communication circuit is not received, the fault of the first RS485 communication circuit is determined. Therefore, whether the first RS485 communication circuit in the equipment fails or not can be quickly determined.

Description

Method and device for detecting equipment with RS485 communication circuit
Technical Field
The invention relates to the field of control, in particular to a method and a device for detecting equipment with an RS485 communication circuit.
Background
In a laser power supply, RS485 link communication is adopted among a plurality of physical units, although firmware of a type of the physical unit A and firmware of a type of the physical unit B are mature, in the process of batch debugging, the problem that how to quickly locate the physical unit on which the fault occurs because a certain physical unit A and the physical unit B cannot normally communicate due to hardware faults of an RS485 circuit is the key of solution.
Disclosure of Invention
The technical problem to be solved by the present invention is to overcome the defects of the prior art, and provide a method and an apparatus for detecting a device having an RS485 communication circuit, which are used to quickly detect the device and determine the device having a fault.
In order to achieve the above technical object, in one aspect, the present invention provides a method for detecting a device having an RS485 communication circuit, where the device includes a controller, a first RS485 communication circuit connected to the controller, and a second RS485 communication circuit connected to the controller, and the device is communicatively connected to other devices through the first RS485 communication circuit, and the method includes: under the condition of detecting the RS485 communication circuit of the equipment, controlling the first RS485 communication circuit to be in communication connection with the second RS485 communication circuit, wherein the first RS485 communication circuit is an RS485 communication circuit to be detected; and sending detection data to the first RS485 communication circuit, and determining that the first RS485 communication circuit has a fault when the detection data received by the first RS485 communication circuit forwarded by the second RS485 communication circuit is not received.
In addition, the method further comprises: receiving a detection instruction, and detecting the RS485 communication circuit of the equipment according to the detection instruction; or under the condition that the equipment is communicated with other equipment, if the data sent by other equipment is not received within preset time, the RS485 communication circuit is used for detecting the equipment.
In addition, the method further comprises: and under the condition that the RS485 communication circuit detection is carried out on the equipment, the first RS485 communication circuit is controlled to be disconnected from the other equipment in communication.
Specifically, control first RS485 communication circuit with second RS485 communication circuit carries out communication connection, include: and switching the first RS485 communication circuit in communication connection with the other equipment to be in communication connection with the second RS485 communication circuit by controlling the switching of the link selector switch.
In addition, the method further comprises: and when the received detection data forwarded by the second RS485 communication circuit and received by the first RS485 communication circuit is received, determining that the first RS485 communication circuit is normal.
In addition, first RS485 communication circuit is provided with pull-up resistance and pull-down resistance, second RS485 communication circuit is provided with pull-up resistance and pull-down resistance.
In addition, a current limiting resistor is arranged between the first RS485 communication circuit and the controller, and a current limiting resistor is arranged between the second RS485 communication circuit and the controller.
In addition, the second RS485 communication circuit is provided with an impedance matching resistor.
In addition, the first RS485 communication circuit is in communication connection with other equipment through a wiring terminal.
In addition, when the detection data received by the first RS485 communication circuit forwarded by the second RS485 communication circuit is not received, the method further includes: and determining whether a current-limiting resistor between the first RS485 communication circuit and the controller is in fault, if not, determining whether a pull-up resistor and a pull-down resistor of the first RS485 communication circuit are in fault, if not, determining that the first RS485 communication circuit is normal, otherwise, determining that the first RS485 communication circuit is in fault.
In addition, when the first RS485 communication circuit is normal, the method further comprises the following steps: and determining whether a control link switch, a pull-up resistor and a pull-down resistor of the second RS485 communication circuit and an impedance matching resistor of the second RS485 communication circuit are in fault, if not, determining whether a current-limiting resistor between the second RS485 communication circuit and the controller is in fault, and if not, determining that the second RS485 communication circuit is in fault.
In another aspect, the present invention provides an apparatus for detecting a device having an RS485 communication circuit, where the device includes a controller, a first RS485 communication circuit connected to the controller, and a second RS485 communication circuit connected to the controller, and the device is communicatively connected to other devices through the first RS485 communication circuit, and the apparatus includes: the control module is used for controlling the first RS485 communication circuit to be in communication connection with the second RS485 communication circuit under the condition that the RS485 communication circuit is detected on the equipment, and the first RS485 communication circuit is an RS485 communication circuit to be detected; and the determining module is used for sending detection data to the first RS485 communication circuit, and when the detection data received by the first RS485 communication circuit forwarded by the second RS485 communication circuit is not received, determining that the first RS485 communication circuit has a fault.
In the embodiment of the application, under the condition that the RS485 communication circuit is detected, the first RS485 communication circuit is controlled to be in communication connection with the second RS485 communication circuit, and the first RS485 communication circuit is the RS485 communication circuit to be detected; and sending detection data to the first RS485 communication circuit, and determining that the first RS485 communication circuit has a fault when the detection data received by the first RS485 communication circuit forwarded by the second RS485 communication circuit is not received.
Wherein, by sending the detection data to the first RS485 communication circuit, and when the detection data received by the first RS485 communication circuit forwarded by the second RS485 communication circuit is not received, determining that the first RS485 communication circuit has a fault. Therefore, whether the first RS485 communication circuit in the equipment fails or not can be quickly determined.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for detecting a device having an RS485 communication circuit according to an embodiment of the present application;
fig. 2 is a schematic diagram of a device structure with an RS485 communication circuit according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a read-back test point according to an embodiment of the present application;
fig. 4 is a schematic frame diagram of an apparatus for detecting a device having an RS485 communication circuit according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
As shown in fig. 1, the present application provides a method for detecting a device having an RS485 communication circuit, where the device includes a controller, a first RS485 communication circuit connected to the controller, and a second RS485 communication circuit connected to the controller, and the device is in communication connection with other devices through the first RS485 communication circuit. The method 100 includes:
101: and under the condition of detecting the RS485 communication circuit of the equipment, controlling the first RS485 communication circuit to be in communication connection with the second RS485 communication circuit.
Wherein, the first RS485 communication circuit is an RS485 communication circuit to be detected.
102: and sending detection data to the first RS485 communication circuit, and determining that the first RS485 communication circuit has a fault when the detection data received by the first RS485 communication circuit forwarded by the second RS485 communication circuit is not received.
It should be noted that the execution subject of the method 100 may be a device with a calculation function, such as a single chip, a Micro Processing Unit (MPU), etc., i.e., the aforementioned controller.
Further, the above-mentioned device may be a device having the execution body, such as a device for converting dc into ac (which may also be a physical unit for converting dc into ac), or a device for converting low-voltage dc into high-voltage pulse power (which may also be a physical unit for converting low-voltage dc into high-voltage pulse power). The device can also be directly used as an execution subject and the detection method is realized by the controller.
As shown in fig. 2, the device includes a single-chip microcomputer MUC1, a 485 transceiver IC1 202 electrically connected to the single-chip microcomputer MUC1, and a 485 transceiver IC2 203 electrically connected to the controller MUC1 201. The device communicates with other devices via the 485 transceiver IC1 202 to transmit data.
In addition, as can be seen from the foregoing, since a certain physical unit a and a certain physical unit B cannot normally communicate due to a hardware fault of the RS485 circuit (i.e., the RS485 communication circuit) still occurs during the batch debugging process, a currently common method for troubleshooting is to test whether the physical units a and C and the physical units B and C can normally communicate respectively and sequentially by means of the third-party physical unit C, so as to locate which physical unit the fault occurs on, but this method is inefficient. And this application embodiment is directed at the equipment or the physical unit that adopt RS485 communication circuit, when two certain physical units or equipment that adopt ripe firmware can not normally communicate, need not realize the problem of fault location with the help of third party physical unit or equipment, promotes debugging efficiency.
The following is set forth in detail with respect to the above steps:
101: and under the condition of detecting the RS485 communication circuit of the equipment, controlling the first RS485 communication circuit to be in communication connection with the second RS485 communication circuit.
Wherein, the first RS485 communication circuit is an RS485 communication circuit to be detected. As shown in fig. 2, the first RS485 communication circuit may be the 485 transceiver IC1 202. The second RS485 communication circuit 485 may be a transceiver IC2 203.
As shown in fig. 2, the single-chip microcomputer MUC1 communicates with other devices through the 485 transceiver IC1 202 and the connection terminal 204 to transmit and receive data. Namely, the device is also in communication connection with other devices through the single-chip microcomputer MUC 1201, the 485 transceiver IC1 202 and the connection terminal 204.
When the single-chip microcomputer MUC 1201 or the device is in communication connection with other devices, the 485 transceiver IC1 202 and the connection terminal 204 can be in circuit connection through the link changeover switch SW1 212.
Specifically, control first RS485 communication circuit with second RS485 communication circuit carries out communication connection, include: and switching the first RS485 communication circuit in communication connection with the other equipment to be in communication connection with the second RS485 communication circuit by controlling the switching of the link selector switch.
Wherein, the link switch can be a single-pole double-throw switch. As shown in fig. 2, the path switching of the link switching switch SW1 212 and the link switching switch SW2 213 is controlled by the MCU1201, and the transceiving of the 485 transceiver IC1 202 and the 485 transceiver IC2 203 is also controlled by the MCU1 201.
For example, as shown in fig. 2, in a normal operating state, the MCU1201 controls the a-c of the switch SW1 212 to be turned on, i.e. the selected path is the a-c path. The singlechip MCU1201 controls the d-e of the link switch SW2 213 to be conducted, i.e. the selected path is a d-e path. Thereby enabling the 485 transceiver IC1 202 to communicate with other physical units via the connection terminals 204. When the device works in a detection state, the single chip microcomputer MCU1201 can control the a-b conduction of the link switch SW1 212, the d-f conduction of the link switch SW2 213 and the communication, namely the communication connection, of the 485 transceiver IC1 202 and the 485 transceiver IC2 203, and can transmit and receive data.
In addition, the method 100 further comprises: receiving a detection instruction, and detecting the RS485 communication circuit of the equipment according to the detection instruction; or under the condition that the equipment is communicated with other equipment, if the data sent by other equipment is not received within preset time, the RS485 communication circuit is used for detecting the equipment.
For example, as described above, a debugging person may send a self-check instruction about the RS485 communication circuit to the single chip microcomputer, and the single chip microcomputer performs detection after receiving the instruction, and then starts detection according to the above manner. Or, as shown in fig. 2, the single-chip microcomputer MUC 1201 is in communication connection with other devices through the 485 transceiver IC1 202 and the connection terminal 204, when data is received and transmitted, the single-chip microcomputer MUC 1201 sends the data to the other devices through the 485 transceiver IC1 202, if the single-chip microcomputer MUC1 does not receive corresponding response data within a preset time period, the single-chip microcomputer MUC 1201 may trigger a self-test state, and then the detection is started according to the above manner.
In the detection state, it is necessary to disconnect the communication connection with another device.
Specifically, the method 100 further includes: and under the condition that the RS485 communication circuit detection is carried out on the equipment, the first RS485 communication circuit is controlled to be disconnected from the other equipment in communication.
For example, as shown in fig. 2, as can be seen from the foregoing, since the MCU1201 can control the a-b of the link switch SW1 212 to be turned on and the d-f of the link switch SW2 213 to be turned on, the connection terminal 204 is no longer in circuit connection with the 485 transceiver IC1 202, and thus no longer in communication connection with other devices.
102: and sending detection data to the first RS485 communication circuit, and determining that the first RS485 communication circuit has a fault when the detection data received by the first RS485 communication circuit forwarded by the second RS485 communication circuit is not received.
For example, as shown in fig. 2, after the MCU1201 controls the link switch to switch, predefined detection data may be sent to the 485 transceiver IC1 202, and after the 485 transceiver IC1 202 receives the detection data, if the 485 transceiver IC1 202 is normal, the detection data may be sent to the 485 transceiver IC2 203, and the 485 transceiver IC2 203 may finally return the detection data to the MCU1 201. If the 485 transceiver IC2 203 cannot receive the predefined test data through the 485 transceiver IC1 202, it is determined that the 485 transceiver IC1 202 is faulty. That is, if the MCU1201 of the single chip microcomputer does not receive the detection data, it determines that the 485 transceiver IC1 202 is faulty, or the received data does not match the detection data, it may also determine that the 485 transceiver IC1 202 is faulty.
In addition, the 100 method further comprises: and when the received detection data forwarded by the second RS485 communication circuit and received by the first RS485 communication circuit is received, determining that the first RS485 communication circuit is normal.
For example, as can be seen from the above, as shown in fig. 2, if the MCU1201 receives data and the data is the same as the detected data, it determines that the 485 transceiver IC1 202 is normal.
In addition, first RS485 communication circuit is provided with pull-up resistance and drop-down resistance, and second RS485 communication circuit is provided with pull-up resistance and drop-down resistance.
For example, as shown in fig. 2, and as described above, for the 485 transceiver IC1 202, a pull-up resistor R7207 and a pull-down resistor R8208 are provided. For the 485 transceiver IC2 203, a pull-up resistor R9 and a pull-down resistor R10 are provided. The default state of the 485 transceiver IC1 202 is a receiving mode, the pull-up resistor R7 and the pull-down resistor R8 can enable the 485 transceiver IC1 202 to receive a fixed level in the power-on initial state, and in order to prevent output of messy codes, the MCU1201 is interrupted frequently to work, and normal work of the MCU1 is affected. Correspondingly, the default state of the 485 transceiver IC2 203 is also the receiving mode, because of the existence of the pull-up resistor R9 209 and the pull-down resistor R10, the 485 transceiver IC2 203 will also receive a fixed level, so as to prevent the output of the random code, which causes the MCU1201 to interrupt the operation frequently, and affects the normal operation of the MCU1 201. When the 485 transceiver IC1 202 communicates with other physical devices, the impedance matching resistor is provided by other physical device communication circuits, and when the 485 transceiver IC1 202 communicates with the 485 transceiver IC2 203, the impedance matching resistor is provided by the 485 transceiver IC2 203 communication circuit.
Specifically, the second RS485 communication circuit is provided with an impedance matching resistor. For example, as shown in fig. 2, as described above, the 485 transceiver IC2 203 is provided with the impedance matching resistor Rm211, and the impedance matching resistor Rm211 is used for absorbing the reflected wave to optimize the communication stability.
In addition, a current limiting resistor is arranged between the first RS485 communication circuit and the controller, and a current limiting resistor is arranged between the second RS485 communication circuit and the controller.
For example, as shown in FIG. 2, and as described above, for the 485 transceiver IC1 202, current limiting resistors R1-R3 205 are provided. For the 485 transceiver IC2 203, current limiting resistors R4-R6 206 are provided.
In addition, the first RS485 communication circuit is in communication connection with other equipment through a wiring terminal. Since the foregoing has been set forth, it is not repeated here.
It should be understood that the above solution is established in the case that the second RS485 communication circuit is normal, when it cannot be determined whether the second RS485 communication circuit is normal, further determination is needed, or in the case that the second RS485 communication circuit is normal, specific fault location can be performed on the first RS485 communication circuit.
Specifically, when the detection data received by the first RS485 communication circuit and forwarded by the second RS485 communication circuit is not received, the method 100 further includes: and determining whether a current-limiting resistor between the first RS485 communication circuit and the controller is in fault, if not, determining whether a pull-up resistor and a pull-down resistor of the first RS485 communication circuit are in fault, if not, determining that the first RS485 communication circuit is normal, otherwise, determining that the first RS485 communication circuit is in fault.
As shown in fig. 3, read-back test points Y1 to Y10 may be added here. Wherein G1-G16 are ports of the MCU1201 of the singlechip. In normal operation, since the foregoing has been described, the detailed description is omitted here. Whether each resistor and the link selector switch have faults or not is determined by reading back the test points Y1-Y10, so that whether the RS485 communication circuit has faults or not can be determined. As shown in fig. 3, a port G1 of the MCU1201 of the single chip microcomputer and a bus interface a of the 485 transceiver IC1 202 are connected to the read-back test point Y4. The port G2 of the MCU1201 of the single chip microcomputer and the pin receiving output end RO of the 485 transceiver IC1 202 are connected to the read-back test point Y1. The port G5 of the MCU1201 of the singlechip and the pin of the 485 transceiver IC1 202 receive enable signals
Figure BDA0003191312610000071
(active low) connection test point Y2 is read back. The port G7 of the MCU1201 of the MCU and the pin-out enable signal DI (active high) of the 485 transceiver IC1 202 are connected to the read-back test point Y3. Ports G8 and 48 of MCU1201 of single chip microcomputerBus interface B of transceiver IC1 202 is connected to read-back test point Y5.
The port G9 of the MCU1201 of the singlechip and the bus interface A of the 485 transceiver IC1 203 are connected to the read-back test point Y9. The port G10 of the MCU1201 of the singlechip and the pin receiving output end RO of the 485 transceiver IC1 203 are connected to the read-back test point Y6. The port G13 of the MCU1201 of the singlechip and the pin of the 485 transceiver IC1 203 receive an enabling signal
Figure BDA0003191312610000072
The (active low) connection is at the read back test point Y7. The port G15 of the MCU1201 of the MCU and the pin-out enable signal DI (active high) of the 485 transceiver IC1 203 are connected to the read-back test point Y8. The port G16 of the MCU1201 of the singlechip and the bus interface B of the 485 transceiver IC1 203 are connected to the read-back test point Y10.
For example, as shown in fig. 3, the MCU1201 sends "1" to the 485 transceiver IC1 202 through its G3 port, and reads back the data of the Y1 point through the G2 port, if the G2 port can read back "1", it is determined that the current limiting resistor R1 is not faulty, otherwise, it is determined that the current limiting resistor R1 is faulty.
The MCU1201 of the single chip microcomputer sends '1' to the 485 transceiver IC1 202 through a G4 port, and simultaneously reads back data of a Y2 point through a G5 port, if the G5 port can read back the '1', the current limiting resistor R2 is determined to have no fault, otherwise, the current limiting resistor R2 is determined to be in fault;
the MCU1201 sends '1' to the 485 transceiver IC1 202 through the G6 port, and reads back the data of the Y3 point through the G7 port, if the G7 port can read back '1', it is determined that the current limiting resistor R3 has no fault, otherwise, it is determined that the current limiting resistor R3205 has fault.
If it is determined that the current limiting resistor R1, the current limiting resistor R2 and the current limiting resistor R3205 are all faultless, the single chip microcomputer MCU1201 sends "1" to the 485 transceiver IC1 202 through the G6 port, reads back data of the point Y4 through the G1 port, reads back data of the point Y5 through the G8 port, and if (Y4-Y5) >200mV, the pull-up resistor R7 and the pull-down resistor R8 are faultless and it is determined that the 485 transceiver IC1 202 is faultless. Otherwise it is determined that the 485 transceiver IC1 202, pull-up resistor R7, and pull-down resistor R8208 are malfunctioning.
In addition, when the first RS485 communication circuit is normal, the method 100 further includes: and determining whether a control link switch, a pull-up resistor and a pull-down resistor of the second RS485 communication circuit and an impedance matching resistor of the second RS485 communication circuit are in fault, if not, determining whether a current-limiting resistor between the second RS485 communication circuit and the controller is in fault, and if not, determining that the second RS485 communication circuit is in fault.
For example, if none of the current limiting resistor R1, the current limiting resistor R2, the current limiting resistor R3205, the pull-up resistor R7, the pull-down resistor R8208, and the 485 transceiver IC1 202 has a fault, the MCU1201 of the single chip microcomputer transmits "1" to the 485 transceiver IC1 202 through the G6 port, reads back data at the Y9 point through the G9 port, and reads back data at the Y10 point through the G16 port, and if (Y9-Y10) >200mV, it is determined that the link switch SW1 212 (the same as the link switch SW1 212 in fig. 2, but different in path identification, but the same in physical meaning), the link switch SW2 213, the pull-up resistor R9, the pull-down resistor R10 210, and the impedance matching resistor Rm211 have no fault, or it is determined that the fault otherwise.
The MCU1 of the single chip microcomputer sends '1' to the 485 transceiver IC1 203 through a G11 port, and simultaneously reads back data of a Y6 point through a G10 port, if the G10 port can read back '1', the current limiting resistor R4 206 is determined to have no fault, otherwise, the current limiting resistor R4 206 is determined to have fault.
The MCU1 of the single chip microcomputer sends '1' to the 485 transceiver IC1 203 through a G12 port, and simultaneously reads back data of a Y7 point through a G13 port, if the G13 port can read back '1', the current limiting resistor R5 is determined to have no fault, otherwise, the current limiting resistor R5 is determined to be in fault.
The MCU1 of the single chip microcomputer sends '1' to the 485 transceiver IC1 203 through a G14 port, and simultaneously reads back data of a Y8 point through a G15 port, if the G15 port can read back '1', the current limiting resistor R6 is determined to have no fault, otherwise, the current limiting resistor R6 is determined to be in fault.
If, according to the previous determination, no faulty component is found, it is determined that the 485 transceiver IC1 203 is faulty. Therefore, the fault position diagnosed by the MCU1201 of the single chip microcomputer can help debugging personnel to quickly locate the fault, and the debugging and maintenance efficiency is improved.
Therefore, the RS485 communication circuit self-checking function in the equipment can be achieved, faults can be located quickly, and debugging time is saved.
In addition, verification of the detection function of the embodiment of the present application can also be performed through circuit simulation. Wherein, the singlechip can select the STM32 singlechip for use, and the RS485 transceiver can select MAX3485, and analog switch TMU6219-Q1 can be selected for use to the link change over switch. The multi-path analog switch can realize path switching according to the instruction of the single chip microcomputer, wherein data of each path can flow in two directions. The implementation and detection are performed according to the above-mentioned manner, so that circuit simulation is realized, and the goal of verification detection is achieved, which is not described again.
The embodiment of the application also provides a device for detecting the equipment with the RS485 communication circuit, which is applied to a controller or the equipment. The device includes a controller, a first RS485 communication circuit connected to the controller, and a second RS485 communication circuit connected to the controller, and the device is connected to other devices through the first RS485 communication circuit, as shown in fig. 4, the apparatus 400 includes:
and the control module 401 is configured to control the first RS485 communication circuit to be in communication connection with the second RS485 communication circuit under the condition that the RS485 communication circuit is detected by the device.
Wherein, the first RS485 communication circuit is an RS485 communication circuit to be detected.
The determining module 402 is configured to send detection data to the first RS485 communication circuit, and when the detection data received by the first RS485 communication circuit and forwarded by the second RS485 communication circuit is not received, determine that the first RS485 communication circuit has a fault.
In addition, the apparatus 400 further comprises: the receiving module is used for receiving a detection instruction and detecting the RS485 communication circuit of the equipment according to the detection instruction; or, the detection module is configured to, when the device communicates with another device, detect the device by using the RS485 communication circuit if data sent by the other device is not received within a preset time.
In addition, the control module 401 is configured to control the first RS485 communication circuit to be disconnected from the other devices in the case that the RS485 communication circuit is detected for the device.
Specifically, the control module 401 is specifically configured to: and switching the first RS485 communication circuit in communication connection with the other equipment to be in communication connection with the second RS485 communication circuit by controlling the switching of the link selector switch.
In addition, the determining module 402 is further configured to determine that the first RS485 communication circuit is normal when the detection data received by the first RS485 communication circuit forwarded by the second RS485 communication circuit is received.
In addition, first RS485 communication circuit is provided with pull-up resistance and pull-down resistance, second RS485 communication circuit is provided with pull-up resistance and pull-down resistance.
In addition, a current limiting resistor is arranged between the first RS485 communication circuit and the controller, and a current limiting resistor is arranged between the second RS485 communication circuit and the controller.
In addition, the second RS485 communication circuit is provided with an impedance matching resistor.
In addition, the first RS485 communication circuit is in communication connection with other equipment through a wiring terminal.
When the detection data received by the first RS485 communication circuit forwarded by the second RS485 communication circuit is not received, the determining module 402 is further configured to: and determining whether a current-limiting resistor between the first RS485 communication circuit and the controller is in fault, if not, determining whether a pull-up resistor and a pull-down resistor of the first RS485 communication circuit are in fault, if not, determining that the first RS485 communication circuit is normal, otherwise, determining that the first RS485 communication circuit is in fault.
In addition, when the first RS485 communication circuit is normal, the determining module 402 is further configured to: and determining whether a control link switch, a pull-up resistor and a pull-down resistor of the second RS485 communication circuit and an impedance matching resistor of the second RS485 communication circuit are in fault, if not, determining whether a current-limiting resistor between the second RS485 communication circuit and the controller is in fault, and if not, determining that the second RS485 communication circuit is in fault.
For the specific implementation of the apparatus 400, reference is made to the aforementioned method, and therefore, the detailed description thereof is omitted here.
It should be understood that the specific order or hierarchy of steps in the processes disclosed is an example of exemplary approaches. Based upon design preferences, it is understood that the specific order or hierarchy of steps in the processes may be rearranged without departing from the scope of the present disclosure. The accompanying method claims present elements of the various steps in a sample order, and are not intended to be limited to the specific order or hierarchy presented.
The foregoing description of the embodiments and specific examples of the invention have been presented for purposes of illustration and description; it is not intended to be the only form in which the embodiments of the invention may be practiced or utilized. The embodiments are intended to cover the features of the various embodiments as well as the method steps and sequences for constructing and operating the embodiments. However, other embodiments may be utilized to achieve the same or equivalent functions and step sequences.
In the foregoing detailed description, various features are grouped together in a single embodiment for the purpose of streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the claimed embodiments of the subject matter require more features than are expressly recited in each claim. Rather, as the following claims reflect, invention lies in less than all features of a single disclosed embodiment. Thus, the following claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. To those skilled in the art; various modifications to these embodiments will be readily apparent, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
What has been described above includes examples of one or more embodiments. It is, of course, not possible to describe every conceivable combination of components or methodologies for purposes of describing the aforementioned embodiments, but one of ordinary skill in the art may recognize that many further combinations and permutations of various embodiments are possible. Accordingly, the embodiments described herein are intended to embrace all such alterations, modifications and variations that fall within the scope of the appended claims. Furthermore, to the extent that the term "includes" is used in either the detailed description or the claims, such term is intended to be inclusive in a manner similar to the term "comprising" as "comprising" is interpreted when employed as a transitional word in a claim. Furthermore, any use of the term "or" in the specification of the claims is intended to mean a "non-exclusive or".
Those of skill in the art will further appreciate that the various illustrative logical blocks, units, and steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate the interchangeability of hardware and software, various illustrative components, elements, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design requirements of the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
The various illustrative logical blocks, or elements, described in connection with the embodiments disclosed herein may be implemented or performed with a general purpose processor, a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. For example, a storage medium may be coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC, which may be located in a user terminal. In the alternative, the processor and the storage medium may reside in different components in a user terminal.
In one or more exemplary designs, the functions described above in connection with the embodiments of the invention may be implemented in hardware, software, firmware, or any combination of the three. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media that facilitate transfer of a computer program from one place to another. Storage media may be any available media that can be accessed by a general purpose or special purpose computer. For example, such computer-readable media can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to carry or store program code in the form of instructions or data structures and which can be read by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Additionally, any connection is properly termed a computer-readable medium, and, thus, is included if the software is transmitted from a website, server, or other remote source via a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wirelessly, e.g., infrared, radio, and microwave. Such discs (disk) and disks (disc) include compact disks, laser disks, optical disks, DVDs, floppy disks and blu-ray disks where disks usually reproduce data magnetically, while disks usually reproduce data optically with lasers. Combinations of the above may also be included in the computer-readable medium.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for detecting a device having an RS485 communication circuit, wherein the device includes a controller, a first RS485 communication circuit connected to the controller, and a second RS485 communication circuit connected to the controller, and wherein the device is communicatively connected to other devices through the first RS485 communication circuit, the method comprising:
under the condition of detecting the RS485 communication circuit of the equipment, controlling the first RS485 communication circuit to be in communication connection with the second RS485 communication circuit, wherein the first RS485 communication circuit is an RS485 communication circuit to be detected;
and sending detection data to the first RS485 communication circuit, and determining that the first RS485 communication circuit has a fault when the detection data received by the first RS485 communication circuit forwarded by the second RS485 communication circuit is not received.
2. The method of claim 1, further comprising:
receiving a detection instruction, and detecting the RS485 communication circuit of the equipment according to the detection instruction; or
And under the condition that the equipment is communicated with other equipment, if the data sent by other equipment is not received within preset time, detecting the equipment by using an RS485 communication circuit.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
and under the condition that the RS485 communication circuit detection is carried out on the equipment, the first RS485 communication circuit is controlled to be disconnected from the other equipment in communication.
4. The method of claim 1, wherein the controlling the first RS485 communication circuit to be communicatively coupled with the second RS485 communication circuit comprises:
and switching the first RS485 communication circuit in communication connection with the other equipment to be in communication connection with the second RS485 communication circuit by controlling the switching of the link selector switch.
5. The method of claim 1, further comprising:
and when the received detection data forwarded by the second RS485 communication circuit and received by the first RS485 communication circuit is received, determining that the first RS485 communication circuit is normal.
6. The method of claim 1, wherein the first RS485 communication circuit is provided with a pull-up resistor and a pull-down resistor, and the second RS485 communication circuit is provided with a pull-up resistor and a pull-down resistor;
a current limiting resistor is arranged between the first RS485 communication circuit and the controller, and a current limiting resistor is arranged between the second RS485 communication circuit and the controller.
7. The method of claim 1, wherein the second RS485 communication circuit is provided with an impedance matching resistor; and the first RS485 communication circuit is in communication connection with other equipment through a wiring terminal.
8. The method of claim 6, wherein when the detection data received by the first RS485 communication circuit forwarded by the second RS485 communication circuit is not received, the method further comprises:
and determining whether a current-limiting resistor between the first RS485 communication circuit and the controller is in fault, if not, determining whether a pull-up resistor and a pull-down resistor of the first RS485 communication circuit are in fault, if not, determining that the first RS485 communication circuit is normal, otherwise, determining that the first RS485 communication circuit is in fault.
9. The method of claim 8, wherein when the first RS485 communication circuit is normal, the method further comprises:
and determining whether a control link switch, a pull-up resistor and a pull-down resistor of the second RS485 communication circuit and an impedance matching resistor of the second RS485 communication circuit are in fault, if not, determining whether a current-limiting resistor between the second RS485 communication circuit and the controller is in fault, and if not, determining that the second RS485 communication circuit is in fault.
10. The utility model provides a carry out detection device to equipment that has RS485 communication circuit, its characterized in that, equipment include the controller, with first RS485 communication circuit that the controller is connected, and with the second RS485 communication circuit that the controller is connected, equipment passes through first RS485 communication circuit carries out communication connection with other equipment, the device includes:
the control module is used for controlling the first RS485 communication circuit to be in communication connection with the second RS485 communication circuit under the condition that the RS485 communication circuit is detected on the equipment, and the first RS485 communication circuit is an RS485 communication circuit to be detected;
and the determining module is used for sending detection data to the first RS485 communication circuit, and when the detection data received by the first RS485 communication circuit forwarded by the second RS485 communication circuit is not received, determining that the first RS485 communication circuit has a fault.
CN202110878956.1A 2021-08-02 2021-08-02 Method and device for detecting equipment with RS485 communication circuit Pending CN115701566A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110878956.1A CN115701566A (en) 2021-08-02 2021-08-02 Method and device for detecting equipment with RS485 communication circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110878956.1A CN115701566A (en) 2021-08-02 2021-08-02 Method and device for detecting equipment with RS485 communication circuit

Publications (1)

Publication Number Publication Date
CN115701566A true CN115701566A (en) 2023-02-10

Family

ID=85142231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110878956.1A Pending CN115701566A (en) 2021-08-02 2021-08-02 Method and device for detecting equipment with RS485 communication circuit

Country Status (1)

Country Link
CN (1) CN115701566A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117806291A (en) * 2024-03-01 2024-04-02 沈阳安飞科技有限公司 Detection method for 3 standby RS485 interfaces in single-chip microcomputer controller
CN117806291B (en) * 2024-03-01 2024-05-14 沈阳安飞科技有限公司 Detection method for 3 standby RS485 interfaces in single-chip microcomputer controller

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117806291A (en) * 2024-03-01 2024-04-02 沈阳安飞科技有限公司 Detection method for 3 standby RS485 interfaces in single-chip microcomputer controller
CN117806291B (en) * 2024-03-01 2024-05-14 沈阳安飞科技有限公司 Detection method for 3 standby RS485 interfaces in single-chip microcomputer controller

Similar Documents

Publication Publication Date Title
US7779266B2 (en) Method for controlling pluggable port on interface board of communication device and interface board
US5680555A (en) Host adapter providing automatic terminator configuration
JP2008546116A (en) Multiprotocol field device interface with automatic bus detection
CN101769976A (en) Connector detection system
CN109240165A (en) A kind of signal output method and device based on I/O interface
CN109217922B (en) Method and device for reporting loss alarm of received signal by optical module
CN107910947B (en) Program-controlled power failure detection and online switching equipment for spacecraft thermal test
WO2014082275A1 (en) Method and apparatus for detecting cable connection condition
JP2582518B2 (en) Data output impedance control
US9602101B2 (en) Integrated device with auto configuration
CN110888053A (en) Relay detection device, detection system and detection method
CN115701566A (en) Method and device for detecting equipment with RS485 communication circuit
CN111929562B (en) Chip test system, test method, test response method of chip and chip
CN108733505A (en) Board information calibration method in place and device
EP4340316A1 (en) Communication link operation characteristic test system and test method
JPH0713880A (en) Method for transmission of information to bus
CN214201615U (en) Input/output device and detection module
CN115391260A (en) PCIe bandwidth configuration device, method, server and readable storage medium
CN216817213U (en) Test circuit and device of wireless networking type input module
CN216052128U (en) Test equipment for testing power supply function of PD equipment
RU2642397C2 (en) Device for monitoring electrical installation
CN109739673A (en) A kind of register write protection method, logic device and communication equipment
CN215814419U (en) Input channel detection circuit of electrical fire monitoring detector
CN217484482U (en) Microampere surge protector leakage current on-line monitoring device
KR102131194B1 (en) Apparatus for detecting fault of ethernet

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