Diagnosis method and device of DI module, electronic equipment and readable storage medium

By establishing a closed path between the signal channels of the DI module, sending diagnostic pulse signals in a time-shared manner and analyzing the sampling signals, the problem of inability to diagnose DI module channel adhesion and crosstalk faults in the existing technology is solved, and efficient detection of DI module faults is achieved. Accurate analysis improves inspection efficiency and safety.

CN118732573APending Publication Date: 2024-10-01BEIJING HOLLYSYS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410842531.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The existing technology cannot effectively diagnose channel adhesion and crosstalk faults in the DI module, and cannot accurately determine the specific fault situation of the signal channel.

Method used

By establishing a closed path between the output pin and the sampling pin of each signal channel of the DI module, the diagnostic pulse signal is sent in time division, and the sampling signal is received and analyzed to determine whether there is a sampling pulse signal with overlapping pulse time periods. Whether there is crosstalk fault between signal channels.

Benefits of technology

Efficient and accurate analysis of crosstalk faults in the DI module is achieved, and the inspection efficiency and use safety of the DI module are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118732573A_ABST
    Figure CN118732573A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of module diagnosis, and provides a DI module diagnosis method and device, electronic equipment and a readable storage medium. The method comprises the following steps: sending a diagnosis pulse signal to an output pin of each signal channel in a time-sharing manner; receiving a sampling signal of a sampling pin of each signal channel; traversing each sampling signal, and determining a sampling pulse signal in each sampling signal; judging whether at least two sampling pulse signals with overlapped pulse time periods exist or not; and when the pulse time periods of at least two sampling pulse signals are overlapped, determining that a crosstalk fault exists between the signal channels corresponding to the sampling pulses of which the pulse time periods are overlapped. According to the method, the crosstalk fault in the DI module can be efficiently and accurately analyzed, and the inspection efficiency and the use safety of the DI module are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of module diagnosis technology, and in particular to a diagnosis method, device, electronic device and readable storage medium for a DI module. Background Art

[0002] In the automation control system, the acquisition of DI (Digital Input) signals needs to be realized by using a dedicated DI module. Usually a DI module includes multiple signal paths, each of which can realize the acquisition of a signal. In order to ensure that the DI module functions normally and can operate reliably, the DI module can be diagnosed through channels.

[0003] The current channel diagnosis method of the DI module determines whether the signal channel is normal by determining whether the output level and the acquisition level of the same signal channel are consistent. Specifically, it includes: sending a specific level to the signal output pin of the signal channel, obtaining the acquisition level of the signal acquisition pin, and comparing whether the sent specific level is consistent with the acquisition level. If they are consistent, the signal channel is considered to be normal.

[0004] However, this diagnostic method can only diagnose whether a single signal channel is normal. For a DI module with normal acquisition function but channel adhesion and crosstalk, it cannot diagnose the specific fault condition of the channel.

[0005] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve. Summary of the invention

[0006] In view of this, the embodiments of the present application provide a method, device, electronic device and readable storage medium for diagnosing a DI module to solve the problem that channel adhesion and crosstalk failures of the DI module cannot be diagnosed in the prior art.

[0007] In a first aspect of an embodiment of the present application, a diagnostic method for a DI module is provided, which is applied to an MCU of the DI module, wherein there is a closed path outside the DI module between an output pin and a sampling pin of each signal channel of the DI module, and the diagnostic method comprises:

[0008] Send out diagnostic pulse signals to the output pin of each signal channel in a time-sharing manner;

[0009] Receive a sampling signal from a sampling pin of each signal channel;

[0010] Traversing each sampling signal, and determining a sampling pulse signal in each sampling signal;

[0011] Determining whether there are at least two sampling pulse signals with overlapping pulse time periods;

[0012] When there are at least two sampling pulse signals with overlapping pulse time periods, it is determined that there is a crosstalk fault between the signal channels corresponding to the sampling pulses with overlapping pulse time periods;

[0013] The pulse time period includes the time period from the pulse start time to the pulse end time of the sampling pulse signal.

[0014] According to a second aspect of an embodiment of the present application, a diagnostic device for a DI module is provided, wherein a closed path outside the DI module exists between an output pin and a sampling pin of each signal channel of the DI module, and the diagnostic device comprises:

[0015] An excitation module is used to send a diagnostic pulse signal to the output pin of each signal channel in a time-sharing manner;

