Diagnostic circuit for digital input and output circuits

By designing a diagnostic circuit including a power switch unit, a digital output diagnostic unit and a control unit, the problem of complex and inaccurate diagnosis of digital input and output circuits in the prior art is solved, and accurate diagnosis of digital output load wiring faults is achieved.

CN119171898BActive Publication Date: 2025-05-02ZHEJIANG GUOLI XINAN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411665930.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-05-02
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

In the prior art, the diagnostic circuit of the digital input and output circuit is complex and the diagnostic results are not accurate enough, making it difficult to accurately diagnose wiring faults of the digital output load.

Method used

A diagnostic circuit including a power switch unit, a digital output diagnostic unit and a control unit is designed. The circuit controls the power switch unit to be disconnected or turned on by generating different diagnostic signals above or below the voltage threshold at the positive terminal of the wiring, and determines whether there is a wiring fault in the digital output load.

Benefits of technology

It realizes accurate diagnosis of digital input and output circuits, can effectively identify wiring faults of digital output loads, and improves the accuracy and reliability of diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119171898B_ABST
    Figure CN119171898B_ABST
Patent Text Reader

Abstract

The embodiment of the present disclosure relates to providing a diagnostic circuit for a digital quantity input and output circuit. It includes a power switch unit, one end of which is electrically connected to the positive terminal of the digital quantity input and output circuit, and the other end is electrically connected to the power supply terminal; a digital quantity output diagnostic unit, which is electrically connected to the digital quantity input and output circuit, and is configured to generate a digital quantity output diagnostic signal of a first state when the voltage of the positive terminal of the wiring is greater than or equal to a first voltage threshold, and to generate a digital quantity output diagnostic signal of a second state when the voltage of the positive terminal of the wiring is less than the first voltage threshold; and a control unit, which is configured to control the power switch unit to disconnect, and control the digital quantity input and output circuit to output a digital quantity representing the disconnection state, and determine that there is a wiring fault in response to determining that the digital quantity output diagnostic signal is in the second state. The diagnostic circuit has high accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure generally relate to the field of digital input and output of control systems, and more particularly to a diagnostic circuit for a digital input and output circuit. Background Art

[0002] As industrial automation develops faster and faster, control systems are increasingly used in all walks of life. Some control systems involve digital input and output. The IO (input and output) circuits in the field of industrial control involve DI (digital input) and DO (digital output) circuits. The digital input and output circuits are connected to external loads to transmit digital quantities. If the connection between the digital input and output circuits and the external loads is broken, or if the external loads themselves have a short circuit, it will cause abnormal digital transmission.

[0003] Circuits used to diagnose digital input and output circuits usually have problems such as complex circuits or inaccurate diagnostic results. Summary of the invention

[0004] In view of the above problems, the present disclosure provides a diagnostic circuit for a digital input and output circuit, which can accurately diagnose the existence of a wiring fault in a digital output load of the digital input and output circuit.

[0005] According to the first aspect of the present disclosure, a diagnostic circuit for a digital quantity input and output circuit is provided. The diagnostic circuit includes: a power switch unit, one end of the power switch unit is electrically connected to the positive terminal of the digital quantity input and output circuit, and the other end of the power switch unit is electrically connected to the power supply terminal; a digital quantity output diagnostic unit, electrically connected to the digital quantity input and output circuit, configured to generate a digital quantity output diagnostic signal of a first state when the voltage at the positive terminal of the wiring is greater than or equal to a first voltage threshold, and to generate a digital quantity output diagnostic signal of a second state when the voltage at the positive terminal of the wiring is less than the first voltage threshold; and a control unit, configured to control the power switch unit to disconnect, and control the digital quantity input and output circuit to output a digital quantity representing the disconnection state, and determine that there is a wiring fault in the digital quantity output load of the digital quantity input and output circuit in response to determining that the digital quantity output diagnostic signal is in the second state.

[0006] In some embodiments, the control unit is further configured to: control the power switch unit to turn on in response to determining that there is a wiring fault in the digital output load, determine that a short circuit fault occurs in the digital output load in response to determining that the digital output diagnostic signal continues to maintain the second state, and determine that a wire break occurs between the digital input-output circuit and the digital output load in response to determining that the digital output diagnostic signal is converted to the first state.

[0007] In some embodiments, the diagnostic circuit further includes: a digital input diagnostic unit, electrically connected to the positive terminal of the wiring, configured to generate a digital input diagnostic signal representing a normal state in response to determining that the voltage about the positive terminal of the wiring satisfies a first predetermined condition, and to generate a digital input diagnostic signal representing a fault in response to determining that the voltage about the positive terminal of the wiring does not satisfy the first predetermined condition, the first predetermined condition including: the voltage about the positive terminal of the wiring is greater than the first reference voltage and less than the second reference voltage, the first reference voltage is less than the second reference voltage, and the second reference voltage is less than the power supply terminal voltage.

[0008] In some embodiments, the control unit is further configured to: determine that a wire break fault occurs between the digital input-output circuit and the digital input load in response to determining that the digital input diagnostic signal represents a fault and the input sampling signal from the digital input-output circuit corresponds to a digital quantity representing a disconnected state; and determine that a short circuit fault occurs in the digital input load in response to determining that the digital input diagnostic signal represents a fault and the input sampling signal from the digital input-output circuit corresponds to a digital quantity representing a connected state.

[0009] In some embodiments, the digital input diagnostic unit includes: a first operational amplifier, wherein the non-inverting input terminal of the first operational amplifier is used to receive a second reference voltage, the inverting input terminal of the first operational amplifier is electrically connected to the positive terminal of the wiring, and the output terminal of the first operational amplifier is electrically connected to the output terminal of the second operational amplifier and the input terminal of the first isolation unit; a second operational amplifier, wherein the inverting input terminal of the second operational amplifier is used to receive the first reference voltage, and the non-inverting input terminal of the second operational amplifier is electrically connected to the positive terminal of the wiring; a first pull-up resistor, wherein one end of the first pull-up resistor is electrically connected to the output terminal of the first operational amplifier, and the other end of the first pull-up resistor is electrically connected to the power supply terminal; and a first isolation unit, wherein the output terminal of the first isolation unit is used to output a digital input diagnostic signal.

[0010] In some embodiments, the digital output diagnostic unit includes: a first voltage divider unit, the input end of the first voltage divider unit is electrically connected to the positive end of the wiring; the output end of the first voltage divider unit is electrically connected to the gate of the first MOS tube; the first MOS tube, the source of the first MOS tube is grounded, and the drain of the first MOS tube is electrically connected to the input end of the second isolation unit; and a second isolation unit, the output end of the second isolation unit is used to output a digital output diagnostic signal.

[0011] In some embodiments, the first isolation unit includes: a first photocoupler and a second pull-up resistor, the anode of the first photocoupler serves as the input end of the first isolation unit, the cathode and the emitter of the first photocoupler are grounded, the collector of the first photocoupler is electrically connected to one end of the second pull-up resistor and serves as the output end of the first isolation unit, and the other end of the second pull-up resistor is electrically connected to the power supply end; the second isolation unit includes: a second photocoupler and a third pull-up resistor, the anode of the second photocoupler is electrically connected to the power supply end, the cathode of the second photocoupler serves as the input end of the second isolation unit, the emitter of the second photocoupler is grounded, the collector of the first photocoupler is electrically connected to one end of the third pull-up resistor and serves as the output end of the second isolation unit, and the other end of the third pull-up resistor is electrically connected to the power supply end.

[0012] In some embodiments, the power switch unit includes: a power photocoupler, the anode of the power photocoupler serves as the control end of the power switch unit, the cathode of the power photocoupler is grounded, the emitter of the power photocoupler serves as one end of the power switch unit, and the collector of the power photocoupler serves as the other end of the power switch unit.

[0013] In some embodiments, the diagnostic circuit also includes: a first voltage-dividing resistor, one end of which is grounded, the other end of which is electrically connected to one end of the second voltage-dividing resistor and is used to output a first reference voltage; a second voltage-dividing resistor, the other end of which is electrically connected to a third voltage-dividing resistor and is used to output a second reference voltage; and a third voltage-dividing resistor, the other end of which is electrically connected to the power supply end.

[0014] In some embodiments, the diagnostic circuit further includes: a first current limiting resistor, and one end of the power switch unit is electrically connected to the positive terminal of the connection via the first current limiting resistor.

[0015] The diagnostic circuit includes: a power switch unit, one end of which is electrically connected to the positive terminal of the digital input / output circuit, and the other end of which is electrically connected to the power supply terminal; a digital output diagnostic unit, which is electrically connected to the digital input / output circuit and is configured to generate a digital output diagnostic signal of a first state when the voltage at the positive terminal of the wiring is greater than or equal to a first voltage threshold, and to generate a digital output diagnostic signal of a second state when the voltage at the positive terminal of the wiring is less than the first voltage threshold; and a control unit, which is configured to control the power switch unit to disconnect, and control the digital input / output circuit to output a digital quantity representing the disconnection state, and determine that there is a wiring fault in the digital output load of the digital input / output circuit in response to determining that the digital output diagnostic signal is in the second state. The diagnostic circuit can accurately diagnose whether there is a wiring fault in the digital output load of the digital input / output circuit.

[0016] According to a second aspect of the present disclosure, a digital quantity input-output circuit is provided. The digital quantity input-output circuit comprises: a first resistor, one end of the first resistor is electrically connected to the power supply end, and the other end of the first resistor is electrically connected to one end of a first switch unit; a first switch unit, the other end of the first switch unit is grounded, and the control end of the first switch unit is electrically connected to a control unit; a second switch unit, one end of the second switch unit is electrically connected to one end of a second resistor, the other end of the second switch unit is grounded, and the control end of the second switch unit is electrically connected to the first resistor, and the second switch unit is configured to be turned on in response to the voltage across the first resistor satisfying a predetermined condition; a second resistor, the other end of the second resistor is electrically connected to the power supply end; and a control unit, which is configured to control the first switch unit to be disconnected when the two ends of the first switch unit are electrically connected to the digital input load, so that the digital input-output circuit operates in the digital input mode, and receives the digital quantity from the digital input load via the two ends of the first switch unit, and generates a digital input sampling signal at one end of the second switch unit; and when the two ends of the first switch unit are electrically connected to the digital output load, control the first switch unit to be turned on and off, so that the digital input-output circuit operates in the digital output mode, and outputs the digital quantity to the digital output load via the two ends of the first switch unit.

[0017] In some embodiments, the digital input and output circuit also includes: a power switch unit, one end of the power switch unit is electrically connected to one end of the first resistor, the other end of the power switch unit is electrically connected to the power supply end, and the control end of the power switch unit is electrically connected to the control unit; the control unit is also configured to: control the power switch unit to be turned on in response to determining that the working mode of the digital input and output circuit is a digital input mode and a power distribution digital output mode; and control the power switch unit to be turned off in response to determining that the working mode of the digital input and output circuit is a non-power distribution digital output mode.

[0018] In some embodiments, the digital input-output circuit also includes: a digital input diagnostic unit, electrically connected to one end of the first switch unit, configured to generate a digital input diagnostic signal representing a normal state in response to determining that the voltage at one end of the first switch unit satisfies a first predetermined condition, and to generate a digital input diagnostic signal representing a fault in response to determining that the voltage at one end of the first switch unit does not satisfy the first predetermined condition, the first predetermined condition including: the voltage at one end of the first switch unit is greater than a first reference voltage and less than a second reference voltage, the first reference voltage is less than the second reference voltage, and the second reference voltage is less than the power supply terminal voltage.

