A test circuit and test method for minimum sampling time of analog input card
By designing a test circuit including switch on-off instruments, electromagnetic relays and controllers, the problem that existing test instruments cannot effectively test the minimum sampling time of analog input card parts, and the accurate determination of the sampling time of analog input card parts and the adaptation of diversified signals is achieved.
Patent Information
- Application Number
- CN202110541421.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-18
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2041-05-18
AI Technical Summary
Existing test instruments cannot effectively test the minimum sampling time of analog input cards, especially in the generation of fixed number of analog signal pulses.
A test circuit for the minimum sampling time of analog input card is designed, including a switch on-off instrument, electromagnetic relay, DC power supply, analog signal, analog input card and controller. Through the input of switching pulses and analog signal with equal pulse width and high and low value of analog input, the sampling time of analog input card is realized.
This test method can accurately measure the minimum sampling time of the analog input card, with simple operation and accurate test results. It is suitable for a variety of analog signal types, and has a convenient test environment and few personnel requirements.
Smart Images

Figure CN113253029B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a test circuit and a test method for a minimum sampling time of an analog quantity input card, belonging to the technical field of industrial control. Background Art
[0002] Analog input cards are widely used in distributed control systems in the fields of thermal power, chemical industry, shipbuilding, new energy, etc. Analog input cards include current input cards, resistance input cards and capacitance input cards. Distributed control systems have performance requirements for the minimum sampling time of analog quantities, so it is necessary to test the minimum sampling time of analog input cards. After a fixed number of analog pulse signals are sent, if the number of pulses received by the analog input card is consistent with the number of pulses sent, the analog card works normally under this sampling time. The current test instrument can realize a fixed number of switch on-off pulses, cannot generate a fixed number of analog signal pulses, and cannot adapt to the diversity of analog signals.
[0003] Therefore, those skilled in the art need to find a technical solution to solve the working method problem in the analog input card testing phase. Summary of the invention
[0004] The technical problem to be solved by the present invention is to overcome the defects of the prior art and provide a test circuit and a test method for the minimum sampling time of an analog input card.
[0005] In order to solve the above technical problems, the present invention provides a test circuit for the minimum sampling time of an analog input card, comprising:
[0006] Switch on / off instrument, electromagnetic relay, DC power supply, first analog signal, second analog signal, analog input card, controller and logic configuration;
[0007] The electromagnetic relay comprises a power supply path, a normally closed path, a normally open path and an output terminal;
[0008] The switch-on-off instrument is connected in series with the DC power supply to the power supply path, and the switch-on-off instrument is used to provide adjustable equal pulse width, equal period and fixed number of switch pulses;
[0009] The first analog signal is connected to the first channel, which is a normally closed channel, and the second analog signal is connected to the second channel, which is a normally open channel. The output end is connected to the communication terminal of the analog input card, which is used to provide high and low value inputs to the analog input card;
[0010] The controller and the analog input card are connected in the cabinet through the bus terminal, which is used to collect the input value of the analog input card and output the number of high and low value square waves of the analog input.
[0011] Furthermore, the switching pulses with equal pulse width, equal period and fixed number have a pulse width of T0, a period of 2*T0, and a fixed number of pulses, set to Qty0, which satisfies the condition that the relay power supply is connected for T0 time and disconnected for T0 time, wherein the pulse width is adjusted by the switch on-off instrument.
[0012] Furthermore, the signal types of the first analog signal and the second analog signal are current signals, voltage signals or resistance signals.
[0013] Furthermore, the controller is only connected to one analog input card.
[0014] Furthermore, the controller is configured to scan the analog input card in an independent cycle through software logic settings.
[0015] Furthermore, the time of the independent cycle is less than the sampling time of the analog input card.
[0016] A method for testing a circuit for testing a minimum sampling time of an analog quantity input card, comprising:
[0017] 1) Initialize the analog square wave count value Qyt1 controlled by the controller to 0;
[0018] 2) Use a switch on-off instrument and a DC power supply to perform on-off switching of the power supply path of the electromagnetic relay with equal pulse width and period and a certain number Qty0, where the pulse width is T0 and the period is 2*T0.
[0019] 3) Accessing the first analog signal and the second analog signal through a normally open path and a normally closed path respectively;
[0020] 4) Use the controller to scan the input value of the analog input card;
[0021] 5) Perform logical operations on the scanned analog input card input values to determine the high and low values of the analog input card input values. Each time the analog input card input value changes, the controller controls the analog square wave count value Qyt1 to increase by 1 until the on-off switching times reaches Qty0, and obtains the analog square wave count value Qyt1 at this time;
[0022] 6) Compare Qty0 with Qty1,
[0023] When Qty0=Qty1, reduce the pulse width T0 and repeat steps 1) to 6) until Qty0>Qty1;
[0024] Repeat steps 1) to 6) for pulse width T0 that satisfies Qty0=Qty1 N times. If Qty0=Qty1 is not satisfied once, increase pulse width T0 and repeat steps 1) to 6) until Qty0=Qty1 is satisfied N times. Confirm that the minimum sampling time T of the analog card is T0 at this time.
[0025] Furthermore, the first analog signal is connected to the normally closed path of the electromagnetic relay. When the electromagnetic relay is not powered, the normally closed path is connected to the output end, and the first analog signal is input to the analog input card.
[0026] The second analog signal is connected to the normally open path of the electromagnetic relay. When the electromagnetic relay is powered on, the normally open path is connected to the output end, and the second analog signal is input to the analog input card.
[0027] Furthermore, the analog input card is connected to a controller, and the controller scans the analog input card in an independent cycle; the independent cycle of the controller scanning the analog input card is shorter than the sampling time of the analog card.
[0028] Furthermore, in step 6), if Qty1=Qty0, then steps 1) to 5) are repeated N times with the pulse width T0 at this time to obtain the analog square wave count value Qty1;
[0029] If Qty0=Qty1 is satisfied for N times, then the output T0 at this time is the minimum sampling time T of the analog input card;
[0030] If Qty0=Qty1 is not satisfied once, increase the pulse width of T0 and repeat steps 1) to 5) N times until Qty0=Qty1 is satisfied N times. The output T0 at this time is the minimum sampling time T of the analog input card.
[0031] The beneficial effects achieved by the present invention are:
[0032] Analog signals can be various, such as current, voltage, resistance and capacitance. The types of current, voltage, resistance and capacitance can be various, as long as they are within the range of the analog input card.
[0033] During the execution process, the operation is simple and the test can be repeated many times to obtain more accurate test results.
[0034] The test instrument can be flexible and the type of relay can be varied, as long as it can meet the requirements of path switching. The instrument that emits equal pulse width T0 and fixed number Qty0 can be varied, as long as it can provide equal pulse width T0 and fixed number Qty0 on and off of the relay power supply line switch. The logic configuration method can be changed, as long as the number of high and low value changes can be obtained.
[0035] The built test environment is convenient, requires few people, and can be operated by one person. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic diagram of a data sampling process of an analog input card provided in an embodiment of the present invention;
[0037] Figure 2 A framework diagram of a method for testing the minimum sampling time of an analog input card provided by an embodiment of the present invention;
[0038] Figure 3 A flow chart of a method for testing the minimum sampling time of an analog input card provided by an embodiment of the invention;
[0039] Figure 4 A structural block diagram of a relay wiring method provided by an embodiment of the present invention;
[0040] Figure 5 This is a schematic diagram of the logical configuration in the controller. DETAILED DESCRIPTION
[0041] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] The technical solution of the present invention is further described below with reference to the accompanying drawings and through specific implementation methods. Example
[0043] like Figure 1 As shown, the minimum sampling time of the analog input card mentioned in this embodiment is the time required for the analog card to ensure that the channel input can be collected. However, it does not include the time for triggering the analog input signal and the time for the controller to scan the card and calculate the number of high and low value changes. Therefore, the measurement of the minimum sampling time of the analog input card is affected by four factors:
[0044] 1. Time accuracy error of the switch on and off instrument;
[0045] 2. Relay response time error;
[0046] 3. The controller scans the analog card time;
[0047] 4. The controller calculates the number of times the high and low values change;
[0048] Preferably, in this embodiment, a high-precision on-off instrument is used to trigger the on-off of the power supply circuit, and the error is at the microsecond level, so the influence of the time accuracy error of the on-off instrument can be ignored.
[0049] Preferably, in this embodiment, the time for the controller to scan the analog card is controlled to be 1 ms through configuration, so the influence of the time for the controller to scan the analog card can also be ignored.
[0050] In this embodiment, preferably, the reaction time error of the relay is about 4ms. When the reaction times required for opening and closing of the relay cancel each other out, the occupied time of channel 1 and channel 2 is closer to the pulse width triggered by the switch on-off instrument.
[0051] The controller calculates the number of high and low value changes in a cycle set to 10ms, and the operation time is distributed within 0~10ms.
[0052] Preferably, in this embodiment, when executing the test activity, it is necessary to sample the system under test multiple times, and the sampling needs to be verified multiple times to be correct before the result is used as the final test result.
[0053] like Figure 2 As shown, in this embodiment, a test circuit for a minimum sampling time of an analog input card component includes:
[0054] Switch on / off instrument, electromagnetic relay, DC power supply, first analog signal, second analog signal, analog input card, controller and logic configuration;
[0055] The electromagnetic relay comprises a power supply path, a normally closed path, a normally open path and an output terminal;
[0056] The switch-on-off instrument is connected in series with the DC power supply to the power supply path, and the switch-on-off instrument is used to provide adjustable equal pulse width, equal period and fixed number of switch pulses;
[0057] The first analog signal is connected to the normally closed path, the second analog signal is connected to the normally open path, and the output end is connected to the communication terminal of the analog input card component, which is used to provide high and low value inputs to the analog input card component;
[0058] The controller is connected to the analog input card to collect the high and low values of the analog input card input and output the number of high and low value square waves of the analog input.
[0059] The switch pulses with equal pulse width, equal period and fixed number are pulse width T0, period 2*T0, number Qty0, satisfying the pulse that the relay power is connected for T0 time and disconnected for T0 time, wherein the pulse width is adjusted by the switch on-off instrument.
[0060] The first analog signal and the second analog signal are current signals, voltage signals, resistance signals or capacitance signals.
[0061] The controller is connected to only one analog input card; the controller scans the analog input card in an independent cycle; and the time of the independent cycle is less than the sampling time of the analog input card.
[0062] In this embodiment, the model of the controller used is maxICSFT2000.
[0063] This embodiment provides a method for testing the minimum sampling time of an analog input card, including:
[0064] The switch on-off instrument under test is switched on and off with equal pulse width and period and a certain number of Qty0, where the pulse width is T0 and the period is 2*T0.
[0065] A switch on / off instrument is connected in series to the power supply circuit of the electromagnetic relay under test, thereby switching the circuit of the electromagnetic relay is achieved.
[0066] The normally open-common path and the normally closed-common path of the electromagnetic relay under test are respectively connected to analog signal 1 and analog signal 2, providing two-channel analog signal input.
[0067] Connect the analog card channel terminals to the electromagnetic relay.
[0068] Scan the analog card input value of the controller under test.
[0069] The input value of the analog card being tested is logically configured to determine the high and low values of the channel. Each time the input value of the analog card changes, the analog square wave count value increases by 1. The analog square wave count value is Qyt1.
[0070] When Qyt1=Qyt0, the on-off pulse width T0 being tested is gradually reduced, so that the sampling time of the analog card is gradually reduced, until the analog card cannot collect all the high and low values by reducing the channel pulse width T0. Then it can be confirmed that the minimum sampling time T of the analog card is T0 at this time.
[0071] like Figure 3 As shown, this embodiment provides a method for testing the minimum sampling time of an analog input card, the method steps comprising:
[0072] 1) Set the count value Qty1 used to determine the high and low value changes of the analog input in the logic configuration to 0 initially.
[0073] 2) Implement a fixed number of on-off pulses Qty0 and equal pulse width T0 on the power supply line switch of the electromagnetic relay under test. Qy0 is set to 20.
[0074] 3) Check the count value Qty1 collected by the analog input card in the logic configuration.
[0075] 4) Compare Qty0 and Qty1. When Qty0=Qty1, reduce the pulse width T0 and repeat steps 1 to 3 until Qty0>Qty1.
[0076] 5) Repeat steps 1 to 3 N times for the pulse width T0 that just satisfies Qty0=Qty1. If Qty0=Qty1 is not satisfied once, increase the pulse width T0 appropriately and repeat steps 1 to 3 until Qty0=Qty1 is satisfied N times. N is 20.
[0077] 6) The minimum sampling time T of the analog card can be considered to be T0 at this time.
[0078] like Figure 4 As shown, a structural block diagram of a relay wiring method provided by an embodiment of the present invention is as follows:
[0079] 1) Connect terminals 1 and 2 to a DC 24V power supply.
[0080] 2), 3, and 4 are normally closed contacts. 5 and 6 are common terminals. 7 and 8 are normally open contacts.
[0081] 3) When the power is off, terminals 3 and 5 are connected. Terminals 4 and 6 are connected. When the power is on, terminals 7 and 5 are connected, and terminals 8 and 6 are connected.
[0082] When no power is supplied, the circuit loop is:
[0083] Analog signal 1 to terminal 3 to terminal 5 to analog card channel to terminal 6 to terminal 4 to analog signal 1. Path 1 is connected.
[0084] When power is on, the circuit loop is:
[0085] Analog signal 2 to terminal 7 to terminal 5 to analog card channel to terminal 6 to terminal 8 to analog signal 2. Path 2 is connected.
[0086] The analog signal is switched according to whether it is powered on or off.
[0087] like Figure 5 As shown, the schematic diagram of the logic configuration in the controller provided by the embodiment of the present invention is as follows:
[0088] The calculation block CALC judges the input analog signal value and takes an intermediate value between the high and low values. When the input value is a high value, the input value > the intermediate value, and the calculation block CALC output value is 1. When the input value is a low value, the input value < the intermediate value, and the calculation block CALC output value is 0.
[0089] The pulse block EdgeAny realizes that the output is 1 at both the rising and falling edges, and the output is 0 when the data is held. The output of the pulse block EdgeAny is connected to the accumulation block ADD1. The accumulation block ADD1 realizes the functions of resetting its own output value to 0 and accumulating input values. Before the experiment starts, reset the ADD1 block to 0. After the experiment, the output of the ADD1 block is Qyt1.
[0090] The pulse block EdgeRise realizes that the output is 1 at the rising edge and 0 in other cases. The output of the pulse block EdgeRise is connected to the accumulation block ADD2. The accumulation block ADD2 realizes the functions of resetting its own output value to 0 and accumulating input values. Before the experiment starts, reset the ADD2 block to 0. After the experiment, the output of the ADD2 block is Qyt2.
[0091] The pulse block EdgeFall realizes that the output is 1 at the falling edge and 0 in other cases. The output of the pulse block EdgeFall is connected to the accumulation block ADD3. The accumulation block ADD3 realizes the functions of resetting its own output value to 0 and accumulating input values. Before the experiment starts, reset the ADD3 block to 0. After the experiment, the output of the ADD3 block is Qyt3.
[0092] When actually testing the minimum sampling time of the analog input card, the operation steps are as follows:
[0093] Confirm that the control station under test is in normal operation.
[0094] Log in to the control station under test on the engineer station and enter the logical online configuration interface.
[0095] Confirm that there is only one analog card under the controller and ensure that the controller scans the analog card within 1ms.
[0096] Confirm that the operation cycle of the analog card buffer, CALC block, EdgeAny block, EdgeRise block, EdgeFall block, ADD1 block, ADD2 block, and ADD3 block associated with the logical configuration is 10ms.
[0097] Confirming that the power supply is on and off can realize the mutual switching of analog input signals. After each switching, the accumulated value of the ADD1 function block increases by 2, the accumulated value of the ADD2 function block increases by 1, and the accumulated value of the ADD3 function block increases by 1.
[0098] Reset the accumulator blocks ADD1, ADD2, and ADD3 online so that the output values of the ADD blocks are all 0.
[0099] Turn on the switch to turn the instrument on and off, set the pulse width to 500ms, and send 20 pulses.
[0100] Check the accumulator block ADD1 output value is 40, ADD2 output value is 20, and ADD3 output value is 20.
[0101] Reduce the pulse width value T0 and continue to send 20 pulses.
[0102] Repeat several times to find the minimum time T0 that the analog card can definitely collect the input signal. In order to make the test results more representative. Preferably, when the pulse width T0 that just makes Qty1=Qty0 is found, no less than 10 verification tests are performed, so that the minimum time required for analog quantity collection during the operation of the tested system can be more accurately reflected.
[0103] As shown in Table 1 below, the data are recorded in the actual test. According to the test results in this table, it can be determined that the minimum time for the analog card to collect the input signal is 125ms.
[0104] Sampling time (ms) QUR Qty1 Qty2 Qty3 500 20 40 20 20 250 20 40 20 20 167 20 40 20 20 125 20 40 20 20 124 20 38 19 19 123 20 36 18 18 122 20 32 17 15 126 20 40 20 20 125 20 40 20 20 125 20 40 20 20 125 20 40 20 20 125 20 40 20 20 125 20 40 20 20 125 20 40 20 20 125 20 40 20 20 125 20 40 20 20 125 20 40 20 20
[0105] Table 1. Data recorded in actual test
[0106] By adopting the above preferred technical solution of the present invention, at least one of the following beneficial effects can be obtained:
[0107] 1) Provides a test method for obtaining the minimum sampling time of analog input card components using existing test instruments.
[0108] 2) Analog signals can be various, such as current, voltage, resistance and capacitance. The types of current, voltage, resistance and capacitance can be various, as long as they are within the range of the analog input card.
[0109] 3) During the execution process, the operation is simple and the test can be repeated multiple times to obtain more accurate test results.
[0110] 4) The test instrument can be flexible and the type of relay can be varied, as long as it can meet the requirements of path switching. The instrument that emits equal pulse width T0 and fixed number Qty0 can be varied, as long as it can provide equal pulse width T0 and fixed number Qty0 on and off of the relay power supply line switch. The logic configuration method can be changed, as long as the number of high and low value changes can be obtained.
[0111] 5) The test environment is convenient to build and requires few people, so it can be operated by one person.
[0112] A person skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by replacing the relevant hardware and logic configuration. The type of the aforementioned relay can be varied, as long as it can meet the requirements of path switching. The instrument that emits equal pulse width T0 and fixed number Qty0 of equal period can be varied, as long as it can provide equal pulse width T0 and fixed number Qty0 on and off of the relay power supply line switch. The logic configuration method can be changed, as long as the number of high and low value changes can be obtained.
[0113] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, 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 invention.
Claims
1. A test circuit for the minimum sampling time of an analog input card, characterized in that: include: Switch on / off instrument, electromagnetic relay, DC power supply, first analog signal, second analog signal, analog input card, controller and logic configuration; The electromagnetic relay comprises a power supply path, a normally closed path, a normally open path and an output terminal; The switch-on-off instrument is connected in series with the DC power supply to the power supply path, and the switch-on-off instrument is used to provide adjustable equal pulse width, equal period and fixed number of switch pulses; The first analog signal is connected to the first channel, which is a normally closed channel, and the second analog signal is connected to the second channel, which is a normally open channel. The output end is connected to the communication terminal of the analog input card, which is used to provide high and low value inputs to the analog input card. One of the first analog signal and the second analog signal is a high value input, and the other is a low value input. The controller and the analog input card are connected in the cabinet through the bus terminal, which is used to collect the input value of the analog input card and output the number of high and low value square waves of the analog input; The signal types of the first analog signal and the second analog signal are current signals, voltage signals or resistance signals; and the controller is only connected to one analog input card.
2. The test circuit for the minimum sampling time of the analog input card according to claim 1, characterized in that: The switch pulses with equal pulse width, equal period and fixed number have a pulse width of T0, a period of 2*T0, and a fixed number of pulses, set to Qty0, which satisfies the pulse that the relay power is connected for T0 time and disconnected for T0 time, wherein the pulse width is adjusted by the switch on-off instrument.
3. The test circuit for the minimum sampling time of the analog input card according to claim 1, characterized in that: The controller scans the analog input card components in independent cycles through software logic settings.
4. The test circuit for the minimum sampling time of the analog input card according to claim 3, characterized in that: The time of the independent cycle is less than the sampling time of the analog input card.
5. A method for testing a circuit for testing the minimum sampling time of an analog input card according to claim 1, characterized in that: include: 1) Initialize the analog square wave count value Qyt1 controlled by the controller to 0; 2) Use a switch-on / off instrument and a DC power supply to switch the power supply path of the electromagnetic relay with equal pulse width and period and a certain number Qty0, where the pulse width is T0 and the period is 2*T0; 3) Accessing the first analog signal and the second analog signal through a normally open path and a normally closed path respectively; 4) Use the controller to scan the input value of the analog input card; 5) Perform logical operations on the scanned analog input card input values to determine the high and low values of the analog input card input values. Each time the analog input card input value changes, the controller controls the analog square wave count value Qyt1 to increase by 1 until the on-off switching times reaches Qty0, and obtains the analog square wave count value Qyt1 at this time; 6) Compare Qty0 with Qty1, When Qty0=Qty1, reduce the pulse width T0 and repeat steps 1) to 6) until Qty0>Qty1; Repeat steps 1) to 6) for pulse width T0 that satisfies Qty0=Qty1 N times. If Qty0=Qty1 is not satisfied once, increase pulse width T0 and repeat steps 1) to 6) until Qty0=Qty1 is satisfied N times. Confirm that the minimum sampling time T of the analog card is T0 at this time.
6. The testing method according to claim 5, characterized in that: The first analog signal is connected to the normally closed path of the electromagnetic relay. When the electromagnetic relay is not powered, the normally closed path is connected to the output end, and the first analog signal is input to the analog input card. The second analog signal is connected to the normally open path of the electromagnetic relay. When the electromagnetic relay is powered on, the normally open path is connected to the output end, and the second analog signal is input to the analog input card.
7. The testing method according to claim 5, characterized in that: The analog quantity input card is connected to the controller, and the controller scans the analog quantity input card according to an independent cycle; the independent cycle of the controller scanning the analog quantity input card is shorter than the sampling time of the analog quantity card.
Citation Information
Patent Citations
Test circuit for minimum sampling time of analog input card
CN216956184U