[0016] A sampling module, used for receiving a sampling signal from a sampling pin of each signal channel;

[0017] A preprocessing module, used for traversing each sampling signal and determining a sampling pulse signal in each sampling signal;

[0018] An analysis module is used to determine whether there are at least two sampling pulse signals with overlapping pulse time periods. When there are at least two sampling pulse signals with overlapping pulse time periods, it is determined that there is a crosstalk fault between signal channels corresponding to the sampling pulses with overlapping pulse time periods.

[0019] The pulse time period includes the time period from the pulse start time to the pulse end time of the sampling pulse signal.

[0020] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0021] According to a fourth aspect of an embodiment of the present application, a readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0022] Compared with the prior art, the embodiments of the present application have at least the following beneficial effects: the embodiments of the present application establish a closed path outside the DI module, send a diagnostic pulse signal to each output pin in a time-sharing manner, then obtain a sampling signal of the response and analyze whether there is a pulse time overlap in the sampling pulse signal in the sampling signal, so as to determine whether there is crosstalk adhesion in the signal channel of the DI module. If there are at least two sampling pulse signals in the response with pulse time overlap, there is a crosstalk fault between at least two signal channels in the current DI module. The present embodiment can efficiently and accurately analyze the crosstalk fault in the DI module, thereby improving the inspection efficiency and use safety of the DI module. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0024] Figure 1 It is a flowchart of a diagnostic method of a DI module provided in an embodiment of the present application;

[0025] Figure 2 It is a schematic diagram of an application scenario of an embodiment of the present application;

[0026] Figure 3 It is a schematic diagram of time-sharing transmission of a diagnostic pulse signal provided in an embodiment of the present application;

[0027] Figure 4 It is a structural schematic diagram of a diagnostic device for a DI module provided in an embodiment of the present application;

[0028] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0030] A diagnostic method, device, electronic device, and readable storage medium for a DI module according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0031] Figure 1 It is a flowchart of a diagnostic method for a DI module provided in an embodiment of the present application. Figure 1 The diagnostic method can be executed by the MCU (Microcontroller Unit) of the DI module. There is a closed path outside the DI module between the output pin and the sampling pin of each signal channel of the DI module, such as Figure 1 As shown, diagnostic methods include:

[0032] S101: Sending a diagnostic pulse signal to the output pin of each signal channel in a time-sharing manner;

[0033] S102: receiving a sampling signal from a sampling pin of each signal channel;

[0034] S103: traverse each sampling signal and determine a sampling pulse signal in each sampling signal;

[0035] S104: Determine whether there are at least two sampling pulse signals with overlapping pulse time periods;

[0036] S105: When there are at least two sampling pulse signals with overlapping pulse time periods, it is determined that there is a crosstalk fault between signal channels corresponding to the sampling pulses with overlapping pulse time periods;

[0037] The pulse time period includes the time period from the pulse start time to the pulse end time of the sampling pulse signal.

[0038] Specifically, Figure 2 The following is a schematic diagram of an application scenario of an embodiment of the present application, wherein the MCU is the execution subject of the method of the present embodiment. Figure 2 Take a DI module including four signal channels as an example. The four signal channels are CH1-CH4 in sequence. The output pin of each signal channel is marked as output, and the sampling pin of each signal channel is marked as input. Outside the DI module, there is a closed path between the output pin and the sampling pin of the same signal channel. In essence, the closed path is a closed link connecting the output pin and the sampling pin of the same signal channel, thereby providing an external communication basis for the normal communication of the signal channel. Usually, a closed path outside the DI module is composed of an external load, a connecting line connecting the external load and the output pin, and a connecting line connecting the external load and the sampling pin. Here, the external load is generally a digital meter to adapt to the current DI module of the object to be measured. Therefore, in this embodiment, there are:

[0039] The output pin and the sampling pin of each signal channel of the DI module are connected through a digital meter to form a closed path.

[0040] Specifically, the digital meter can be a switch, a safety mat or other types of digital meters, which are not limited here. Figure 2 As shown in , K1-K4 are digital meters in the closed path outside the current DI module.