[0019] In some embodiments, the digital input diagnostic unit includes: a first operational amplifier, wherein the non-inverting input terminal of the first operational amplifier is used to receive a second reference voltage, the inverting input terminal of the first operational amplifier is electrically connected to one end of the first switch unit, and the output terminal of the first operational amplifier is electrically connected to the output terminal of the second operational amplifier and the input terminal of the first isolation unit; a second operational amplifier, wherein the inverting input terminal of the second operational amplifier is used to receive the first reference voltage, and the non-inverting input terminal of the second operational amplifier is electrically connected to one end of the first switch unit; a third resistor, wherein one end of the third resistor is electrically connected to the output terminal of the first operational amplifier, and the other end of the third resistor is electrically connected to the power supply terminal; and a first isolation unit, wherein the output terminal of the first isolation unit is used to output a digital input diagnostic signal.

[0020] In some embodiments, the digital quantity input and output circuit also includes: a digital quantity output diagnostic unit, the digital quantity output diagnostic unit includes: a first voltage divider unit, the input end of the first voltage divider unit is electrically connected to one end of the first switch unit; the output end of the first voltage divider unit is electrically connected to the gate of the first MOS tube; the first MOS tube, the source of the first MOS tube is grounded, and the drain of the first MOS tube is electrically connected to the input end of the second isolation unit; and a second isolation unit, the output end of the second isolation unit is used to output a digital quantity output diagnostic signal.

[0021] In some embodiments, the control unit is further configured to: switch the power switch unit off / on state in response to determining that the state of the digital output diagnostic signal represents a fault, and determine that a short circuit fault exists in the digital output load in response to determining that the state of the digital output diagnostic signal changes before and after switching, and determine that a line break exists in the digital output load in response to determining that the state of the digital output diagnostic signal does not change before and after switching.

[0022] In some embodiments, in response to determining that the digital input diagnostic signal represents a fault and the input sampling signal from the digital input-output circuit corresponds to a digital quantity representing a disconnected state, it is determined that a wire break fault occurs between the digital input-output circuit and the digital output load; and in response to determining that the digital input diagnostic signal represents a fault and the input sampling signal from the digital input-output circuit corresponds to a digital quantity representing a connected state, it is determined that a short circuit fault occurs in the digital output load.

[0023] In some embodiments, the first isolation unit includes: a first photocoupler, the anode of the first photocoupler serves as the input end of the first isolation unit, the cathode and the emitter of the first photocoupler are grounded, the collector of the first photocoupler is electrically connected to one end of the fourth resistor and serves as the output end of the first isolation unit; and a fourth resistor, the other end of the fourth resistor is electrically connected to the power supply end; the second isolation unit includes: a second photocoupler, the anode of the second photocoupler is electrically connected to the power supply end, the cathode of the second photocoupler serves as the input end of the second isolation unit, the emitter of the second photocoupler is grounded, the collector of the first photocoupler is electrically connected to one end of the fifth resistor and serves as the output end of the second isolation unit; and a fifth resistor, the other end of the fifth resistor is electrically connected to the power supply end.

[0024] In some embodiments, the digital quantity input and output circuit also includes: the first switch unit includes: a second MOS tube, the gate of the second MOS tube serves as the control end of the first switch unit, the source of the second MOS tube serves as the other end of the first switch unit, and the drain of the second MOS tube serves as one end of the first switch unit; the second switch unit includes: a third photoelectric coupler, the anode of the third photoelectric coupler is electrically connected to one end of the first resistor, the cathode of the third photoelectric coupler is electrically connected to the other end of the first resistor, the emitter of the third photoelectric coupler is grounded, and the collector of the third photoelectric coupler serves as one end of the second switch unit; the power switch unit includes: a fourth photoelectric coupler, the anode of the fourth photoelectric coupler serves as the control end of the power switch unit, the cathode of the fourth photoelectric coupler is grounded, the emitter of the fourth photoelectric coupler serves as one end of the power switch unit, and the collector of the fourth photoelectric coupler serves as the other end of the power switch unit.

[0025] In some embodiments, the digital quantity input-output circuit also includes: a Zener diode, an anode of the Zener diode is electrically connected to one end of the first resistor, and a cathode of the Zener diode is electrically connected to one end of the power switch unit; and a first diode, an anode of the first diode is electrically connected to the other end of the first switch unit, and a cathode of the first diode is grounded.

[0026] In some embodiments, the digital input and output circuit also includes: a sixth resistor, one end of the sixth resistor is grounded, the other end of the sixth resistor is electrically connected to one end of the seventh resistor, and is used to output a first reference voltage; a seventh resistor, the other end of the seventh resistor is electrically connected to the eighth resistor, and is used to output a second reference voltage; and an eighth resistor, the other end of the eighth resistor is electrically connected to the power supply end.

[0027] The digital quantity input and output circuit comprises: a first resistor, a first switch unit, a second switch unit, a second resistor and a control unit, wherein one end of the first resistor is electrically connected to a power supply end, and the other end of the first resistor is electrically connected to one end of the first switch unit; the other end of the first switch unit is grounded, and the control end of the first switch unit is electrically connected to the control unit; one end of the second switch unit is electrically connected to one end of the second resistor, the other end of the second switch unit is grounded, and the control end of the second switch unit is electrically connected to the first resistor, and the second switch unit is configured to be turned on in response to the voltage across the first resistor satisfying a predetermined condition; the other end of the second resistor is connected to the The first switch unit is electrically connected to the power supply end; when the two ends of the first switch unit are electrically connected to the digital input load, the first switch unit is controlled to be disconnected, so that the digital input-output circuit works in the digital input mode, and receives the digital quantity from the digital input load through the two ends of the first switch unit, and generates a digital input sampling signal at one end of the second switch unit; and when the two ends of the first switch unit are electrically connected to the digital output load, the first switch unit is controlled to be turned on and off, so that the digital input-output circuit works in the digital output mode, and outputs the digital quantity to the digital output load through the two ends of the first switch unit. Therefore, the digital input-output circuit is compatible with digital input and digital output functions.

[0028] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements.

[0030] Figure 1 A structural schematic diagram of a digital quantity input and output circuit according to an embodiment of the present disclosure is shown.

[0031] Figure 2 An equivalent circuit diagram of a digital input load connected to a digital input-output circuit according to an embodiment of the present disclosure is shown.

[0032] Figure 3 An equivalent circuit diagram of a digital output load connected to a digital input-output circuit according to an embodiment of the present disclosure is shown.

[0033] Figure 4 The equivalent circuit diagram of the digital input-output circuit in the embodiment of the present disclosure in the digital input mode is shown.

[0034] Figure 5A schematic diagram showing a first state of a digital quantity input-output circuit in a digital quantity input mode according to an embodiment of the present disclosure is shown.

[0035] Figure 6 A schematic diagram showing a second state of a digital quantity input-output circuit in a digital quantity input mode according to an embodiment of the present disclosure is shown.

[0036] Figure 7 The figure shows an equivalent circuit diagram of a digital quantity input-output circuit in a digital quantity output mode according to an embodiment of the present disclosure.

[0037] Figure 8 A schematic diagram showing a digital quantity input-output circuit according to an embodiment of the present disclosure in a first state of a power distribution digital quantity output mode is shown.

[0038] Fig. 9 A schematic diagram showing a digital quantity input-output circuit according to an embodiment of the present disclosure in a second state of a power distribution digital quantity output mode is shown.

[0039] Fig.10 A schematic diagram showing a first state of a digital quantity input-output circuit in a non-power distribution digital quantity output mode according to an embodiment of the present disclosure is shown.

[0040] Fig.11 A schematic diagram showing a second state of the digital quantity input-output circuit of an embodiment of the present disclosure in a non-power distribution digital quantity output mode.

[0041] Fig.12 A schematic diagram of a digital input and output circuit according to an embodiment of the present disclosure is shown.

[0042] Fig.13 A schematic diagram of a diagnostic circuit for a digital input and output circuit according to an embodiment of the present disclosure is shown.

[0043] Fig.14 The equivalent circuit diagram of the digital input-output circuit in the embodiment of the present disclosure in the digital input mode is shown.

[0044] Fig.15 A schematic diagram showing a first state of a digital quantity input-output circuit in a digital quantity input mode according to an embodiment of the present disclosure is shown.

[0045] Fig.16 A schematic diagram showing a second state of a digital quantity input-output circuit in a digital quantity input mode according to an embodiment of the present disclosure is shown.

[0046] Fig.17 A schematic diagram showing a first fault occurring in a digital quantity input-output circuit of an embodiment of the present disclosure in a digital quantity input mode.

[0047] Fig.18 A schematic diagram showing a second fault occurring when the digital input-output circuit of an embodiment of the present disclosure is in a digital input mode.

[0048] Fig.19 The figure shows an equivalent circuit diagram of a digital quantity input-output circuit in a digital quantity output mode according to an embodiment of the present disclosure.

[0049] Fig. 20 A schematic diagram showing a digital quantity input-output circuit according to an embodiment of the present disclosure in a first state of a power distribution digital quantity output mode is shown.

[0050] Fig.21 A schematic diagram showing a digital quantity input-output circuit according to an embodiment of the present disclosure in a second state of a power distribution digital quantity output mode is shown.

[0051] Fig. 22 An equivalent circuit diagram of a digital quantity input and output circuit in a non-power distribution digital quantity output mode according to an embodiment of the present disclosure is shown.

[0052] Fig.23 A schematic diagram showing a first state of a digital quantity input-output circuit in a non-power distribution digital quantity output mode according to an embodiment of the present disclosure is shown.

[0053] Fig.24 A schematic diagram showing a second state of the digital quantity input-output circuit of an embodiment of the present disclosure in a non-power distribution digital quantity output mode.

[0054] Fig.25 A schematic diagram showing fault diagnosis of a digital quantity output mode performed by a digital quantity input and output circuit according to an embodiment of the present disclosure is shown.

[0055] Fig.26 A schematic diagram showing fault diagnosis of a digital quantity output mode performed by a digital quantity input and output circuit according to an embodiment of the present disclosure is shown.

[0056] Fig. 27 A schematic diagram showing fault diagnosis of a digital quantity output mode performed by a digital quantity input and output circuit according to an embodiment of the present disclosure is shown.

[0057] Fig.28 A schematic diagram showing fault diagnosis of a digital quantity output mode performed by a digital quantity input and output circuit according to an embodiment of the present disclosure is shown.

[0058] Fig.29 A schematic diagram of a diagnostic circuit for a digital input and output circuit according to an embodiment of the present disclosure is shown.

[0059] Fig.30 The figure shows an equivalent circuit diagram of the diagnostic circuit of the embodiment of the present disclosure performing digital output diagnosis.

[0060] Fig.31 The figure shows an equivalent circuit diagram of the diagnostic circuit of the embodiment of the present disclosure performing digital output diagnosis.

[0061] Fig.32 The figure shows an equivalent circuit diagram of the diagnostic circuit of the embodiment of the present disclosure performing digital output diagnosis.

