A real-time testing method for analog quantity acquisition in DCS system
By building an AI card internal resistance measurement circuit and controlling the on and off time of the switch signal generator, the problem of low test accuracy of current-type analog input cards is solved, the stable and adjustable amplitude of the current pulse signal is achieved, and the accuracy of real-time testing of analog acquisition is improved.
Patent Information
- Application Number
- CN202211091045.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-07
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-09-07
AI Technical Summary
The existing method for real-time data acquisition testing of current-type analog input cards cannot accurately control the amplitude of the output current pulse signal, resulting in low test accuracy.
By building an internal resistance measurement circuit for the AI card, connecting a switch signal generator to control the on and off time, building an analog real-time detection circuit, counting the number of current pulses and comparing them with the preset value, the analog real-time data width of the AI card is determined.
The stable adjustment of the current pulse signal amplitude is achieved, the test accuracy is improved, the output uncertainty problem caused by the uncertainty of the internal resistance of the card is overcome, and the accuracy of the real-time test of analog quantity acquisition is improved.
Smart Images

Figure CN116300781B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distributed control system (DCS) testing, and more particularly to a method for testing the real-time performance of analog quantity acquisition in a DCS system. Background Art
[0002] DCS performance testing is the most important method and means for DCS evaluation. It focuses on system application, assessing whether the system's actual performance meets predetermined requirements and expressing this information with quantified results. It also identifies potential faults and potential safety hazards in advance, improving and eliminating software and hardware defects to ensure the system's long-term, reliable, and stable operation. Among these, real-time analog acquisition testing is an essential step in verifying the performance of analog input cards in DCS systems.
[0003] Analog input cards (AI) are generally divided into current and voltage types. When conducting real-time testing of voltage-type analog signal acquisition, a DC voltage source is generally used to provide a bias voltage to the analog input card under test. The frequency of the sinusoidal alternating voltage source is gradually increased until the sine wave is distorted on the DCS system screen. This period represents the real-time performance of the system's analog signal acquisition. For example, Chinese Patent Authorization Publication No. CN206805286U discloses a device for testing the real-time performance of analog signal acquisition in a DCS system.
[0004] Currently, current-type analog input cards are the most widely used. Their standard input signal is 4-20mA, corresponding to the measurement range of the AI measurement point. A current pulse signal with a varying frequency is applied to the analog input card's input. The card's real-time acquisition performance is verified by testing the minimum period of the current pulse signal that can be captured. A common method for applying a current pulse signal for real-time analog acquisition testing involves connecting a variable resistor R1 and a current signal generator in series to the input of the current-type AI channel (the output of the pulse signal generator is connected in series with another variable resistor R2, which is then connected to the current signal generator). The variable resistor is adjusted so that the difference between the high and low level signals received by the input is greater than 30% of the measurement range. Since the pulse signal generator outputs a voltage pulse, the current pulse generated by connecting a series resistor and a parallel current source is affected by the variable resistor value, the actual internal resistance of the power supply, and the internal resistance of the card. This makes it difficult to accurately control the output current pulse amplitude, resulting in low test accuracy. Summary of the Invention
[0005] The technical problem to be solved by the present invention is that the existing method for real-time testing of current-type analog input card acquisition cannot accurately control the amplitude of the current pulse signal output to the analog input card, resulting in low test accuracy.
[0006] The present invention solves the above technical problems by the following technical means: a method for testing the real-time performance of analog quantity acquisition in a DCS system, comprising:
[0007] Step a: Build an AI card internal resistance measurement circuit to determine the AI card internal resistance;
[0008] Step b: Connect a switch signal generator to the AI card internal resistance measurement circuit, and control the on and off time of the switch signal generator so that the AI card channel receives a square wave current pulse signal with a preset duty cycle;
[0009] Step c: Build an analog real-time detection circuit and connect it to the AI card input terminal;
[0010] Step d: Count the number of current pulses collected by the AI card through the analog real-time detection circuit and compare it with the preset value. If the AI card can correctly identify the sent current pulse signal within the error range of the preset value, gradually reduce the trigger cycle of the switch signal generator until the AI card loses pulses. At this time, the minimum current pulse width that can be correctly identified before the pulse is lost is the analog real-time data width of the AI card.
[0011] The present invention first determines the internal resistance of the AI card. In subsequent tests, the current pulse signal can be accurately adjusted to an appropriate size and then output according to actual needs. This overcomes the problem of uncertainty in the output current pulse caused by the uncertainty of the card's internal resistance in existing testing methods, thereby improving test accuracy. In addition, by controlling the on and off time of the switching signal generator, the AI card channel is connected to a square wave current pulse signal with a preset duty cycle, thereby achieving stable and adjustable amplitude of the current pulse signal, further improving test accuracy.
[0012] Furthermore, the AI card internal resistance measurement circuit includes a signal generator and a variable resistor. The signal generator is connected in parallel to both ends of the AI card, and the variable resistor is connected in parallel to both ends of the signal generator.
[0013] Furthermore, the step a includes:
[0014] The signal generator outputs a constant current of , which is obtained by the current distribution rule.
[0015]
[0016] I0+I1=K
[0017] Change the variable resistor R1 so that the AI card's measurement point value is 50% of the range. At this time, the current M flowing through the AI card's internal resistance R0 and the current KM flowing through the variable resistor R1, then the AI card's internal resistance
[0018] Furthermore, the switching signal generator includes a pulse signal generator, a transistor Q1 and a current limiting resistor R X , the resistor R X One end of the transistor is connected to the base of the transistor Q1 through a pulse signal generator, and the collector of the transistor Q1 is connected to the resistor R X The other end of the resistor R X One end of the transistor and the emitter of the transistor Q1 are connected in series to the loop where the variable resistor R1 is located.
[0019] Furthermore, the step b includes:
[0020] Set the resistance of the variable resistor R1 to be equal to the internal resistance R0 of the AI card. The signal generator outputs a constant current of N. At this time, the transistor Q1 is turned on, and the current flowing through the internal resistance R0 of the AI card is The value of the AI measurement point is A% of the range; if the transistor Q1 is cut off, the current flowing through the internal resistance R0 of the AI card is N, making the value of the AI measurement point B% of the range; then by setting the pulse signal frequency of the pulse signal generator to control the conduction and cutoff time of the transistor Q1, the AI card channel is connected to the square wave current pulse signal with a duty cycle of (BA)%.
[0021] Furthermore, the number of the square wave current pulse signals with a duty cycle of (BA)% is greater than 50, and the width is equal to the processing cycle of the controller in the distributed control system (DCS).
[0022] Furthermore, the analog quantity real-time detection circuit includes a number setting block for setting 0 to stop the test and setting 1 to start the test, a high value selector, a low value selector, a first AND gate, a second AND gate, a first pulse timer, a second pulse timer, a first counter and a second counter. The X1 ends of the high value selector and the low value selector are both connected to the input end of the AI card, the output end of the high value selector is connected to one input end of the first AND gate and the input end of the first counter, the output end of the low value selector is connected to one input end of the second AND gate and the input end of the second counter, the output end of the number setting block is respectively connected to the other input end of the first AND gate and the other input end of the second AND gate, the output end of the first AND gate is connected to the start port of the first counter through the first pulse timer, the output end of the second AND gate is connected to the start port of the second counter through the second pulse timer, the first counter outputs a high pulse counting result, and the second counter outputs a low pulse counting result.
[0023] Furthermore, the timing time of the first pulse timer and the second pulse timer are both 60s.
[0024] Furthermore, the high value selector converts the measurement point value of the AI card component greater than or equal to B% of the range into a logic signal "1", and the low value selector converts the measurement point value of the AI card component less than or equal to A% of the range into a logic signal "0".
[0025] Furthermore, the step d includes:
[0026] The switching trigger frequency and number of the switch signal generator are preset, the setting block is set to 1, and the test is started. The current pulse signal is converted by the high value selector and the low value selector respectively, and the input current pulse signal is converted into a logic signal "1" and "0" respectively. The logic signal "1" is input into the first AND gate together with the output value of the setting block. The first AND gate outputs the logic value "1". After the first pulse timer, the first counter counts the logic value "1". When the counting time reaches the timing time preset by the first pulse timer, the counting of the current cycle ends and the next cycle counting is carried out; the logic signal "0" is input into the second AND gate together with the output value of the setting block. The second AND gate outputs the logic value "0". After the second pulse timer, the second counter counts the logic value "0". When the counting time reaches the timing time preset by the second pulse timer, the counting of the current cycle ends and the next cycle counting is carried out;
[0027] Count the number of current pulses output by the two counters and compare them with the preset value. If the AI card can correctly identify the sent current pulse signal within the error range of the preset value, gradually reduce the trigger cycle of the switch signal generator until the AI card loses pulses. At this time, the minimum current pulse width that can be correctly identified before the pulse is lost is the real-time data width of the analog quantity acquisition of the AI card.
[0028] The advantages of the present invention are:
[0029] (1) The present invention first determines the internal resistance of the AI card. In subsequent tests, the current pulse signal can be accurately adjusted to an appropriate size and then output according to actual needs. This overcomes the problem of uncertainty in the output current pulse caused by the uncertainty of the card internal resistance in the existing test method, thereby improving the test accuracy. In addition, by controlling the on and off time of the switch signal generator, the AI card channel is connected to a square wave current pulse signal with a preset duty cycle, so that the amplitude of the current pulse signal is stable and adjustable, further improving the test accuracy.
[0030] (2) The signal generator of the present invention outputs a constant current of N. At this time, when the transistor is turned on, the current flowing through the internal resistance of the AI card makes the value of the AI measurement point A% of the range; if the transistor is turned off, the current N flowing through the internal resistance of the AI card makes the value of the AI measurement point B% of the range; by setting the pulse signal frequency of the pulse signal generator to control the on and off time of the transistor, the AI card channel is connected to the square wave current pulse signal with a duty cycle of (BA)%, so that the amplitude of the current pulse signal is stable and adjustable, thereby improving the accuracy of the real-time test of the analog quantity acquisition of the AI card.
[0031] (3) The present invention utilizes the switching characteristics of the transistor to adjust the current pulse signal input to the AI card, thereby improving the existing test method of using the output of the voltage pulse generator in series with a variable resistor in parallel with the current signal generator to generate the current pulse. After the improvement, the entire test circuit has only one power source, the signal generator, to supply power to the AI card, thus overcoming the uncertainty of the current pulse caused by the uncertainty of the internal resistance of the power supply. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is a flow chart of a method for real-time testing of analog quantity acquisition in a DCS system disclosed in an embodiment of the present invention;
[0033] Figure 2 This is the original circuit diagram of the internal resistance measurement circuit of the AI card in the real-time testing method for analog quantity acquisition of a DCS system disclosed in an embodiment of the present invention;
[0034] Figure 3 This is a schematic diagram of connecting a switch signal generator to an AI card internal resistance measurement circuit in a DCS system analog quantity acquisition real-time testing method disclosed in an embodiment of the present invention;
[0035] Figure 4 This is an original circuit diagram of an analog quantity real-time detection circuit in a DCS system analog quantity acquisition real-time testing method disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0037] like Figure 1 As shown, a DCS system analog quantity acquisition real-time testing method includes:
[0038] Step a: First, build the internal resistance measurement circuit of AI card 2, such as Figure 2 As shown, the internal resistance measurement circuit of the AI card 2 includes a signal generator 1 and a variable resistor R1. The signal generator 1 is connected in parallel to both ends of the AI card 2, and the variable resistor R1 is connected in parallel to both ends of the signal generator 1. The signal generator 1 is a current signal generator.
[0039] Then, a constant current of 20mA is output through the signal generator 1, which is connected to both ends of the AI card 2 of the DCS system and a variable resistor R1 in parallel. The internal resistance of the AI card 2 is R0. At this time, the currents flowing through R1 and R0 are I1 and I0 respectively. According to the current distribution rule,
[0040]
[0041] I0+I1=20mA
[0042] Change the variable resistor R1 so that the value of the AI card 2 measurement point is 50% of the range. At this time, the current I0 flowing through the internal resistance of the AI card 2 is 12mA, and the current I1 flowing through the variable resistor R1 is 8mA. The internal resistance of the AI card 2 is The internal resistance of the AI card 2 is determined thereby.
[0043] Step b: First, connect the switch signal generator 3 to the internal resistance measurement circuit of the AI card 2, which simulates the switch output of the adjustable frequency, such as Figure 3 As shown, the switching signal generator 3 includes a pulse signal generator 31, a transistor Q1 and a current limiting resistor R X , the resistor R X One end of the transistor is connected to the base of the transistor Q1 through the pulse signal generator 31, and the collector of the transistor is connected to the resistor R X The other end of the resistor R X One end of the transistor and the emitter of transistor Q1 are connected in series to the loop where the variable resistor R1 is located. The pulse signal generator 31 triggers transistor Q1 by generating continuous high and low levels. When the pulse signal is high, transistor Q1 is turned on, which is equivalent to a closed switch; when the pulse signal is low, transistor Q1 is turned off, which is equivalent to an open switch. The conduction characteristic of the transistor is I1 = βI b , β is the transistor amplification factor, I b Is the current flowing through the base. By consulting the transistor conduction characteristic table, it can be seen that the base current required for its conduction is very weak. Therefore, a current limiting resistor R is connected in series between the base and emitter of the transistor. X , reducing its base current, the resistance is 5kΩ.
[0044] Continue reading Figure 3After the switch signal generator 3 is connected, the current pulse signal output by the switch signal generator 3 is controlled to make its output adjustable. The specific process is: set the resistance of the variable resistor R1 to be equal to the internal resistance R0 of the AI card 2, and the signal generator 1 outputs a constant current of 16mA. At this time, the transistor Q1 is turned on, and the current flowing through the internal resistance R0 of the AI card 2 is The AI measurement point value is 25% of the range. If transistor Q1 is cut off, the current I0 flowing through the internal resistor R0 of AI card 2 is 16 mA, making the AI measurement point value 75% of the range. This allows accurate control of the current pulse amplitude in the test loop. By setting the pulse signal frequency of pulse signal generator 31 to control the on and off times of transistor Q1, AI card 2 channel receives a square wave current pulse signal with a duty cycle of 50%, with the number of square wave current pulse signals greater than 50 and a width equal to the processing cycle of the controller in the distributed control system (DCS).
[0045] Step c: Build analog real-time detection circuit 4 and connect it to the input terminal of AI card 2. Figure 4 As shown, the analog real-time detection circuit 4 includes a number setting block for setting 0 to stop the test and setting 1 to start the test, a high value selector 41, a low value selector 42, a first AND gate 43, a second AND gate 44, a first pulse timer 45, a second pulse timer 46, a first counter 47 and a second counter 48. The X1 ends of the high value selector 41 and the low value selector 42 are both connected to the input end of the AI card 2, the output end of the high value selector 41 is connected to an input end of the first AND gate 43 and an input end of the first counter 47, the output end of the low value selector 42 is connected to an input end of the second AND gate 44 and an input end of the second counter 48, the output end of the number setting block is connected to the other input end of the first AND gate 43 and the other input end of the second AND gate 44 respectively, the output end of the first AND gate 43 is connected to the start port of the first counter 47 through the first pulse timer 45, the output end of the second AND gate 44 is connected to the start port of the second counter 48 through the second pulse timer 46, the first counter 47 outputs a high pulse counting result, and the second counter 48 outputs a low pulse counting result.
[0046] In this embodiment, the timing time of the first pulse timer 45 and the second pulse timer 46 are both 60 seconds. The high value selector 41 converts the measured point value of the AI card 2 greater than or equal to 75% of the range into a logic signal "1", and the low value selector 42 converts the measured point value of the AI card 2 less than or equal to 25% of the range into a logic signal "0".
[0047] Step d: Continue to Figure 4, preset the switching trigger frequency and number of the switch signal generator 1, set the number block to 1, start the test, the current pulse signal is converted by the high value selector 41 and the low value selector 42 respectively, and the input current pulse signal is converted into a logic signal "1" and "0" respectively. The logic signal "1" is input into the first AND gate 43 together with the output value of the number block. The first AND gate 43 outputs the logic value "1". After the first pulse timer 45, the first counter 47 counts the logic value "1". When the counting time reaches the timing time preset by the first pulse timer 45, the counting of the current cycle ends and the next cycle counting is carried out; the logic signal "0" is input into the second AND gate 44 together with the output value of the number block. The second AND gate 44 outputs the logic value "0". After the second pulse timer 46, the second counter 48 counts the logic value "0". When the counting time reaches the timing time preset by the second pulse timer 46, the counting of the current cycle ends and the next cycle counting is carried out;
[0048] Count the number of current pulses output by the two counters and compare them with the preset value. If the AI card 2 can correctly identify the sent current pulse signal within the error range of the preset value (correct identification means that the number of current pulses output by the two counters is exactly within the error range of the preset value, indicating that the pulse current signal sent by the pulse signal generator 31 can be fully collected by the AI card), gradually reduce the trigger cycle of the switch signal generator 3 until the AI card 2 loses pulses. At this time, the minimum current pulse width that can be correctly identified before the pulse is lost is the real-time data width of the analog quantity acquisition of the AI card 2, which should be consistent with the processing cycle of the controller in the distributed control system (DCS). The test should set different processing cycles for the controller and repeat it more than twice under each processing cycle.
[0049] Through the above technical solution, the present invention provides a real-time testing method for analog quantity acquisition in a DCS system, which can accurately control the output current pulse amplitude, make the current pulse output stable and adjustable, improve the test accuracy, and the circuit construction is simple and easy to implement.
[0050] 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 they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. 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 various embodiments of the present invention.
Claims
1. A method for testing the real-time performance of analog quantity acquisition in a DCS system, characterized in that: include: Step a: Build an AI card internal resistance measurement circuit to determine the AI card internal resistance; Step b: Connect a switch signal generator to the AI card internal resistance measurement circuit, control the on and off time of the switch signal generator, so that the AI card channel is connected to a square wave current pulse signal with a preset duty cycle; the switch signal generator includes a pulse signal generator, a transistor and current limiting resistors , the resistor One end of the pulse signal generator is connected to the transistor The base connection of the transistor The collector and resistor The other end of the resistor is connected One end of the transistor The emitter is connected in series to a variable resistor On the circuit; set the variable resistor The resistance is equal to the internal resistance of the AI card , the signal generator outputs a constant current of size N, at this time the transistor If it is turned on, the current will flow through the internal resistance of the AI card. The current is , so that the AI card value is A of the range; if the transistor Cut off, then the current flows through the internal resistance of the AI card The current is N, so that the AI card value is B% of the range; then the transistor is controlled by setting the pulse signal frequency of the pulse signal generator The on and off time of the AI card channel is connected to the square wave current pulse signal with a duty cycle of (BA)%; Step c: Build an analog real-time detection circuit and connect it to the AI card input terminal; Step d: Count the number of current pulses collected by the AI card through the analog real-time detection circuit and compare it with the preset value. If the AI card can correctly identify the sent current pulse signal within the error range of the preset value, gradually reduce the trigger cycle of the switch signal generator until the AI card loses pulses. At this time, the minimum current pulse width that can be correctly identified before the pulse is lost is the analog real-time data width of the AI card.
2. A DCS system analog quantity acquisition real-time testing method according to claim 1, characterized in that: The AI card internal resistance measurement circuit includes a signal generator and a variable resistor. The signal generator is connected in parallel to both ends of the AI card, and the variable resistor is connected in parallel to both ends of the signal generator.
3. A DCS system analog quantity acquisition real-time testing method according to claim 2, characterized in that: The step a comprises: The signal generator outputs a constant current of , which is obtained by the current distribution rule. Variable resistor , so that the AI card measurement point value is 50% of the range. At this time, the current flowing through the AI card internal resistance The current M flows through the variable resistor The current KM, then the internal resistance of the AI card .
4. A DCS system analog quantity acquisition real-time testing method according to claim 1, characterized in that: The number of the square wave current pulse signals with a duty cycle of (BA)% is greater than 50, and the width is equal to the processing cycle of the controller in the distributed control system (DCS).
5. A DCS system analog quantity acquisition real-time testing method according to claim 1, characterized in that: The analog quantity real-time detection circuit includes a number setting block for setting 0 to stop testing and setting 1 to start testing, a high value selector, a low value selector, a first AND gate, a second AND gate, a first pulse timer, a second pulse timer, a first counter and a second counter. The X1 ends of the high value selector and the low value selector are both connected to the AI card input end, the output end of the high value selector is connected to an input end of the first AND gate and the input end of the first counter, the output end of the low value selector is connected to an input end of the second AND gate and the input end of the second counter, the output end of the number setting block is respectively connected to the other input end of the first AND gate and the other input end of the second AND gate, the output end of the first AND gate is connected to the start port of the first counter through the first pulse timer, the output end of the second AND gate is connected to the start port of the second counter through the second pulse timer, the first counter outputs a high pulse counting result, and the second counter outputs a low pulse counting result.
6. A DCS system analog quantity acquisition real-time testing method according to claim 5, characterized in that: The timing time of the first pulse timer and the second pulse timer are both 60s.
7. A DCS system analog quantity acquisition real-time testing method according to claim 5, characterized in that: The high value selector converts the measurement point value of the AI card component greater than or equal to B% of the range into a logic signal "1", and the low value selector converts the measurement point value of the AI card component less than or equal to A% of the range into a logic signal "0".
8. A DCS system analog quantity acquisition real-time testing method according to claim 5, characterized in that: The step d comprises: The switching trigger frequency and number of the switch signal generator are preset, the setting block is set to 1, and the test starts. The current pulse signal is converted by the high value selector and the low value selector respectively, and the input current pulse signal is converted into a logic signal "1" and "0" respectively. The logic signal "1" is input into the first AND gate together with the output value of the setting block. The first AND gate outputs the logic value "1". After the first pulse timer, the first counter counts the logic value "1". When the counting time reaches the timing time preset by the first pulse timer, the counting of the current cycle ends and the next cycle counting is carried out; the logic signal "0" is input into the second AND gate together with the output value of the setting block. The second AND gate outputs the logic value "0". After the second pulse timer, the second counter counts the logic value "0". When the counting time reaches the timing time preset by the second pulse timer, the counting of the current cycle ends and the next cycle counting is carried out; Count the number of current pulses output by the two counters and compare them with the preset value. If the AI card can correctly identify the sent current pulse signal within the error range of the preset value, gradually reduce the trigger cycle of the switch signal generator until the AI card loses pulses. At this time, the minimum current pulse width that can be correctly identified before the pulse is lost is the real-time data width of the analog quantity acquisition of the AI card.
Citation Information
Patent Citations
Analog signal of DCS system gathers device of real -time test
CN206805286U
DCS system analog quantity acquisition testing device
CN218585222U