[0041] It can be understood that, in this embodiment, based on the hardware connection between the DI module and the external closed path, the method in this embodiment is implemented by the MCU. When any output pin in the DI module receives a pulse diagnostic signal, it sends a pulse diagnostic signal to the outside. At this time, the pulse diagnostic signal will return to the sampling pin through the closed path. The MCU can collect the sampling signal received by the sampling pin. Based on the diagnostic pulse signal sent by the MCU to the output pin and the received sampling signal, fault diagnosis can be performed on each signal path of the current MCU.

[0042] Specifically, the fault diagnosis in this embodiment is mainly crosstalk fault diagnosis, which is used to diagnose whether there is crosstalk between signal channels. Crosstalk refers to the noise on the line caused by the coupling between two signal channels, the mutual inductance and mutual capacitance between the signal channels. The most common manifestation of crosstalk between two signal channels is that when one signal channel transmits a signal normally, the other signal channel is affected by the signal and the signal level transmitted by itself changes, wherein the former signal channel is the interference channel and the latter signal channel is the disturbed channel.

[0043] Therefore, the essential principle of the crosstalk fault analysis in this embodiment is to analyze whether other signal channels are interfered when each interfering channel performs normal signal transmission based on the diagnostic pulse signal. Therefore, in the method of this embodiment, a diagnostic pulse signal is sent to each output pin in a time-sharing manner, and a corresponding sampling signal is received. The performance of the sampling pulse signal in each sampling signal is analyzed to determine whether each signal channel is interfered with by the communication of other signal channels, that is, whether there is a crosstalk fault.

[0044] It can be understood that sending a diagnostic pulse signal to the output pin of each signal channel in time means that a diagnostic pulse signal can only be sent to the output pin of one signal channel at a time, and there is no possibility that multiple output pins receive diagnostic pulse signals at the same time. The pulse time periods of the diagnostic pulse signals of each output pin do not overlap. The output pin of each signal channel corresponds to the sampling pin, and the diagnostic pulse signal corresponds to the sampling pulse signal. Since all diagnostic pulse signals are sent in time, it can be ensured that the theoretical expected pulse time periods of the sampling pulse signals received by the sampling pins do not overlap. At this time, if the actual sampling pulse signal has overlapping pulse time periods, that is, it does not meet theoretical expectations, then there is a crosstalk fault between the signal channels with overlapping pulse time periods.

[0045] Furthermore, in order to improve the diagnostic efficiency, a diagnostic pulse signal is sent to the output pin of each signal channel in a time-sharing manner. The pulse diagnostic signal is usually sent at regular time intervals. The process of sending the diagnostic pulse signal to the output pin of each signal channel in a time-sharing manner includes:

[0046] Sending a diagnostic pulse signal to the output pin of each signal channel in turn according to a preset time interval;

[0047] The pulse width of each pulse diagnosis signal is smaller than the preset time interval.

[0048] It is understandable that setting a regular signal transmission method can further standardize the diagnosis process and improve the diagnosis efficiency. The specific values ​​of the pulse width and the preset time interval of the pulse diagnosis signal need to be selected according to actual needs and actual hardware conditions.

[0049] Specifically, if the pulse width is too small, the pulse width of the sampling pulse signal will also be very small. Limited by the sensitivity of the sampling pin, the too narrow sampling pulse signal may not be recognized and sampled by the sampling pin; if the pulse width is too large, the pulse diagnosis signal sent will affect the external circuit of the DI module. Therefore, in this embodiment, an appropriate pulse width is required, and the pulse width value range can be 300us-2ms, preferably 350us.

[0050] Similarly, if the preset time interval is too small, it is difficult to distinguish whether the sampling pulse signal is a normal response of the signal channel or crosstalk noise of other signal channels. If the preset time interval is too large, the test efficiency is reduced, increasing time and device costs. Therefore, an appropriate preset time interval is required in this embodiment, and the value range of the preset time interval can be 1-200ms, preferably 10ms.

[0051] Figure 3 This is a schematic diagram of a specific time-sharing transmission of a diagnostic pulse signal, taking a DI module including four signal channels, a preset time interval of 1ms, and a pulse width of 350us as an example.

[0052] In fact, for the pulse diagnosis signal of the same signal channel, the pulse diagnosis signal itself can also be a periodic signal, and the pulse period is required to be no less than the preset time interval × N, where N is a positive integer, meaning the number of signal channels, that is, to ensure that at most one signal channel has a pulse diagnosis signal at the same time. Figure 3 For example, the pulse period is set to 4ms.