[0062] Fig.33 The figure shows an equivalent circuit diagram of the diagnostic circuit of the embodiment of the present disclosure performing digital output diagnosis.

[0063] Fig.34 The figure shows an equivalent circuit diagram of the diagnostic circuit of the embodiment of the present disclosure performing digital output diagnosis. DETAILED DESCRIPTION

[0064] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0065] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based at least in part on". The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0066] As described above, the IO (input and output) circuit in the field of industrial control involves DI (digital input) and DO (digital output) circuits. The digital input and output circuit is connected to an external load to transmit digital quantities. It should be understood that the external load connected to the digital input and output circuit is an external load about the digital input and output circuit. When the digital input and output circuit is in digital output mode, the connected external load is a digital output load; when the digital input and output circuit is in digital input mode, the connected external load is a digital input load. If the connection between the digital input and output circuit and the external load is broken, or the external load itself has a short circuit fault, the external load has a wiring fault, and these faults will cause abnormal digital transmission. Circuits for diagnosing digital input and output circuits usually have problems such as complex circuits or inaccurate diagnostic results.

[0067] In order to at least partially solve one or more of the above problems and other potential problems, an example embodiment of the present disclosure proposes a diagnostic circuit for a digital input-output circuit. The diagnostic circuit includes: a power switch unit, one end of the power switch unit is electrically connected to the positive terminal of the digital input-output circuit, and the other end of the power switch unit is electrically connected to the power supply terminal; a digital output diagnostic unit, electrically connected to the digital input-output circuit, configured to generate a digital output diagnostic signal of a first state when the voltage at the positive terminal of the wiring is greater than or equal to a first voltage threshold, and to generate a digital output diagnostic signal of a second state when the voltage at the positive terminal of the wiring is less than the first voltage threshold; and a control unit, configured to control the power switch unit to disconnect, and control the digital input-output circuit to output a digital quantity representing the disconnection state, and determine that there is a wiring fault in the digital output load of the digital input-output circuit in response to determining that the digital output diagnostic signal is in the second state. The diagnostic circuit can accurately diagnose whether there is a wiring fault in the digital output load of the digital input-output circuit.

[0068] Figure 1 A schematic structural diagram of a digital quantity input-output circuit 100 according to an embodiment of the present disclosure is shown. Figure 2 An equivalent circuit diagram of a digital input load RLI connected to the digital input-output circuit 100 according to an embodiment of the present disclosure is shown. Figure 3 FIG. 1 is an equivalent circuit diagram of a digital output load RLO connected to the digital input-output circuit 100 according to an embodiment of the present disclosure. Fig.13 A schematic diagram of a diagnostic circuit 400 for a digital input / output circuit according to an embodiment of the present disclosure is shown.

[0069] The diagnostic circuit 400 includes a power switch unit 108 and a digital output diagnostic unit 404 . In some embodiments, the diagnostic circuit 400 further includes a control unit 106 . In some embodiments, the diagnostic circuit 400 further includes a digital input diagnostic unit 402 .

[0070] One end of the power switch unit 108 is electrically connected to the positive terminal (e.g., the first terminal P1) of the digital input-output circuit 100, and the other end of the power switch unit 108 is electrically connected to the power supply terminal VDD. The digital output diagnostic unit 404 is electrically connected to the digital input-output circuit 100, and is configured to generate a digital output diagnostic signal of a first state when the voltage of the positive terminal of the wiring is greater than or equal to the first voltage threshold, and to generate a digital output diagnostic signal of a second state when the voltage of the positive terminal of the wiring is less than the first voltage threshold. The control unit 106 is configured to control the power switch unit 108 to be disconnected, and to control the digital input-output circuit 100 to output a digital quantity representing the disconnected state, and to determine that there is a wiring fault with respect to the digital output load RLO of the digital input-output circuit 100 in response to determining that the digital output diagnostic signal is in the second state.

[0071] The equivalent circuit of the digital input load RLI includes, for example, a seventeenth resistor R17, an eighteenth resistor R18, and a dry contact 202. In some embodiments, the digital input load RLI may not include the seventeenth resistor R17 and the eighteenth resistor R18. In this case, the digital input load RLI may be external to the digital input load RLI according to Figure 2 The seventeenth resistor R17 and the eighteenth resistor R18 are configured. Taking the voltage of the power supply terminal VDD as 24V (volt) as an example, the resistance value of the seventeenth resistor R17 is, for example, 1KΩ (kilo-ohm), and the resistance value of the eighteenth resistor R18 is, for example, 10KΩ.

[0072] The equivalent circuit of the digital output load RLO includes, for example, a DC power supply 204 and a load device 206, which are connected in series, for example, wherein the DC power supply 204 is, for example, 24 V. The load device 206 includes, for example, a driven solenoid valve.

[0073] The digital quantity input and output circuit 100 includes a first resistor R1, a first switch unit 102, a second switch unit 104, a second resistor R2, and a control unit 106. One end of the first resistor R1 is electrically connected to the power supply terminal VDD, and the other end of the first resistor R1 is electrically connected to one end of the first switch unit 102. The other end of the first switch unit 102 is grounded GND, and the control end of the first switch unit 102 is electrically connected to the control unit 106 to receive a first control signal DO_ctl from the control unit 106. One end of the second switch unit 104 is electrically connected to one end of the second resistor R2, and the other end of the second switch unit 106 is grounded. The control end of the second switch unit 106 is electrically connected to the first resistor R1, and the second switch unit 106 is configured to be turned on in response to the voltage across the first resistor R1 meeting a predetermined condition. The other end of the second resistor R2 is electrically connected to the power supply terminal VDD. It should be understood that the second resistor R2 is a pull-up resistor.

[0074] One end of the first switch unit 102 is configured as a first terminal P1, and the other end of the first switch unit 102 is configured as a second terminal P2. The two ends of the first switch unit 102 (e.g., the first terminal P1 and the second terminal P2) are used to connect to a digital input load or a digital output load. When the two ends of the first switch unit 102 are connected to the digital input load, one end of the first switch unit 102 (e.g., the first terminal P1) is configured as a digital input positive terminal (DI+), and the other end of the first switch unit 102 (e.g., the second terminal P2) is configured as a digital input negative terminal (DI-). When the two ends of the first switch unit 102 are connected to a digital output load, one end of the first switch unit 102 (e.g., the first terminal P1) is configured as a digital output positive terminal (DO+), and the other end of the first switch unit 102 (e.g., the second terminal P2) is configured as a digital output negative terminal (DO-).

[0075] The control unit 106 can be implemented based on MCU (microprocessing unit), CPU (central processing unit), FPGA (field programmable gate array), PLC, etc. When the two ends of the first switch unit 102 are electrically connected to the digital quantity input load, the control unit 106 controls the first switch unit 102 to be disconnected, so that the digital quantity input and output circuit 100 works in the digital quantity input mode, and receives the digital quantity from the digital quantity input load through the two ends of the first switch unit 102, and generates a digital quantity input sampling signal DI_sampling at one end of the second switch unit 104. When the two ends of the first switch unit 102 are electrically connected to the digital quantity output load, the control unit 106 controls the first switch unit 102 to be turned on and off to generate a digital quantity, so that the digital quantity input and output circuit 100 works in the digital quantity output mode, and outputs the digital quantity to the digital quantity output load through the two ends of the first switch unit 102. The control unit 106 can be electrically connected to the first switch unit 102 via an isolation device (such as a photocoupler) to output the first control signal DO_ctl to the first switch unit 102.

[0076] In some embodiments, the first switch unit includes a second MOS tube Q2, the gate of the second MOS tube serves as the control end of the first switch unit 102, the source of the second MOS tube Q2 serves as the other end of the first switch unit 102, and the drain of the second MOS tube Q2 serves as one end of the first switch unit 102.

[0077] In some embodiments, the second switch unit 104 includes a third photocoupler U6, an anode of the third photocoupler U6 is electrically connected to one end of the first resistor R1, a cathode of the third photocoupler U6 is electrically connected to the other end of the first resistor R1, an emitter of the third photocoupler U6 is grounded GND, and a collector of the third photocoupler U6 serves as one end of the second switch unit 104 for outputting the generated digital input sampling signal DI_sampling.

[0078] In some embodiments, one end of the first resistor R1 is directly connected to the power supply terminal VDD. In some embodiments, one end of the first resistor R1 is connected to the power supply terminal VDD via a Zener diode Z1. The anode of the Zener diode Z1 is electrically connected to one end of the first resistor R1, and the cathode of the Zener diode is electrically connected to the power supply terminal VDD.

[0079] In some embodiments, the digital quantity input and output circuit 100 further includes a power switch unit 108. One end of the power switch unit 108 is electrically connected to one end of the first resistor R1, the other end of the power switch unit 108 is electrically connected to the power supply terminal VDD, and the control end of the power switch unit 108 is electrically connected to the control unit 106 so as to receive the second control signal Power_ctl from the control unit 106. That is, one end of the first resistor R1 is electrically connected to the power supply terminal VDD via the power switch unit 108. Accordingly, if the control unit 106 determines that the working mode of the digital quantity input and output circuit 100 is the digital quantity input mode or the power distribution digital quantity output mode, the control unit 106 controls the power switch unit 108 to be turned on. The control unit 106 is electrically connected to the control end of the power switch unit 108, for example, via the fifteenth resistor R15.

[0080] That is, when both ends of the first switch unit 102 are connected to the digital input load, the working mode of the digital input and output circuit 100 is the digital input mode, and the control unit 106 controls the power switch unit 108 to be turned on, so that one end of the first resistor R1 is connected to the power supply terminal VDD.

[0081] When both ends of the first switch unit 102 are connected to the digital output load, the working mode of the digital input and output circuit 100 is the digital output mode. If the digital output load needs power distribution (i.e., powered by the digital input and output circuit 100), the working mode of the digital input and output circuit 100 is the power distribution digital output mode. The control unit 106 controls the power switch unit 108 to turn on, so that one end of the first resistor R1 is connected to the power supply terminal VDD, so as to power the digital output load.

[0082] When both ends of the first switch unit 102 are connected to the digital output load, the working mode of the digital input-output circuit 100 is the digital output mode. If the digital output load does not require power distribution (i.e., does not require power supply from the digital input-output circuit 100), the working mode of the digital input-output circuit 100 is the non-power distribution digital output mode. The control unit 106 controls the power switch unit 108 to be disconnected, so that one end of the first resistor R1 is disconnected from the power supply terminal VDD.

[0083] The power switch unit 108 includes, for example, a fourth photocoupler U5, an anode of the fourth photocoupler U5 serving as a control terminal of the power switch unit, a cathode of the fourth photocoupler U5 being grounded, an emitter of the fourth photocoupler U5 serving as one terminal of the power switch unit, and a collector of the fourth photocoupler U5 serving as the other terminal of the power switch unit. The fourth photocoupler U5 is used to connect or disconnect the connection with the power terminal VDD, and is, for example, called a power photocoupler.