[0053] It can be understood that, for a sampling pin, the sampling signal of the sampling pin refers to the set of signal levels at all sampling moments continuously received by the sampling pin. For each sampling moment, its signal level is high or low. By traversing and analyzing the complete sampling signal, the sampling pulse signal in the sampling signal can be determined. If the signal level in the sampling signal is high by default, and suddenly drops to a low level, and the low level is maintained for a period of time and then rises to a high level again, then the low level part is regarded as the sampling pulse signal. Therefore, the sampling pulse signal is identified by the level mutation of the sampling signal, and the level mutation edge is used as the pulse start time and pulse end time of the sampling pulse signal. The pulse time period is from the pulse start time to the pulse end time. Therefore, the process of traversing each sampling signal and determining the sampling pulse signal in each sampling signal includes:

[0054] Traverse each sampling signal, mark the falling edge flag bit at the time corresponding to the falling edge of the level of each sampling signal, and mark the rising edge flag bit at the time corresponding to the rising edge of the level of each sampling signal;

[0055] For each sampling level, the pulse start time and pulse end time of the sampling pulse signal are determined based on the corresponding falling edge flag bit and rising edge flag bit.

[0056] It can be understood that the level mutation edge includes the level falling edge and the level rising edge. When determining the pulse start time and the pulse end time, it is necessary to understand the default signal level of the sampling signal when there is no diagnostic pulse signal by default, so as to take the moment when the signal level suddenly changes from the default signal level as the pulse start time, and the moment when the signal level returns to the default signal level as the pulse end time. For example, if the default signal level in the sampling signal is a high level, the falling edge flag bit when it suddenly drops to a low level corresponds to the pulse start time, and the low level rises to a high level again after a period of time, then the rising edge flag bit corresponds to the pulse end time, and the low level part is regarded as the sampling pulse signal. The judgment method when the default signal level in the sampling signal is a low level is exactly the opposite.

[0057] It can be understood that when determining the sampling pulse signal, the pulse start time and pulse end time of the sampling pulse signal have been determined. Based on the time information of all sampling pulse signals, it is possible to analyze whether there is overlap in time periods between these sampling pulse signals. Among them, the determination of time period overlap can be strict complete overlap, that is, the pulse start time is the same and the pulse end time is the same, or there can be a true inclusion relationship between the two time periods, that is, the time period of sampling pulse signal 1 includes the time period of sampling pulse signal 2, or there can be an intersection relationship between the two time periods, that is, there is an overlap of some time periods. Taking into account the hardware delay and error of the signal channel, the possibility of complete overlap is small, and the overlap of most of the time periods that is not strict can be used as the basis for determination, thereby avoiding the neglect of faults with weak crosstalk effects. Specifically, the process of determining whether there are at least two sampling pulse signals with overlapping pulse time periods includes:

[0058] Determine whether there are at least two sampling pulse signals that meet the preset time condition; the preset time condition is that the time difference between the pulse start time of any two sampling pulse signals is less than the preset difference and the time difference between the pulse end time is less than the preset difference;

[0059] If so, it is determined that the at least two sampling pulse signals satisfying the preset time condition are at least two sampling pulse signals having overlapping pulse time periods.

[0060] It is understandable that the preset difference value set for the time difference is an adjustable parameter set to consider hardware errors and redundancy, which can be adjusted according to the diagnostic requirements. If the diagnostic requirement is that the stricter the judgment, the better, the preset difference value is smaller. If the diagnostic requirement is that the more comprehensive the judgment, the better, the preset difference value is larger to ensure that the fault with weaker crosstalk effect is accurately located. It is understandable that in order to ensure that there is overlap of pulse time periods, the value of the preset difference value is required to be no greater than the pulse width of the diagnostic pulse signal.

[0061] Furthermore, when it is known that there is a crosstalk fault between two signal channels, the interfering signal channel and the disturbed signal channel in the two signal channels can be further determined based on the diagnostic pulse signal of the excitation pulse time period overlap phenomenon. Specifically, when there are at least two sampling pulse signals with overlapping pulse time periods, after determining that there is a crosstalk fault between the signal channels corresponding to the sampling pulses with overlapping pulse time periods, it also includes:

[0062] When a crosstalk fault occurs between at least two signal channels in the DI module, all signal channels between which the crosstalk fault occurs are regarded as a channel group;