[0084] It is worth noting that, in some embodiments, the digital input and output circuit 100 may further include at least one of a ninth resistor R9 and a tenth resistor R10. The resistance values ​​of the ninth resistor R9 and the tenth resistor R10 may be reasonably set according to the resistance values ​​of the seventeenth resistor R17 and the eighteenth resistor R18 included in the equivalent circuit of the digital input load RLI. In some embodiments, the resistance value of the ninth resistor R9 is, for example, 2 KΩ, and the resistance value of the tenth resistor R10 is, for example, 2.7 KΩ. The resistance value of the first resistor R1 is, for example, 500 Ω. The resistance value of the second resistor R2 is, for example, 2.7 KΩ, and the resistance value of the fifteenth resistor R15 is, for example, 2.7 KΩ. The stable voltage of the Zener diode Z1 is, for example, 5.1 V. The forward voltage drop of the first diode D1 is, for example, not greater than 0.7 V. The turn-on threshold (Vgs) of the first MOS tube and the second MOS switch is, for example, greater than 1 V and less than 2.5 V. The conduction voltage drop of the light emitting diode in the third photocoupler U6 (and other photocouplers involved in the embodiment of the present disclosure) is, for example, greater than 1 V and less than 1.4 V. It should be understood that the above are only examples of parameters of the devices in the digital input and output circuit 100, and are not the only values. The above parameters can be reasonably set according to specific circumstances.

[0085] Figure 4The equivalent circuit diagram of the digital quantity input-output circuit 100 in the digital quantity input mode of the embodiment of the present disclosure is shown. When the two ends of the first switch unit 102 are connected to the digital quantity input load, the working mode of the digital quantity input-output circuit 100 is the digital quantity input mode, and the control unit 106 outputs the second control signal Power_ctl in a high level state, for example, to control the power switch unit 108 to be turned on, so that one end of the first resistor R1 is connected to the power supply terminal VDD. The control unit 106 outputs the first control signal DO_ctl in a low level state, for example, to make the second MOS tube Q2 in a cut-off state. It should be understood that the digital quantity input load RLI generates a corresponding digital quantity through the closing and opening of its dry contact, and the digital quantity input-output circuit 100 receives the digital quantity through the first terminal P1 and the second terminal P2.

[0086] Figure 5 A schematic diagram showing a digital quantity input-output circuit 100 in a first state of a digital quantity input mode according to an embodiment of the present disclosure is shown. In the first state, the dry contact 202 in the digital quantity input load RLI is in an open state. At this time, the voltage across the first resistor R1 does not meet a predetermined condition, for example, the voltage across the first resistor R1 is lower than a predetermined threshold voltage, which is insufficient to turn on the second switch unit 104.

[0087] For example, the voltage across the first resistor R1 is 510 / (510+2.7K+2K+1K+10K)*(24-5.1)=0.59V, which is less than the lowest conduction voltage of the light emitting diode of the third photocoupler U6, 1V. Therefore, the second switch unit 104 is in the off state. Thus, the second switch unit 104 outputs the digital quantity sampling signal DI_sampling in the high level state (for example, DI_sampling=1).

[0088] It should be understood that when the ninth resistor R9 is not provided, the voltage across the first resistor R1 is 510 / (510+2.7K+1K+10K)*(24-5.1)=0.68V, which is less than the lowest on-state voltage of the light emitting diode of the third photocoupler U6, 1V. When the ninth resistor R9 is not provided, the voltage at one end of the first switch unit is the voltage at one end of the first switch unit, which is, for example, (1K+10K) / (510+2.7K+1K+10K)*(24-5.1)=14.6V.

[0089] Figure 6The schematic diagram shows a digital quantity input-output circuit 100 in a second state of a digital quantity input mode according to an embodiment of the present disclosure. In the second state, the dry contact 202 in the digital quantity input load RLI is in a closed state. At this time, the voltage across the first resistor R1 satisfies a predetermined condition, for example, the voltage across the first resistor R1 is equal to or higher than a predetermined threshold voltage, so that the second switch unit 104 is turned on.

[0090] For example, the voltage across the first resistor R1 is 510 / (510+2.7K+2K+1K)*(24-5.1)=1.55V, which is greater than the maximum on-state voltage of the light-emitting diode of the third photocoupler U6, 1.4V. Therefore, the second switch unit 104 is in a closed state. Thus, the second switch unit 104 outputs a low-level digital sampling signal DI_sampling (for example, DI_sampling=0).

[0091] Therefore, when the digital input load RLI is normally connected, in both the open and closed states of the dry contact, the digital input-output circuit 100 can normally implement the sampling function of the digital quantity generated by the digital input load RLI. When the dry contact is open, DI_sampling=1, and when it is closed, DI_sampling=0.

[0092] Figure 7 The equivalent circuit diagram of the digital input-output circuit 100 in the embodiment of the present disclosure in the digital output mode is shown. When the two ends of the first switch unit 102 are connected to the digital output load, the working mode of the digital input-output circuit 100 is the digital output mode.

[0093] If the digital output load needs power distribution (i.e., powered by the digital input and output circuit 100), the working mode of the digital input and output circuit 100 is the power distribution digital output mode. The control unit 106 controls the power switch unit 108 to be turned on, so that one end of the first resistor R1 is connected to the power supply terminal VDD to power the digital output load.

[0094] Figure 8 A schematic diagram of a digital quantity input-output circuit 100 in a first state of a power distribution digital quantity output mode according to an embodiment of the present disclosure is shown. The first state is that the digital quantity input-output circuit 100 outputs a digital quantity representing a disconnected (OFF) state. At this time, the control unit 106 controls the first switch unit 102 to disconnect. For example, the control unit 106 generates a first control signal DO_ctl in a low level state, so that the second MOS tube is in a cut-off state, and the digital quantity input-output circuit 100 outputs a digital quantity representing a disconnected (OFF) state to the digital quantity output load RLO through the first terminal P1 and the second terminal P2.

[0095] Fig. 9 A schematic diagram showing a second state of the digital quantity input-output circuit 100 in the power distribution digital quantity output mode according to an embodiment of the present disclosure is shown. The second state is that the digital quantity input-output circuit 100 outputs a digital quantity representing the on state. At this time, the control unit 106 controls the first switch unit 102 to be turned on. For example, the control unit 106 generates a first control signal DO_ctl in a high level state, so that the second MOS tube is in the on state, and the digital quantity input-output circuit 100 outputs a digital quantity representing the on state to the digital quantity output load RLO through the first terminal P1 and the second terminal P2.

[0096] If the digital output load does not require power distribution (i.e., does not require power supply from the digital input / output circuit 100), the operation mode of the digital input / output circuit 100 is a non-power distribution digital output mode. The control unit 106 controls the power switch unit 108 to disconnect, so that one end of the first resistor R1 is disconnected from the power supply terminal VDD.

[0097] Fig.10 A schematic diagram of a digital quantity input-output circuit 100 in a first state of a non-power distribution digital quantity output mode according to an embodiment of the present disclosure is shown. The first state is that the digital quantity input-output circuit 100 outputs a digital quantity representing a disconnection (OFF) state. At this time, the control unit 106 controls the first switch unit 102 to disconnect. For example, the control unit 106 generates a first control signal DO_ctl in a low level state, so that the second MOS tube is in a cut-off state, and the digital quantity input-output circuit 100 outputs a digital quantity representing a disconnection (OFF) state to the digital quantity output load RLO through the first terminal P1 and the second terminal P2.

[0098] Fig.11 A schematic diagram of a digital quantity input-output circuit 100 in a second state of a non-power distribution digital quantity output mode according to an embodiment of the present disclosure is shown. The second state is that the digital quantity input-output circuit 100 outputs a digital quantity representing an ON state. At this time, the control unit 106 controls the first switch unit 102 to be turned on. For example, the control unit 106 generates a first control signal DO_ctl in a high level state, so that the second MOS tube is in an ON state, and the digital quantity input-output circuit 100 outputs a digital quantity representing an ON state to the digital quantity output load RLO through the first terminal P1 and the second terminal P2.

[0099] Fig.12 FIG. 3 is a schematic diagram of a digital quantity input-output circuit 300 according to an embodiment of the present disclosure. Based on the digital quantity input-output circuit 100 , the digital quantity input-output circuit 300 further includes a diagnostic circuit 400 for the digital quantity input-output circuit.

[0100] Fig.13 A schematic diagram of a diagnostic circuit 400 for a digital input-output circuit according to an embodiment of the present disclosure is shown. The diagnostic circuit 400 includes a digital input diagnostic unit 402 and a digital output diagnostic unit 404. The digital input diagnostic unit 402 is used to diagnose when the digital input-output circuit 300 is in a digital input mode, so as to determine whether the digital input load RLI has a short circuit fault or a disconnection fault. It should be understood that the short circuit fault of the digital input load RLI means that the digital input load RLI is short-circuited internally, and the disconnection fault of the digital input load RLI means that the digital input load RLI is disconnected from the digital input-output circuit 300. The digital output diagnostic unit 404 is used to diagnose when the digital input-output circuit 300 is in a digital output mode, so as to determine whether the digital input load RLI has a short circuit fault or a disconnection fault. The diagnostic circuit 400 performs diagnosis by electrically connecting the first detection terminal T1 to one end of the first switch unit 102 (e.g., the first wiring terminal P1) and the second detection terminal T2 to the other end of the first switch unit 102 (e.g., the second wiring terminal P2). In some embodiments, the diagnostic circuit 400 is directly connected to one end of the first switch unit 102 (e.g., the first wiring terminal P1) through the first detection terminal T1 and the second detection terminal T2 is directly connected to the other end of the first switch unit 102 (e.g., the second wiring terminal P2). In some embodiments, the diagnostic circuit 400 is electrically connected to one end of the first switch unit 102 (e.g., the first wiring terminal P1) through the ninth resistor R9.

[0101] The digital input diagnostic unit 402 is electrically connected to the digital input positive terminal (DI+, such as one terminal of the first switch unit 102, i.e., the first wiring terminal P1) of the digital input output circuit 300 based on the first detection terminal T1, and is electrically connected to the digital input negative terminal (DI-, such as the other terminal of the first switch unit 102, i.e., the second wiring terminal P2) of the digital input output circuit 300 based on the second detection terminal T2 for diagnosis. If the digital input diagnostic unit 402 determines that the voltage on the digital input positive terminal (i.e., the voltage on one terminal of the first switch unit) satisfies the first predetermined condition, a digital input diagnostic signal DI_diag indicating normality is generated. If the digital input diagnostic unit 402 determines that the voltage at one end of the first switch unit does not satisfy the first predetermined condition, a digital input diagnostic signal DI_diag representing a fault is generated, and the first predetermined condition includes: the voltage at one end of the first switch unit 102 is greater than the first reference voltage Vref1 and less than the second reference voltage Vref2, the first reference voltage Vref1 is less than the second reference voltage Vref2, and the second reference voltage Vref2 is less than the power supply terminal VDD voltage.