[0063] For each channel group, the excitation pulse signals corresponding to all sampling pulse signals are analyzed, and the excitation pulse signal is: among all the diagnostic pulse signals, the diagnostic pulse signal that enables each signal channel in the current channel group to generate a corresponding sampling pulse signal;

[0064] Based on the excitation pulse signal, the interfering channel and the disturbed channel in each channel group are determined.

[0065] It can be understood that when there is no crosstalk fault in the DI module, a diagnostic pulse signal is sent to a signal channel, and only the sampling pin of this signal channel will receive the sampling pulse signal corresponding to the diagnostic pulse signal. However, if another signal channel is affected by the crosstalk of this signal channel, the sampling pin of the other signal channel will also receive the sampling pulse signal corresponding to the diagnostic pulse signal. At this time, the former signal channel is the interfering channel, and the latter signal channel is the disturbed channel.

[0066] It is understandable that the above descriptions of crosstalk faults mostly take two signal channels as examples, but in fact, there is a possibility of crosstalk faults between signal channels in the DI module, crosstalk faults may exist between multiple signal channels, one interfering channel may correspond to multiple disturbed channels, and one communication channel may be subject to crosstalk from multiple interfering channels. Therefore, based on all diagnostic pulse signals and all sampled diagnostic signals, the relationship between each signal channel in the crosstalk fault can be specifically located.

[0067] It is understandable that, in this embodiment, each signal channel can determine whether the communication of each signal channel itself is normal according to whether the sampling signal correctly responds to the diagnostic pulse signal. Therefore, the diagnostic method of this embodiment also includes:

[0068] For each signal channel, do the following:

[0069] Analyze whether there is a sampling pulse signal in the sampling signal;

[0070] If not, it is determined that there is a communication fault in the signal channel;

[0071] If so, compare whether the pulse widths of the diagnostic pulse signal and the sampling pulse signal are the same;

[0072] If the pulse widths of the diagnostic pulse signal and the sampling pulse signal are different, it is determined that there is a communication fault in the signal channel;

[0073] If the pulse width of the diagnostic pulse signal is the same as that of the sampling pulse signal, it is determined that there is no communication fault in the signal channel.

[0074] Furthermore, when the diagnostic pulse signal is a periodic signal, it is also possible to determine whether there is a communication fault based on whether the pulse period of the diagnostic pulse signal is consistent with the pulse period of the sampling pulse signal. If the pulse periods of the two are inconsistent, it is determined that there is a communication fault in the signal channel. If the pulses of the two are consistent, it is determined that there is no communication fault in the signal channel.

[0075] The method of the embodiment of the present application establishes a closed path outside the DI module, sends a diagnostic pulse signal to each output pin in a time-sharing manner, then obtains the response sampling signal and analyzes whether the sampling pulse signal in the sampling signal has a pulse time period overlap, so as to determine whether there is crosstalk adhesion in the signal channel of the DI module. If at least two sampling pulse signals in the response have a pulse time period overlap, there is a crosstalk fault between at least two signal channels in the current DI module. This embodiment can efficiently and accurately analyze the crosstalk fault in the DI module, thereby improving the inspection efficiency and use safety of the DI module.

[0076] All the above optional technical solutions can be combined in any way to form optional embodiments of the present application, and will not be described in detail here. It should be understood that the size of the sequence number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

[0077] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0078] Figure 4 is a schematic diagram of a diagnostic device for a DI module provided in an embodiment of the present application. There is a closed path outside the DI module between the output pin and the sampling pin of each signal channel of the DI module, such as Figure 4 As shown, the diagnostic device comprises:

[0079] The excitation module 401 is used to send a diagnostic pulse signal to the output pin of each signal channel in a time-sharing manner;

[0080] The sampling module 402 is used to receive the sampling signal of the sampling pin of each signal channel;

[0081] A preprocessing module 403 is used to traverse each sampling signal and determine a sampling pulse signal in each sampling signal;

[0082] The analysis module 404 is used to determine whether there are at least two sampling pulse signals with overlapping pulse time periods. When there are at least two sampling pulse signals with overlapping pulse time periods, it is determined that there is a crosstalk fault between the signal channels corresponding to the sampling pulses with overlapping pulse time periods.

[0083] The pulse time period includes the time period from the pulse start time to the pulse end time of the sampling pulse signal.