[0102] In some embodiments, the first reference voltage Vref1 and the second reference voltage Vref2 are obtained by, for example, voltage division based on the power supply terminal VDD voltage. For example, the digital input and output circuit 300 also includes a sixth resistor R6, a seventh resistor R7, and an eighth resistor R8. One end of the sixth resistor R6 is grounded GND, and the other end of the sixth resistor R6 is electrically connected to one end of the seventh resistor R7, and is used to output the first reference voltage Vref1; the other end of the seventh resistor R7 is electrically connected to the eighth resistor R8, and is used to output the second reference voltage Vref2; the other end of the eighth resistor R8 is electrically connected to the power supply terminal VDD. It should be understood that the sixth resistor R6, the seventh resistor R7, and the eighth resistor R8 can be reasonably set according to the first reference voltage Vref1 and the second reference voltage Vref2 to be generated. In some embodiments, the resistance values ​​of the sixth resistor R6, the seventh resistor R7, and the eighth resistor R8 are, for example, all 2.7KΩ, and the power supply terminal VDD voltage is 24V. Accordingly, the first reference voltage Vref1 is 8V and the second reference voltage Vref2 is 16V. The sixth resistor R6 is, for example, used as a first voltage-dividing resistor, the seventh resistor R7 is, for example, used as a second voltage-dividing resistor, and the eighth resistor R8 is, for example, used as a third voltage-dividing resistor.

[0103] In some embodiments, the digital input diagnostic unit 402 includes: a first operational amplifier U3, a second operational amplifier U4, a third resistor R3, and a first isolation unit U1. The non-inverting input terminal of the first operational amplifier U3 is used to receive the second reference voltage Vref2, the inverting input terminal of the first operational amplifier U3 is electrically connected to one end of the first switch unit 102 (i.e., the digital input positive terminal of the digital input and output circuit 300, i.e., the wiring positive terminal of the digital input and output circuit 300), and the output terminal of the first operational amplifier U3 is electrically connected to the output terminal of the second operational amplifier U4 and the input terminal of the first isolation unit; the inverting input terminal of the second operational amplifier U4 is used to receive the first reference voltage Vref1, and the non-inverting input terminal of the second operational amplifier U4 is electrically connected to one end of the first switch unit 102 (i.e., the digital input positive terminal of the digital input and output circuit 300); one end of the third resistor R3 is electrically connected to the output terminal of the first operational amplifier U3, and the other end of the third resistor R3 is electrically connected to the power supply terminal VDD; the output terminal of the first isolation unit is used to output the digital input diagnostic signal DI_diag.

[0104] The first isolation unit, for example, includes a first photocoupler U1 and a fourth resistor R4, wherein the anode of the first photocoupler U1 is connected to the input end of the first isolation unit, the cathode and emitter of the first photocoupler U1 are grounded, the collector of the first photocoupler U1 is electrically connected to one end of the fourth resistor R4 and serves as the output end of the first isolation unit; the other end of the fourth resistor R4 is electrically connected to the power supply end VDD. In some embodiments, the anode of the first photocoupler U1 is electrically connected to the output end of the first operational amplifier U3 via the fourteenth resistor R14, and the cathode of the first photocoupler U1 is grounded via the sixteenth resistor R16.

[0105] The digital output diagnostic unit 404 includes a first voltage divider unit 406, a first MOS transistor Q1, and a second isolation unit. The input end of the first voltage divider unit 406 is electrically connected to one end of the first switch unit 102; the output end of the first voltage divider unit 406 is electrically connected to the gate of the first MOS transistor Q1; the source of the first MOS transistor Q1 is grounded, and the drain of the first MOS transistor Q1 is electrically connected to the input end of the second isolation unit; the output end of the second isolation unit is used to output the digital output diagnostic signal DO_diag.

[0106] The second isolation unit includes a second photocoupler U2, the anode of the second photocoupler U2 is electrically connected to the power supply terminal VDD, the cathode of the second photocoupler U2 serves as the input terminal of the second isolation unit, the emitter of the second photocoupler U2 is grounded, the collector of the first photocoupler U2 is electrically connected to one end of the fifth resistor R5, and serves as the output terminal of the second isolation unit; the other end of the fifth resistor R5 is electrically connected to the power supply terminal VDD. In some embodiments, the anode of the second photocoupler U2 is electrically connected to the power supply terminal VDD via the eleventh resistor R11. It should be understood that the third resistor R3 serves as the first pull-up resistor, the fourth resistor R4 serves as the second pull-up resistor, and the fifth resistor R5 serves as the third pull-up resistor.

[0107] The first voltage dividing unit 406 includes a twelfth resistor R12 and a thirteenth resistor R13 . The twelfth resistor R12 and the thirteenth resistor R13 form a voltage dividing structure.

[0108] In some embodiments, the resistance value of the twelfth resistor R12 is, for example, 600KΩ, the resistance value of the thirteenth resistor R13 is, for example, 100KΩ, and the resistance values ​​of the fifth resistor R5, the eleventh resistor R11, the fourteenth resistor R14, the sixteenth resistor R16, etc. are, for example, 2.7KΩ. It should be understood that the resistance values ​​of the twelfth resistor R12 and the thirteenth resistor R13 are much greater than the resistance values ​​of the first resistor R1, the tenth resistor R10, the ninth resistor R9, the seventeenth resistor R17, the eighteenth resistor R18, etc. Therefore, when the digital quantity input and output circuit 300 is in the digital quantity input mode, when the digital quantity input diagnosis unit 402 performs the diagnosis operation, as the part shared by the digital quantity input diagnosis unit 402 and the digital quantity output diagnosis unit 404, the current flowing through the twelfth resistor R12 and the thirteenth resistor R13 is very small (the branches corresponding to the twelfth resistor R12 and the thirteenth resistor R13 can be regarded as open circuits), thereby ensuring the diagnosis accuracy of the digital quantity input diagnosis unit 402.

[0109] Fig.14 The equivalent circuit diagram of the digital quantity input-output circuit 300 in the embodiment of the present disclosure in the digital quantity input mode is shown. When the two ends of the first switch unit 102 are connected to the digital quantity input load, the working mode of the digital quantity input-output circuit 100 is the digital quantity input mode, and the control unit 106 outputs the second control signal Power_ctl in the high level state, for example, to control the power switch unit 108 to be turned on, so that one end of the first resistor R1 is connected to the power supply terminal VDD. The control unit 106 outputs the first control signal DO_ctl in the low level state, for example, to make the second MOS tube Q2 in the cut-off state. It should be understood that the digital quantity input load RLI generates the corresponding digital quantity through the closing and opening of its dry contact, and the digital quantity input-output circuit 100 receives the digital quantity through the first terminal P1 and the second terminal P2.

[0110] Fig.15 A schematic diagram of a digital quantity input-output circuit 300 in a first state of a digital quantity input mode according to an embodiment of the present disclosure is shown. In the first state, the dry contact 202 in the digital quantity input load RLI is in an open state. At this time, the voltage across the first resistor R1 does not meet a predetermined condition, for example, the voltage across the first resistor R1 is lower than a predetermined threshold voltage, which is insufficient to turn on the second switch unit 104.

[0111] For example, the voltage across the first resistor R1 is 510 / (510+2.7K+2K+1K+10K)*(24-5.1)=0.59V, which is less than the lowest conduction voltage of the light emitting diode of the third photocoupler U6, 1V. Therefore, the second switch unit 104 is in the off state. Thus, the second switch unit 104 outputs the digital quantity sampling signal DI_sampling in the high level state (for example, DI_sampling=1).

[0112] Accordingly, at this time, the voltage (e.g., the voltage at point PA) obtained at the first detection terminal T1 of the digital input diagnostic unit 402 about one end of the first switch unit 102 is (1K+2K+10K) / (510+2.7K+2K+1K+10K)*(24-5.1)=15.0V, which satisfies the first predetermined condition that it is greater than the first reference voltage Vref1 and less than the second reference voltage Vref2. Therefore, the digital input diagnostic unit 402 outputs a digital input diagnostic signal DI_diag indicating normality. For example, when the voltage at point PB is about 24V, the digital input diagnostic unit 402 outputs a digital input diagnostic signal DI_diag in a low level state (i.e., DI_diag=0) to indicate that the diagnostic result is normal.

[0113] Fig.16 The schematic diagram of the digital quantity input-output circuit 300 of the embodiment of the present disclosure in the second state of the digital quantity input mode is shown. In the second state, the dry contact 202 in the digital quantity input load RLI is in a closed state. At this time, the voltage across the first resistor R1 meets a predetermined condition, for example, the voltage across the first resistor R1 is equal to or higher than a predetermined threshold voltage, so that the second switch unit 104 is turned on.

[0114] For example, the voltage across the first resistor R1 is 510 / (510+2.7K+2K+1K)*(24-5.1)=1.55V, which is greater than the maximum conduction voltage of the diode 1.4V. Therefore, the second switch unit 104 is in a closed state. Thus, the second switch unit 104 outputs a low-level digital sampling signal DI_sampling (for example, DI_sampling=0).

[0115] Accordingly, at this time, the voltage of one end of the first switch unit 102 obtained at the first detection terminal T1 of the digital input diagnostic unit 402 (for example, the voltage at the point PA) is (1K+2K) / (510+2.7K+2K+1K)*(24-5.1)=9.12V, which satisfies the first predetermined condition that it is greater than the first reference voltage Vref1 and less than the second reference voltage Vref2. Therefore, the digital input diagnostic unit 402 outputs the digital input diagnostic signal DI_diag indicating normality, for example, the digital input diagnostic unit 402 outputs the digital input diagnostic signal DI_diag in a low level state (ie, DI_diag=0) to indicate that the diagnostic result is normal.

[0116] Fig.17 A schematic diagram showing a first fault of the digital quantity input-output circuit 300 in the digital quantity input mode according to an embodiment of the present disclosure is shown. For example, the first fault is a disconnection fault of the digital quantity input load RLI. At this time, the voltage across the first resistor R1 is 510 / (510+2.7K+100K+100K)*(24-5.1)=0.003V, which is less than the minimum on-voltage 1V of the light-emitting diode of the third photocoupler U6, and DI_sampling=1 at this time.

[0117] Correspondingly, at this time, the voltage about one end of the first switch unit 102 obtained at the first detection terminal T1 of the digital input diagnostic unit 402 (for example, the voltage at the point PA) is (100K+100K) / (510+2.7K+100K+100K)*(24-5.1)=18.9V, which is greater than the second reference voltage Vref2, and does not meet the first predetermined condition of being greater than the first reference voltage Vref1 and less than the second reference voltage Vref2. Therefore, the digital input diagnostic unit 402 outputs the digital input diagnostic signal DI_diag representing the fault. For example, the voltage at the point PB is approximately 0V, and the digital input diagnostic unit 402 outputs the digital input diagnostic signal DI_diag in a high level state (that is, DI_diag=1) to represent the diagnostic result as a fault.

[0118] Fig.18 A schematic diagram showing a second fault occurring in the digital quantity input and output circuit 300 of an embodiment of the present disclosure in the digital quantity input mode is shown. For example, the second fault is a short circuit fault of the digital quantity input load RLI. At this time, the voltage across the first resistor R1 is 510 / (510+2.7K+2K)*(24-5.1)=1.85V, which is greater than the maximum conduction voltage 1.4V of the light emitting diode of the third photocoupler U6, and DI_sampling=0 at this time.

[0119] Correspondingly, at this time, the voltage about one end of the first switch unit 102 obtained at the first detection terminal T1 of the digital input diagnostic unit 402 (for example, the voltage at the point PA) is 2K / (510+2.7K+2K)*(24-5.1)=7.25V, which is less than the first reference voltage Vref1, and does not meet the first predetermined condition of being greater than the first reference voltage Vref1 and less than the second reference voltage Vref2. Therefore, the digital input diagnostic unit 402 outputs the digital input diagnostic signal DI_diag representing the fault. For example, the digital input diagnostic unit 402 outputs the digital input diagnostic signal DI_diag in a high level state (that is, DI_diag=1) to represent the diagnostic result as a fault.