[0084] The device of the embodiment of the present application establishes a closed path outside the DI module, sends a diagnostic pulse signal to each output pin in a time-sharing manner, then obtains the response sampling signal and analyzes whether the sampling pulse signal in the sampling signal has a pulse time period overlap, so as to determine whether there is crosstalk adhesion in the signal channel of the DI module. If at least two sampling pulse signals in the response have a pulse time period overlap, there is a crosstalk fault between at least two signal channels in the current DI module. This embodiment can efficiently and accurately analyze the crosstalk fault in the DI module, thereby improving the inspection efficiency and use safety of the DI module.

[0085] In an exemplary embodiment, the incentive module 401 is specifically used for:

[0086] Sending a diagnostic pulse signal to the output pin of each signal channel in turn according to a preset time interval;

[0087] The pulse width of each pulse diagnosis signal is smaller than the preset time interval.

[0088] In an exemplary embodiment, the preprocessing module 403 is specifically used for:

[0089] Traverse each sampling signal, mark the falling edge flag bit at the time corresponding to the falling edge of the level of each sampling signal, and mark the rising edge flag bit at the time corresponding to the rising edge of the level of each sampling signal;

[0090] For each sampling level, the pulse start time and pulse end time of the sampling pulse signal are determined based on the corresponding falling edge flag bit and rising edge flag bit.

[0091] In an exemplary embodiment, the analysis module 404 is specifically configured to:

[0092] Determine whether there are at least two sampling pulse signals that meet the preset time condition; the preset time condition is that the time difference between the pulse start time of any two sampling pulse signals is less than the preset difference and the time difference between the pulse end time is less than the preset difference;

[0093] If so, it is determined that the at least two sampling pulse signals satisfying the preset time condition are at least two sampling pulse signals having overlapping pulse time periods.

[0094] In an exemplary embodiment, an output pin and a sampling pin of each signal channel of the DI module are connected via a digital meter to form a closed path.

[0095] In an exemplary embodiment, the analysis module 404 is further configured to:

[0096] When a crosstalk fault occurs between at least two signal channels in the DI module, all signal channels between which the crosstalk fault occurs are regarded as a channel group;

[0097] For each channel group, the excitation pulse signals corresponding to all sampling pulse signals are analyzed, and the excitation pulse signal is: among all the diagnostic pulse signals, the diagnostic pulse signal that enables each signal channel in the current channel group to generate a corresponding sampling pulse signal;

[0098] Based on the excitation pulse signal, the interfering channel and the disturbed channel in each channel group are determined.

[0099] In an exemplary embodiment, the analysis module 404 is further configured to:

[0100] For each signal channel, do the following:

[0101] Analyze whether there is a sampling pulse signal in the sampling signal;

[0102] If not, it is determined that there is a communication fault in the signal channel;

[0103] If so, compare whether the pulse widths of the diagnostic pulse signal and the sampling pulse signal are the same;

[0104] If the pulse widths of the diagnostic pulse signal and the sampling pulse signal are different, it is determined that there is a communication fault in the signal channel;

[0105] If the pulse width of the diagnostic pulse signal is the same as that of the sampling pulse signal, it is determined that there is no communication fault in the signal channel.

[0106] Figure 5 Schematic diagram of an electronic device 5 provided in an embodiment of the present application. Figure 5 As shown, the electronic device 5 of this embodiment includes: a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501. When the processor 501 executes the computer program 503, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 501 executes the computer program 503, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0107] The electronic device 5 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 5 may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will appreciate that Figure 5 The electronic device 5 is merely an example and does not limit the electronic device 5 , and may include more or less components than those shown in the figure, or different components.

[0108] The processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0109] The memory 502 may be an internal storage unit of the electronic device 5, for example, a hard disk or memory of the electronic device 5. The memory 502 may also be an external storage device of the electronic device 5, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 5. The memory 502 may also include both an internal storage unit of the electronic device 5 and an external storage device. The memory 502 is used to store computer programs and other programs and data required by the electronic device.

[0110] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0111] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the readable storage medium does not include electric carrier signals and telecommunication signals.

[0112] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A diagnostic method for a DI digital input module, characterized in that: The MCU microcontroller unit applied to the DI module, there is a closed path outside the DI module between the output pin and the sampling pin of each signal channel of the DI module, and the diagnostic method includes: Sending a diagnostic pulse signal to the output pin of each signal channel in a time-sharing manner; Receiving a sampling signal from the sampling pin of each of the signal channels; Traversing each of the sampling signals, and determining a sampling pulse signal in each of the sampling signals; Determining whether there are at least two of the sampling pulse signals with overlapping pulse time periods; When the pulse time periods of at least two of the sampling pulse signals overlap, it is determined that a crosstalk fault exists between the signal channels corresponding to the sampling pulses with overlapping pulse time periods; The pulse time period includes a time period from a pulse start time to a pulse end time of the sampling pulse signal.

2. The diagnostic method according to claim 1, characterized in that The process of sending a diagnostic pulse signal to the output pin of each signal channel in a time-sharing manner includes: Sending a diagnostic pulse signal to the output pin of each of the signal channels in turn according to a preset time interval; The pulse width of each of the pulse diagnostic signals is smaller than the preset time interval.

3. The diagnostic method according to claim 1, characterized in that: The process of traversing each of the sampling signals and determining the sampling pulse signal in each of the sampling signals includes: Traversing each of the sampling signals, marking a falling edge flag at the moment corresponding to the falling edge of the level of each sampling signal, and marking a rising edge flag at the moment corresponding to the rising edge of the level of each sampling signal; For each of the sampling levels, the pulse start time and the pulse end time of the sampling pulse signal are determined based on the corresponding falling edge flag bit and rising edge flag bit.

4. The diagnostic method according to claim 1, characterized in that: The process of determining whether there are at least two sampling pulse signals with overlapping pulse time periods includes: Determine whether there are at least two of the sampling pulse signals that meet a preset time condition; the preset time condition is that the time difference between the pulse start time of any two of the sampling pulse signals is less than a preset difference and the time difference between the pulse end time is less than the preset difference; If so, it is determined that the at least two sampling pulse signals satisfying the preset time condition are at least two sampling pulse signals having overlapping pulse time periods.

5. The diagnostic method according to claim 1, characterized in that: The output pin and the sampling pin of each signal channel of the DI module are connected via a digital meter to form the closed path.

6. The diagnostic method according to claim 1, characterized in that: When the pulse time periods of at least two sampling pulse signals overlap, after determining that there is a crosstalk fault between the signal channels corresponding to the sampling pulses with overlapping pulse time periods, the method further includes: When a crosstalk fault occurs between at least two of the signal channels in the DI module, all the signal channels between which the crosstalk fault occurs are regarded as a channel group; For each channel group, analyzing the excitation pulse signals corresponding to all the sampling pulse signals, the excitation pulse signal being: among all the diagnostic pulse signals, the diagnostic pulse signal that enables each signal channel in the current channel group to generate the sampling pulse signal accordingly; Based on the excitation pulse signal, an interfering channel and a disturbed channel in each of the channel groups are determined.

7. The diagnostic method according to any one of claims 1 to 6, characterized in that: Also includes: For each of the signal channels, do the following: Analyzing whether the sampling pulse signal exists in the sampling signal; If not, it is determined that there is a communication failure in the signal channel; If so, comparing whether the pulse widths of the diagnostic pulse signal and the sampling pulse signal are the same; If the pulse widths of the diagnostic pulse signal and the sampling pulse signal are different, it is determined that a communication fault exists in the signal channel; If the pulse widths of the diagnosis pulse signal and the sampling pulse signal are the same, it is determined that there is no communication failure in the signal channel.

8. A diagnostic device for a DI module, characterized in that: There is a closed path outside the DI module between the output pin and the sampling pin of each signal channel of the DI module, and the diagnostic device includes: An excitation module, used for sending a diagnostic pulse signal to the output pin of each signal channel in a time-sharing manner; A sampling module, used for receiving a sampling signal from the sampling pin of each of the signal channels; A preprocessing module, used for traversing each of the sampling signals and determining a sampling pulse signal in each of the sampling signals; An analysis module, used for judging whether there are at least two sampling pulse signals with overlapping pulse time periods, and when there are at least two sampling pulse signals with overlapping pulse time periods, judging that there is a crosstalk fault between the signal channels corresponding to the sampling pulses with overlapping pulse time periods; The pulse time period includes a time period from a pulse start time to a pulse end time of the sampling pulse signal.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.