[0120] Therefore, when the digital quantity input load RLI is normally connected, in the two states of the dry contact being disconnected and closed, the sampling function of the digital quantity generated by the digital quantity input load RLI can be normally realized through the digital quantity input and output circuit 300. When the dry contact is disconnected, DI_sampling=1, and when it is closed, DI_sampling=0. In addition, the digital quantity input diagnosis unit 402 outputs the digital quantity input diagnosis signal DI_diag representing normality. When a fault occurs (such as a disconnection fault or a short circuit fault), the digital quantity input diagnosis unit 402 outputs the digital quantity input diagnosis signal DI_diag representing the fault.

[0121] The control unit 106 is, for example, further configured to determine that a wire break fault occurs between the digital input-output circuit 300 and the digital input load RLI in response to determining that the digital input diagnostic signal DI_diag represents a fault and the input sampling signal DI_sampling from the digital input-output circuit 300 corresponds to a digital quantity representing a disconnected state, and to determine that a short circuit fault occurs inside the digital input load RLI in response to determining that the digital input diagnostic signal DI_diag represents a fault and the input sampling signal DI_sampling from the digital input-output circuit 300 corresponds to a digital quantity representing a connected state.

[0122] For example, when the control unit 106 receives the output digital input diagnostic signal DI_diag (e.g., the digital input diagnostic signal DI_diag in a low level state) representing the fault, the control unit 106 further determines the specific fault type according to the input sampling signal DI_sampling from the digital input-output circuit 300. For example, if the input sampling signal DI_sampling from the digital input-output circuit 300 is in a high level state (e.g., DI_sampling=1), that is, the input sampling signal DI_sampling from the digital input-output circuit 300 corresponds to a digital quantity representing the disconnected state, the control unit 106 determines that a disconnection fault occurs between the digital input-output circuit 300 and the digital input load RLI. If at this time, the input sampling signal DI_sampling from the digital input-output circuit 300 is in a low level state (e.g., DI_sampling=0), that is, the input sampling signal DI_sampling from the digital input-output circuit 300 corresponds to a digital quantity representing the connected state, the control unit 106 determines that a short circuit fault occurs inside the digital input load RLI.

[0123] Fig.19 The equivalent circuit diagram of the digital input-output circuit 300 in the embodiment of the present disclosure in the digital output mode is shown. When the two ends of the first switch unit 102 are connected to the digital output load, the working mode of the digital input-output circuit 100 is the digital output mode.

[0124] If the digital output load needs power distribution (i.e., powered by the digital input and output circuit 300), the working mode of the digital input and output circuit 300 is the power distribution digital output mode. The control unit 106 controls the power switch unit 108 to be turned on, so that one end of the first resistor R1 is connected to the power supply terminal VDD to power the digital output load.

[0125] Fig. 20 A schematic diagram of a digital quantity input-output circuit 300 in a first state of a power distribution digital quantity output mode according to an embodiment of the present disclosure is shown. The first state is that the digital quantity input-output circuit 300 outputs a digital quantity representing a disconnected (OFF) state. At this time, the control unit 106 controls the first switch unit 102 to disconnect. For example, the control unit 106 generates a first control signal DO_ctl in a low level state, so that the second MOS tube is in a cut-off state, and the digital quantity input-output circuit 100 outputs a digital quantity representing a disconnected (OFF) state to the digital quantity output load RLO through the first terminal P1 and the second terminal P2.

[0126] When the digital output load RLO is in a normal access state (i.e., no short circuit fault or disconnection fault occurs), the voltage at one end of the first switch unit 102 obtained at the first detection terminal T1 of the digital output diagnostic unit 404 (for example, the voltage at point PA) is close to 18.9V, the voltage at point PC is close to 2.7V, the first MOS tube Q1 is turned on, the point PD is at a low level, and the digital output diagnostic unit 404 outputs a low-level digital output diagnostic signal DO_diag, for example, DO_diag=0.

[0127] Fig.21 A schematic diagram showing a digital quantity input-output circuit 300 of an embodiment of the present disclosure in a second state of a power distribution digital quantity output mode is shown. The second state is that the digital quantity input-output circuit 100 outputs a digital quantity representing an ON state. At this time, the control unit 106 controls the first switch unit 102 to be turned on. For example, the control unit 106 generates a first control signal DO_ctl in a high level state, so that the second MOS tube is in an ON state, and the digital quantity input-output circuit 100 outputs a digital quantity representing an ON state to the digital quantity output load RLO through the first terminal P1 and the second terminal P2.

[0128] Due to the effect of the first diode D1, no matter the digital output load RLO is normally connected, disconnected or short-circuited, the voltage on one end of the first switch unit 102 obtained at the first detection terminal T1 of the digital output diagnostic unit 404 (for example, the voltage at the point PA) is clamped to close to 0.7V. Therefore, the voltage at the point PC is close to 0.35V, and the digital output diagnostic unit 404 outputs a high-level digital output diagnostic signal DO_diag, for example, DO_diag=1.

[0129] Fig. 22 The equivalent circuit diagram of the digital quantity input and output circuit 300 of the embodiment of the present disclosure in the non-power distribution digital quantity output mode is shown. The control unit 106 controls the power switch unit 108 to be disconnected, so that one end of the first resistor R1 is disconnected from the power supply terminal VDD.

[0130] Fig.23A schematic diagram of a digital quantity input-output circuit 300 in a first state of a non-power distribution digital quantity output mode according to an embodiment of the present disclosure is shown. The first state is that the digital quantity input-output circuit 300 outputs a digital quantity representing a disconnected (OFF) state. At this time, the control unit 106 controls the first switch unit 102 to disconnect. For example, the control unit 106 generates a first control signal DO_ctl in a low level state, so that the second MOS tube is in a cut-off state, and the digital quantity input-output circuit 100 outputs a digital quantity representing a disconnected (OFF) state to the digital quantity output load RLO through the first terminal P1 and the second terminal P2.

[0131] When the digital output load RLO is in a normal connection state (i.e., no short circuit fault or disconnection fault occurs), the voltage at one end of the first switch unit 102 obtained at the first detection terminal T1 of the digital output diagnostic unit 404 (for example, the voltage at point PA) is close to 24V, and the voltage at point PC is close to 3.4V, and the digital output diagnostic unit 404 outputs a low-level digital output diagnostic signal DO_diag, for example, DO_diag=0.

[0132] Fig.24 A schematic diagram of a digital quantity input-output circuit 300 of an embodiment of the present disclosure in a second state of a non-power distribution digital quantity output mode is shown. The second state is that the digital quantity input-output circuit 100 outputs a digital quantity representing an ON state. At this time, the control unit 106 controls the first switch unit 102 to be turned on. For example, the control unit 106 generates a first control signal DO_ctl in a high level state, so that the second MOS tube is in a conducting state, and the digital quantity input-output circuit 100 outputs a digital quantity representing an ON state to the digital quantity output load RLO through the first terminal P1 and the second terminal P2.

[0133] Due to the effect of the first diode D1, no matter the digital output load RLO is normally connected, disconnected or short-circuited, the voltage on one end of the first switch unit 102 obtained at the first detection terminal T1 of the digital output diagnostic unit 404 (for example, the voltage at the point PA) is clamped to close to 0.7V. Therefore, the voltage at the point PC is close to 0.35V, and the digital output diagnostic unit 404 outputs a high-level digital output diagnostic signal DO_diag, for example, DO_diag=1.

[0134] When performing digital output fault diagnosis, the control unit 106 controls the second switch unit 104 to be disconnected, so that the digital input-output circuit 300 enters a state of outputting a digital quantity representing an OFF state. Then, the control unit 106 controls the power switch unit 108 to be disconnected, and the control unit 106 obtains the digital output diagnostic signal DO_diag from the digital output diagnostic unit 404 during the period when the power switch unit 108 is disconnected. If the digital output diagnostic signal DO_diag is in a first state, the first state is regarded as representing a normal state (e.g., a low level state, i.e., DO_diag=0), the control unit 106 determines that there is a normal wiring of the digital output load RLO. If the digital output diagnostic signal DO_diag is in a second state, the second state is regarded as representing a fault state (e.g., a high level state, i.e., DO_diag=1), the control unit 106 determines that there is a digital output load RLO wiring fault.

[0135] On the basis that the control unit 106 determines that there is a digital output load RLO wiring fault, the control unit 106 turns on the power switch unit 108, and the control unit 106 obtains the digital output diagnostic signal DO_diag from the digital output diagnostic unit 404 during the period when the power switch unit 108 is turned on. If the digital output diagnostic signal DO_diag continues to maintain the second state, such as a state that represents a fault (such as a high level state, that is, DO_diag=1), the control unit 106 determines that there is a digital output load RLO short circuit fault. If after the power switch unit 108 is turned on, the state of the digital output diagnostic signal DO_diag changes to the first state, such as a state that represents a normal state (such as a low level state, that is, DO_diag=0), the control unit 106 determines that there is a digital output load RLO disconnection fault.

[0136] Fig.25 A schematic diagram of a digital quantity input-output circuit 300 of an embodiment of the present disclosure performing fault diagnosis in a digital quantity output mode is shown. It is assumed that there is a digital quantity output load RLO disconnection fault. The control unit 106 controls the second switch unit 104 to disconnect, so that the digital quantity input-output circuit 300 enters a state of outputting a digital quantity representing an OFF state. Then, the control unit 106 controls the power switch unit 108 to disconnect, and the control unit 106 obtains a digital quantity output diagnostic signal DO_diag from the digital quantity output diagnostic unit 404 during the period when the power switch unit 108 is disconnected.

[0137] At this time, the voltage (e.g., the voltage at point PA) acquired at the first detection terminal T1 of the digital output diagnostic unit 404 about one end of the first switch unit 102 is close to 0V, and the voltage at point PC is about 0V, and the digital output diagnostic unit 404 outputs a high-level (e.g., corresponding to the second state) digital output diagnostic signal DO_diag, for example, DO_diag = 1. The high-level digital output diagnostic signal DO_diag at this time is regarded as a digital output diagnostic signal DO_diag indicating a fault, and the control unit 106 determines that there is a digital output load RLO wiring fault.

[0138] Based on the control unit 106 determining that there is a digital output load RLO wiring fault, the control unit 106 turns on the power switch unit 108 . Fig.26 A schematic diagram of a digital quantity input-output circuit 300 of an embodiment of the present disclosure performing fault diagnosis in a digital quantity output mode is shown. Because the digital quantity output load RLO has a disconnection fault, the voltage (e.g., the voltage at point PA) of one end of the first switch unit 102 acquired at the first detection terminal T1 of the digital quantity output diagnosis unit 404 is close to 18.9V, and the voltage at point PC is about 2.7V, and the digital quantity output diagnosis unit 404 outputs a low level (e.g., corresponding to the first state) digital quantity output diagnosis signal DO_diag, for example, DO_diag=0. Because the digital quantity output diagnosis signal DO_diag changes from the second state to the first state, the control unit 106 determines that there is a disconnection fault in the digital quantity output load RLO.

[0139] Fig. 27 A schematic diagram of a digital quantity input and output circuit 300 of an embodiment of the present disclosure performing fault diagnosis in a digital quantity output mode is shown. It is assumed that there is a short-circuit fault in the digital quantity output load RLO. When performing diagnosis, the control unit 106 controls the second switch unit 104 to be disconnected, so that the digital quantity input and output circuit 300 enters a state of outputting a digital quantity representing an OFF state. Then, the control unit 106 controls the power switch unit 108 to be disconnected, and the control unit 106 obtains a digital quantity output diagnostic signal DO_diag from the digital quantity output diagnostic unit 404 during the period when the power switch unit 108 is disconnected.

[0140] At this time, the voltage (e.g., the voltage at point PA) acquired at the first detection terminal T1 of the digital output diagnostic unit 404 about one end of the first switch unit 102 is close to 0V, and the voltage at point PC is about 0V, and the digital output diagnostic unit 404 outputs a high-level (e.g., corresponding to the second state) digital output diagnostic signal DO_diag, for example, DO_diag = 1. The high-level digital output diagnostic signal DO_diag at this time is regarded as a digital output diagnostic signal DO_diag indicating a fault, and the control unit 106 determines that there is a digital output load RLO wiring fault.

[0141] Based on the control unit 106 determining that there is a digital output load RLO wiring fault, the control unit 106 turns on the power switch unit 108 . Fig.28 A schematic diagram of a digital quantity input and output circuit 300 of an embodiment of the present disclosure performing fault diagnosis in a digital quantity output mode is shown. Because a short circuit fault exists in the digital quantity output load RLO, the voltage of one end of the first switch unit 102 (e.g., the voltage at point PA) 2K / (510+2.7K+2K)*(24-5.1)=7.25V obtained at the first detection terminal T1 of the digital quantity output diagnosis unit 404, and the voltage at point PC is about 1.0V, and the digital quantity output diagnosis unit 404 outputs a high level (e.g., corresponding to the second state) digital quantity output diagnosis signal DO_diag, for example, DO_diag=1. Because the digital quantity output diagnosis signal DO_diag continues to maintain the second state, the control unit 106 determines that there is a short circuit fault in the digital quantity output load RLO.

[0142] Fig.29 Schematic diagram of a diagnostic circuit 600 for a digital input and output circuit according to an embodiment of the present disclosure is shown. The diagnostic circuit 600 includes a digital input diagnostic unit 402 and a digital output diagnostic unit 404. The diagnostic circuit 600 also includes a control unit 106 and a power switch unit 108.

[0143] The digital input diagnostic unit 402 is used to diagnose when the digital input-output circuit 500 is in the digital input mode, so as to determine whether the digital input load RLI has a short circuit fault or a disconnection fault. It should be understood that the short circuit fault of the digital input load RLI means that the digital input load RLI is short-circuited internally, and the disconnection fault of the digital input load RLI means that the digital input load RLI and the digital input-output circuit 500 are disconnected. The digital output diagnostic unit 404 is used to diagnose when the digital input-output circuit 500 is in the digital output mode, so as to determine whether the digital input load RLI has a short circuit fault or a disconnection fault. The diagnostic circuit 600 performs diagnosis by electrically connecting its first detection terminal T1 to the positive terminal (e.g., the first terminal P1) of the digital input-output circuit 500 and the second detection terminal T2 to the negative terminal (e.g., the second terminal P2) of the digital input-output circuit 500. It should be understood that the positive terminal and the negative terminal of the digital input-output circuit 500 are the terminals for digital input and output of the digital input-output circuit 500. When the digital input-output circuit 500 is in the digital input mode, the positive terminal of the digital input-output circuit 500 is used as the digital input positive terminal (DI+), and the negative terminal of the digital input-output circuit 500 is used as the digital input negative terminal (DI-); when the digital input-output circuit 500 is in the digital output mode, the positive terminal of the digital input-output circuit 500 is used as the digital output positive terminal (DO+), and the negative terminal of the digital input-output circuit 500 is used as the digital output negative terminal (DO-). The digital input-output circuit 500 can be the digital input-output circuit 100 of the embodiment of the present disclosure, or it can be other digital input-output circuits. The digital input-output circuit 500 can also be a circuit with only a digital input function, and accordingly, the diagnostic circuit 600 can omit the digital output diagnostic unit 404. Alternatively, the digital quantity input and output circuit 500 may be a circuit having only a digital quantity output function, and accordingly, the diagnosis circuit 600 may omit the digital quantity input diagnosis unit 402 .

[0144] Among them, one end of the power switch unit 108 is electrically connected to the positive terminal of the digital input and output circuit 500, the other end of the power switch unit 108 is electrically connected to the power supply terminal VDD, and the control end of the power switch unit 108 is electrically connected to the control unit 106 to receive the second control signal Power_ctl from the control unit 106. The control unit 106 controls the power switch unit 108 to be turned on or off through the second control signal Power_ctl, so that the positive terminal of the digital input and output circuit 500 is connected or disconnected with the power supply terminal VDD. In some embodiments, one end of the power switch unit 108 is electrically connected to the positive terminal of the digital input and output circuit 500 via the tenth resistor R10, and the tenth resistor R10 can be used as a current limiting resistor. In some embodiments, the diagnostic circuit 600 also includes a Zener diode Z1, the Zener diode Z1 and the tenth resistor form a series structure, one end of the power switch unit 108 is electrically connected to the positive terminal of the digital input and output circuit 500 via the series structure formed by the tenth resistor R10 and the Zener diode Z1, and the stable voltage of the Zener diode Z1 is, for example, 5.1V. The tenth resistor R10 serves as a first current limiting resistor, for example.

[0145] The control unit 106 can also control the digital quantity input and output circuit 500 to enter the digital quantity input mode or the digital quantity output mode. After the digital quantity input and output circuit 500 enters the digital quantity output mode, the control unit 106 can also control the digital quantity input and output circuit 500 to output a digital quantity representing an OFF state or a digital quantity representing an ON state.

[0146] The digital quantity output diagnostic unit 404 is electrically connected to the digital quantity input and output circuit 500, and is configured to generate a digital quantity output diagnostic signal of a first state when the voltage of the positive terminal (e.g., the first terminal P1) is greater than or equal to a first voltage threshold, and to generate a digital quantity output diagnostic signal of a second state when the voltage of the positive terminal is less than the first voltage threshold. The first voltage threshold can be reasonably set according to the specific application scenario of the digital quantity input and output circuit 500. For example, the first voltage threshold can be reasonably set according to the voltage of the power supply terminal VDD of the digital quantity input and output circuit 500.

[0147] For example, the digital output diagnostic unit 404 includes a first voltage divider unit 406, a first MOS transistor Q1, and a second isolation unit. The input end of the first voltage divider unit 406 is electrically connected to the positive end of the wiring; the output end of the first voltage divider unit 406 is electrically connected to the gate of the first MOS transistor Q1; the source of the first MOS transistor Q1 is grounded, and the drain of the first MOS transistor Q1 is electrically connected to the input end of the second isolation unit; the output end of the second isolation unit is used to output the digital output diagnostic signal DO_diag. It should be understood that the voltage at the voltage divider output end (i.e., point PC) of the first voltage divider unit 406 is obtained by voltage division from the voltage at the positive end of the wiring, and the voltage at the voltage divider output end (i.e., point PC) of the first voltage divider unit 406 can reflect the voltage at the positive end of the wiring. When the voltage at the voltage-dividing output end (i.e., point PC) of the first voltage-dividing unit 406 is greater than or equal to the turn-on voltage of the first MOS tube Q1, it means that the voltage at the positive terminal of the connection is greater than or equal to the first voltage threshold; when the voltage at the voltage-dividing output end (i.e., point PC) of the first voltage-dividing unit 406 is less than the turn-on voltage of the first MOS tube Q1, it means that the voltage at the positive terminal of the connection is less than the first voltage threshold.

[0148] The control unit 106 is configured, for example, to control the power switch unit to be turned off, and to control the digital input-output circuit to output a digital quantity representing the off (OFF) state, and to determine that there is a wiring fault in the digital output load RLO of the digital input-output circuit in response to determining that the digital output diagnostic signal is in the second state. Further, the control unit 106 is also configured to: control the power switch unit to be turned on in response to determining that there is a wiring fault in the digital output load RLO, and to determine that a short circuit fault occurs in the digital output load in response to determining that the digital output diagnostic signal continues to maintain the second state, and to determine that a disconnection fault occurs between the digital input-output circuit 500 and the digital output load RLO in response to determining that the digital output diagnostic signal is converted to the first state.

[0149] Fig.30 FIG. 6 is a schematic diagram showing an equivalent circuit of the diagnostic circuit 600 of an embodiment of the present disclosure for performing digital output diagnosis. Fig.30As shown, when the digital quantity input and output circuit 500 is in the digital quantity output mode, the control unit 106 first controls the power switch unit 108 to disconnect, so that the positive terminal of the digital quantity input and output circuit 500 is disconnected from the power supply terminal VDD. The control unit 106 controls the digital quantity input and output circuit 500 to output a digital quantity representing the disconnection (OFF) state. At this time, if the digital quantity output diagnostic unit 404 outputs a digital quantity output diagnostic signal DO_diag of a low level (for example, corresponding to the first state), for example, DO_diag=0; then the control unit 106 determines that the digital quantity output load RLO is connected normally. If the digital quantity output diagnostic unit 404 outputs a digital quantity output diagnostic signal DO_diag of a high level (for example, corresponding to the second state), for example, DO_diag=1. Then the control unit 106 determines that there is a wiring fault in the digital quantity output load RLO.

[0150] Fig.31 The equivalent circuit diagram of the diagnostic circuit 600 of the embodiment of the present disclosure for digital output diagnosis is shown. For example, the digital input and output circuit 500 has a first fault, which is a line break fault between the digital input and output circuit 500 and the digital output load RLO.

[0151] During the diagnosis process, first, the control unit 106 controls the power switch unit 108 to be disconnected, so that the positive terminal of the digital input-output circuit 500 is disconnected from the power supply terminal VDD. The control unit 106 controls the digital input-output circuit 500 to output a digital quantity representing the disconnection (OFF) state. If the digital output diagnostic unit 404 outputs a digital output diagnostic signal DO_diag of a high level (e.g., corresponding to the second state), for example, DO_diag=1. The control unit 106 determines that there is a wiring fault in the digital output load RLO.

[0152] For example, at this time, the voltage at the positive terminal (e.g., the first terminal P1) of the digital input-output circuit 500 acquired at the first detection terminal T1 of the digital output diagnostic unit 404 is close to 0V, and the voltage at the point PC is about 0V, and the digital output diagnostic unit 404 outputs a high-level (e.g., corresponding to the second state) digital output diagnostic signal DO_diag, for example, DO_diag=1. At this time, the high-level digital output diagnostic signal DO_diag is regarded as a digital output diagnostic signal DO_diag indicating a fault, and the control unit 106 determines that there is a digital output load RLO wiring fault.

[0153] On the premise of determining that there is a wiring fault in the digital output load RLO, the control unit 106 further determines the specific fault type through relevant operations. Fig.32The equivalent circuit diagram of the diagnostic circuit 600 of the embodiment of the present disclosure for digital output diagnosis is shown. The control unit 106 controls the power switch unit 108 to be turned on (closed) so that the positive terminal of the digital input-output circuit 500 is connected to the power supply terminal VDD. Because the digital output load RLO has a disconnection fault, the voltage at the positive terminal (e.g., the first terminal P1) of the digital input-output circuit 500 obtained at the first detection terminal T1 of the digital output diagnostic unit 404 is relatively high (e.g., close to 18.9V), and the voltage at the point PC is about 2.7V. The digital output diagnostic unit 404 outputs a low-level (e.g., corresponding to the first state) digital output diagnostic signal DO_diag, for example, DO_diag=0. Because the digital output diagnostic signal DO_diag changes from the second state to the first state, the control unit 106 determines that there is a digital output load RLO disconnection fault.

[0154] Fig.33 The equivalent circuit diagram of the diagnostic circuit 600 of the embodiment of the present disclosure performing digital output diagnosis is shown. For example, there is a second fault with respect to the digital output load RLO of the digital input and output circuit 500, and the second fault is an internal short circuit fault with respect to the digital output load RLO of the digital input and output circuit 500.

[0155] During the diagnosis process, first, the control unit 106 controls the power switch unit 108 to be disconnected, so that the positive terminal of the digital input-output circuit 500 is disconnected from the power supply terminal VDD. The control unit 106 controls the digital input-output circuit 500 to output a digital quantity representing the disconnection (OFF) state. If the digital output diagnostic unit 404 outputs a digital output diagnostic signal DO_diag of a high level (e.g., corresponding to the second state), for example, DO_diag=1. The control unit 106 determines that there is a wiring fault in the digital output load RLO.

[0156] For example, at this time, the voltage at the positive terminal (e.g., the first terminal P1) of the digital input-output circuit 500 acquired at the first detection terminal T1 of the digital output diagnostic unit 404 is close to 0V, and the voltage at the point PC is about 0V, and the digital output diagnostic unit 404 outputs a high-level (e.g., corresponding to the second state) digital output diagnostic signal DO_diag, for example, DO_diag=1. At this time, the high-level digital output diagnostic signal DO_diag is regarded as a digital output diagnostic signal DO_diag indicating a fault, and the control unit 106 determines that there is a digital output load RLO wiring fault.

[0157] On the premise of determining that there is a wiring fault in the digital output load RLO, the control unit 106 further determines the specific fault type through relevant operations. Fig.34 The equivalent circuit diagram of the diagnostic circuit 600 of the embodiment of the present disclosure for digital output diagnosis is shown. The control unit 106 controls the power switch unit 108 to be turned on (closed) so that the positive terminal of the digital input-output circuit 500 is connected to the power supply terminal VDD. Because the digital output load RLO has a short-circuit fault, the voltage at the positive terminal (e.g., the first terminal P1) of the digital input-output circuit 500 obtained at the first detection terminal T1 of the digital output diagnostic unit 404 is close to 0V, and the voltage at the point PC is about 0V, and the digital output diagnostic unit 404 outputs a high-level (e.g., corresponding to the second state) digital output diagnostic signal DO_diag, for example, DO_diag=1. Because the digital output diagnostic signal DO_diag continues to remain in the second state, the control unit 106 determines that there is a short-circuit fault in the digital output load RLO.

[0158] The digital input diagnostic unit 402 is electrically connected to the positive terminal of the wiring, and is configured to generate a normal digital input diagnostic signal in response to determining that the voltage on the positive terminal of the wiring satisfies a first predetermined condition, and to generate a fault digital input diagnostic signal in response to determining that the voltage on the positive terminal of the wiring does not satisfy the first predetermined condition, wherein the first predetermined condition includes: the voltage on the positive terminal of the wiring is greater than the first reference voltage and less than the second reference voltage, the first reference voltage is less than the second reference voltage, and the second reference voltage is less than the power supply terminal voltage. Taking the voltage of the power supply terminal VDD as 24V as an example, the first reference voltage Vref1 is, for example, 8V, and the second reference voltage Vref2 is, for example, 16V.

[0159] The control unit 106 is, for example, further configured to determine that a wire break fault occurs between the digital input-output circuit 500 and the digital input load RLI in response to determining that the digital input diagnostic signal DI_diag represents a fault and the input sampling signal DI_sampling from the digital input-output circuit 500 corresponds to a digital quantity representing a disconnected state, and to determine that a short circuit fault occurs inside the digital input load RLI in response to determining that the digital input diagnostic signal DI_diag represents a fault and the input sampling signal DI_sampling from the digital input-output circuit 500 corresponds to a digital quantity representing a connected state.

[0160] For example, when the control unit 106 receives the output digital input diagnostic signal DI_diag (e.g., the digital input diagnostic signal DI_diag in a low level state) representing a fault, the control unit 106 further determines the specific fault type according to the input sampling signal DI_sampling from the digital input-output circuit 500. For example, if the input sampling signal DI_sampling from the digital input-output circuit 500 is in a high level state (e.g., DI_sampling=1), that is, the input sampling signal DI_sampling from the digital input-output circuit 500 corresponds to a digital quantity representing a disconnected state, the control unit 106 determines that a disconnection fault occurs between the digital input-output circuit 500 and the digital input load RLI. If at this time, the input sampling signal DI_sampling from the digital input-output circuit 500 is in a low level state (e.g., DI_sampling=0), that is, the input sampling signal DI_sampling from the digital input-output circuit 500 corresponds to a digital quantity representing a connected state, the control unit 106 determines that a short circuit fault occurs inside the digital input load RLI.

[0161] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

[0162] The above are only optional embodiments of the present disclosure and are not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A diagnostic circuit for a digital input and output circuit, characterized in that: include: A power switch unit, one end of the power switch unit is electrically connected to the positive terminal of the digital input and output circuit, and the other end of the power switch unit is electrically connected to the power supply terminal; a digital quantity output diagnostic unit, electrically connected to the digital quantity input and output circuit, and configured to generate a digital quantity output diagnostic signal of a first state when the voltage at the positive terminal of the wiring is greater than or equal to a first voltage threshold, and to generate a digital quantity output diagnostic signal of a second state when the voltage at the positive terminal of the wiring is less than the first voltage threshold; as well as a control unit configured to control the power switch unit to be disconnected, and control the digital input-output circuit to output a digital quantity representing a disconnected state, and determine that a wiring fault exists in a digital output load of the digital input-output circuit in response to determining that the digital output diagnostic signal is in a second state; The digital output diagnostic unit includes: A first voltage dividing unit, wherein the input end of the first voltage dividing unit is electrically connected to the positive terminal of the wiring; and the output end of the first voltage dividing unit is electrically connected to the gate of the first MOS tube; a first MOS transistor, wherein a source of the first MOS transistor is grounded, and a drain of the first MOS transistor is electrically connected to an input end of the second isolation unit; and The second isolation unit, the output end of the second isolation unit is used to output a digital output diagnostic signal.

2. The diagnostic circuit according to claim 1, characterized in that: The control unit is also configured to: control the power switch unit to turn on in response to determining that there is a wiring fault in the digital output load, determine that a short circuit fault occurs in the digital output load in response to determining that the digital output diagnostic signal continues to maintain the second state, and determine that a wire break occurs between the digital input-output circuit and the digital output load in response to determining that the digital output diagnostic signal is converted to the first state.

3. The diagnostic circuit according to claim 2, characterized in that: Also includes: A digital input diagnostic unit is electrically connected to the positive terminal of the wiring and is configured to generate a digital input diagnostic signal representing a normal state in response to determining that the voltage on the positive terminal of the wiring satisfies a first predetermined condition, and to generate a digital input diagnostic signal representing a fault in response to determining that the voltage on the positive terminal of the wiring does not satisfy the first predetermined condition. The first predetermined condition includes: the voltage on the positive terminal of the wiring is greater than a first reference voltage and less than a second reference voltage, the first reference voltage is less than the second reference voltage, and the second reference voltage is less than the power supply terminal voltage.

4. The diagnostic circuit according to claim 3, characterized in that: The control unit is further configured to: determine that a wire break fault occurs between the digital input-output circuit and the digital input load in response to determining that the digital input diagnostic signal represents a fault and the input sampling signal from the digital input-output circuit corresponds to a digital quantity representing a disconnected state; and determine that a short circuit fault occurs in the digital input load in response to determining that the digital input diagnostic signal represents a fault and the input sampling signal from the digital input-output circuit corresponds to a digital quantity representing a connected state.

5. The diagnostic circuit according to claim 3, characterized in that: The digital input diagnostic unit includes: A first operational amplifier, wherein a non-inverting input terminal of the first operational amplifier is used to receive a second reference voltage, an inverting input terminal of the first operational amplifier is electrically connected to the positive terminal of the wiring, and an output terminal of the first operational amplifier is electrically connected to an output terminal of the second operational amplifier and an input terminal of the first isolation unit; A second operational amplifier, wherein the inverting input terminal of the second operational amplifier is used to receive the first reference voltage, and the non-inverting input terminal of the second operational amplifier is electrically connected to the positive terminal of the wiring; a first pull-up resistor, one end of the first pull-up resistor being electrically connected to the output end of the first operational amplifier, and the other end of the first pull-up resistor being electrically connected to the power supply end; and The first isolation unit has an output end for outputting a digital input diagnostic signal.

6. The diagnostic circuit according to claim 5, characterized in that: The first isolation unit includes: a first photoelectric coupler and a second pull-up resistor, the anode of the first photoelectric coupler serves as an input terminal of the first isolation unit, the cathode and the emitter of the first photoelectric coupler are grounded, the collector of the first photoelectric coupler is electrically connected to one end of the second pull-up resistor and serves as an output terminal of the first isolation unit, and the other end of the second pull-up resistor is electrically connected to the power supply terminal; The second isolation unit includes: a second photoelectric coupler and a third pull-up resistor, the anode of the second photoelectric coupler is electrically connected to the power supply end, the cathode of the second photoelectric coupler serves as the input end of the second isolation unit, the emitter of the second photoelectric coupler is grounded, the collector of the first photoelectric coupler is electrically connected to one end of the third pull-up resistor and serves as the output end of the second isolation unit, and the other end of the third pull-up resistor is electrically connected to the power supply end.

7. The diagnostic circuit according to claim 2, characterized in that: The power switch unit includes: a power photocoupler, an anode of the power photocoupler serves as a control end of the power switch unit, a cathode of the power photocoupler is grounded, an emitter of the power photocoupler serves as one end of the power switch unit, and a collector of the power photocoupler serves as the other end of the power switch unit.

8. The diagnostic circuit according to claim 5, characterized in that: Also includes: A first voltage-dividing resistor, one end of which is grounded, the other end of which is electrically connected to one end of the second voltage-dividing resistor, and is used to output a first reference voltage; a second voltage-dividing resistor, the other end of which is electrically connected to the third voltage-dividing resistor and is used to output a second reference voltage; and A third voltage-dividing resistor, the other end of the third voltage-dividing resistor is electrically connected to the power supply end.

9. The diagnostic circuit according to claim 1, characterized in that: Also includes: A first current limiting resistor, one end of the power switch unit is electrically connected to the positive terminal of the connection via the first current limiting resistor.

Citation Information

Patent Citations

  • Digital quantity output loop disconnection diagnosis device and diagnosis method

    CN114779125A