A kind of devices and methods therefor of lumped modelling equipment under test environment parameter
Technical field
The invention belongs to field tests, the method and apparatus of the various environment parameters of a kind of lumped modelling equipment under test of more specifically saying so.
Background technology
In the prior art, environment centralized supervision equipment is a kind of multifunction module that is used for communication equipment environment monitoring, its comprehensive integration to environment parameters such as humidity, temperature, water logging, antitheft and smog at interior multiple measuring ability.And in R﹠D process, then need this environment centralized supervision equipment to be carried out repeatedly test respectively with regard to the varying environment amount to these functions.In order to test these functions the most all sidedly, in each test process, all need to make various types of environment parameter excitations simultaneously.In existing test process, usually by the excitation input source of environmental sensor as the environmental forces centralized supervisory and control equi, therefore need various sensor in the test, need to make various types of environment parameters simultaneously and pass to sensor, for example need to make the different air humiditys of 0%-100%, need then to make-the varying environment temperature of 10-40 degree, also need to make water logging, need smog of making variable concentrations or the like, thereby it is the very large workload of the simulation of each environment parameter formation needs, and very loaded down with trivial details.
Because different sensors does not integrate, sensor mixes and causes the test error influence testing efficiency easily, and building also of sensor test environment bothers very much in reality test.
There is following difficulty in the manufacturing of these environment parameters simultaneously:
1. make relatively difficulty, some environment parameter is uncontrollable, as smokescope.
2. the environment parameter that can make can not the needed scope of coverage test.For example can't make 0% humidity, same, the temperature of making-10 degree is very difficult.
The defective of above-mentioned prior art has influenced greatly to the testing efficiency of environment centralized supervision equipment and the raising of product quality, very little because test some used environmental sensor number of times in serviceable life simultaneously, also increased the cost of testing greatly.
This shows that prior art exists open defect, need further improvement and develop.
Summary of the invention
The objective of the invention is in order to overcome the defective of above-mentioned prior art, a kind of method and apparatus of lumped modelling test environment amount is provided, by this method and apparatus, the various driving sources that need of manufacturing environment centralized supervisory and control equi easily, also be various ambient signal amounts, make the test of environment centralized supervision equipment become simply, make things convenient for, improve testing efficiency and quality greatly, reduce the cost of test simultaneously greatly.
Technical scheme of the present invention is:
A kind of device of lumped modelling equipment under test environment parameter, it comprises a circuit single plate, and a power supply, offers the required voltage of work of this circuit single plate; On this circuit single plate, also be provided with
A plurality of switches, these a plurality of switches are controlled the setting and the output of each simulated environment amount respectively;
One square wave generator circuit, described square wave generator circuit is made up of amplifier, resistance, electric capacity;
One processor is used to accept the control of described switch, handles and control the simulated environment signal of output environment amount;
A plurality of interfaces, described simulated environment signal is imported in the described tested equipment by these a plurality of interfaces.
Described device, wherein, also include a D/A converter on the described circuit single plate, be used for accepting to transmit control signal to this D/A converter after the described switch control, convert the analogue value of relevant voltage by this D/A converter to by described processor.
Described device, wherein, described each simulated environment amount comprises humidity, temperature, smog, water logging and antitheft at least, and simulation humidity is simulating signal, analog temperature is followed the 1-wire agreement, simulation smoke is a square-wave signal, the simulation water logging and antitheft be switching signal, each signal is imported described equipment under test by humidity interface, temperature interface, smog interface, water logging interface and antitheft interface respectively.
Described device, wherein, the signal of described temperature interface directly comes from temperature sensor.
Described device, wherein, the simulating signal of described humidity by a second switch wherein through described processor controlled humidity value, by the output of one first switch controlled humidity simulating signal; And by the value of one the 3rd switch control temperature.
Described device, wherein, the square-wave signal of described simulation smoke produces by the counter mode that described processor is set, and is controlled the shutoff of described square-wave signal by one the 4th switch.
Described device, wherein, described simulation water logging and antitheft switching signal are directly formed by one the 5th switch, and are controlled the shutoff of this switching signal by the 5th switch.
Described device, wherein, described second~the 4th switch is a code switch.
A kind of method of lumped modelling equipment under test environment parameter, it may further comprise the steps:
A) this processor brings into operation, and imports this processor by the various control signals of a plurality of switches;
B) described processor is judged the simulating signal classification of this control signal control, carries out different disposal according to the difference of this simulating signal classification;
C) after the operation of intact each the control signal correspondence of described processor processing, return and continue to read in next control signal.
Described method, wherein, processor described in the described step b) can be selected following different disposal step according to different control signals:
B1) if described control signal is a switching signal, by the control of one the 5th switch, be used to simulate water logging and antitheft, then this switching signal is directly outputed to described equipment under test from water logging interface or antitheft interface;
B2),, then generate the square-wave signal of square wave from described smog interface output by a square wave maker by the control of one the 4th switch if described control signal is a smoke signal;
B3) if described control signal is a simulating signal, by one first switch and second switch control, then described processor reads in the aanalogvoltage value corresponding that will be provided with, carry out the processing of data, and give a D/A converter with these data, this D/A converter is converted to the aanalogvoltage of simulation humidity and exports from described humidity interface;
B4) if described control signal is a temperature signal, control by one the 3rd switch, then described processor reads in the temperature value corresponding that will be provided with, and directly carries out data processing, outputs to described equipment under test from described temperature interface then;
Described second~the 4th switch is a code switch.
Described method, wherein, described step b4) analog quantity to temperature in directly obtains by a temperature sensor, and without described processor.
Described method, wherein, the process of described analog temperature signal is further comprising the steps of:
B41) register in the initialization chip, temperature control signals is connected with a common I/O mouth and INT1 mouth simultaneously;
B42) after this INT1 mouth receives negative edge,, jump to the program segment that calculates low level length and carry out by in this INT1 interruption subroutine, redirect being set;
B43) judge that low level length is whether long greater than a schedule time, then send sensor signal on the throne in this way, and before sending sensor signal on the throne, close this INT1 interrupt function, open this INT1 interrupt function after sending this sensor signal on the throne; Otherwise this step of cycle criterion;
B44) the temperature reading command of the described equipment under test of reception, if receive, then the numerical value with described temperature control signals reads in described processor, and exports the temperature signal of simulation by the temperature signal pin;
B45) described processor reads the temperature instruction and sends temperature signal and all follows the 1-wire agreement, interrupt detecting the opening flag of each data when reading the temperature instruction by described INT1, send the interrupt function of closing this INT1 before the described temperature signal, open again after sending.
Described method, wherein, described step b44) temperature signal comprises a low level and a high position described in, should hang down the bit representation temperature value, high bit representation temperature positive and negative, and send the low byte of this temperature signal during output earlier, send upper byte again.
Described method, wherein, the process of described simulation moisture signal may further comprise the steps:
B31) the described processor look-at-me that receives described first switch enters interruption subroutine;
B32) described processor reads in the humidity value that described second switch is provided with from corresponding port;
B33) described processor is provided with described D/A converter chip selection signal for effective;
B34) described processor sends described humidity value to described D/A converter by serial ports;
B35) remove the chip selection signal of this D/A converter.
Described method, wherein, described step b34) further comprising the steps of:
B341) the humidity value of described second switch setting is 8 bits, and this 8 bit is as a high position, and low level mends 0;
B342) described serial ports transmission Data Identification being set is 1, and described processor sends the high position of described humidity value to described D/A converter from this serial ports, waits for that then this serial ports sends Data Identification and becomes 0;
B343) after described serial ports transmission Data Identification was 0, described processor sent the low level of described humidity value to described D/A converter from this serial ports.
Described method, wherein, the change that described serial ports sends Data Identification is in the serial ports interruption subroutine, after serial ports sends data, jumps into a serial ports interruption subroutine automatically and finishes.
The devices and methods therefor of a kind of lumped modelling equipment under test environment parameter provided by the invention, owing to adopt various environment parameters are produced with the software and hardware simulation, overcome the shortcoming of simulated environment amount manufacturing difficulty, trouble, inconvenience in the prior art, simulated environment centralized supervisory and control equi testing efficiency height of the present invention is simple and cost is low.
Description of drawings
In the accompanying drawing,
Fig. 1 is the method step synoptic diagram of lumped modelling equipment under test environment parameter of the present invention;
Fig. 2 is the hardware connection diagram of the device of lumped modelling equipment under test environment parameter of the present invention;
Fig. 3 is the main program flow synoptic diagram of the inventive method;
Fig. 4 is to the schematic flow sheet of the interruption subroutine of humidity simulation in the inventive method.
Embodiment
Be described in further detail below in conjunction with the enforcement of accompanying drawing technical scheme:
The devices and methods therefor of a kind of lumped modelling equipment under test environment parameter of the present invention, its core concept is: the signal essence of the various environmental excitation input sources that the analysis environments centralized supervisory and control equi is monitored, simulate these signals by the mode of software and hardware, control the transmission mode of size, power and the signal of these signals simultaneously with the mode of software and hardware, thereby reach effect than the various output signals of the better complete analog sensor of realistic simulation experiment.
At various environmental excitations, i.e. environment parameter, water logging, anti-theft signal are switching signal, smoke signal is a square-wave signal, can use the square-wave signal of 1KHz particularly, moisture signal is a simulating signal, and temperature signal is followed the 1-wire agreement.
The device of lumped modelling equipment under test environment parameter of the present invention as shown in Figure 2, comprises following a few part:
One power supply can provide veneer work of the present invention needed 5V voltage; Power supply can use power module ASTEC 4805S, for this device provides work required 5V power supply, by-48V power source conversion and get.
One processor is used for circuit control; Described processor can use AT89C52.
One interface section, comprise a plurality of output interfaces, comprise the humidity interface, the temperature interface, the smog interface, water logging interface and antitheft interface directly are connected with the equipment under test input interface by cable respectively, are used for sensor signal or analog sensed signal are imported this equipment under test.
A plurality of switches, comprising first switch 1~the 5th switch 5, described first switch 1 is used to control the output that simulating signal also is the humidity simulating signal; This first switch 1 is connected to the interruptive port of described processor.Described second switch 2 is connected to the input port of described processor, is used for being provided with humidity value to be simulated.Described the 3rd switch 3 also is connected to another input port of described processor, is used for being provided with temperature value to be simulated.Described the 4th switch 4 is controlled by described processor, is used to control square-wave signal, also is the output of smoke signal.Described the 5th switch 5 directly produces the gauge tap signal, also is the output of water logging and anti-theft signal.
One square wave maker is the circuit of a generation square-wave signal.This square wave maker can be made up of amplifier, resistance, electric capacity; Described square-wave signal also can be by described processor be set the working method of counter produce.The square-wave signal that the counter of described square wave maker or described processor produces all turn-offs control through described the 4th switch, exports the smoke simulation signal of this square wave to the smog interface.
Described processor, be used for receiving the temperature or the humidity value of described second switch 2,3 settings of the 3rd switch, after this processor processing described humidity value is sent to a D/A converter, directly give described equipment under test from temperature interface output temperature signal with described temperature value.
Described D/A converter is connected with described processor communication, and the conversion of signals that described processor is sent here becomes the analogue value of relevant voltage, and the simulation humidity sensor is to the perceptual signal of humidity.
The device of lumped modelling equipment under test environment parameter of the present invention, also be provided with a temperature sensor, can directly use this temperature sensor, perhaps pass through the perceptual signal of above-mentioned the 3rd switch 3 and the common analog temperature sensor of described processor.The analog temperature signal of the output of this temperature sensor and the output of described processor selects one to output to described temperature interface.
Described first switch 1 of apparatus of the present invention can use the 50mA12VDC single-pole single-throw (SPST) dark circles handle touch-switch that resets, and connects the interruptive port INT0 of described processor.By behind this touch-switch, described processor promptly receives look-at-me, carries out interruption subroutine, output simulation moisture signal.Described second switch 2 and 3 on the 3rd switch can use eight flat code switchs of dialling, be connected respectively to port P2, the P0 of described processor, by these eight flat everybody on off states of code switch of dialling are set, described processor just can read in the binary numeral of eight (bit) from this P2, P0 port.Described the 4th switch 4 can use two flat code switchs of dialling, the one road connects the T2 mouth of described processor, another road connects described square wave generation circuit, this two-way connects described smog interface simultaneously, can come by certain that open these second switch 2 code switchs and select counter to produce smoke signal, perhaps select to produce smoke signal with square wave generation circuit with processor.Described the 5th switch 5 can use two to turn round sub-switch, the two ends of turning round sub-switch are ground connection and 5V voltage respectively, turns round sub-switch and switch between 0V and 5V and export that the gate inhibition is antitheft, the needed switching signal of water logging by pulling this.Described D/A converter can use LTC1655, and 16 bit serial digitals that described processor is imported are converted to corresponding aanalogvoltage.Described temperature sensor can use DS18S20, perhaps the principle of work of coming analog temperature sensor DS18S20 with described processor and described the 3rd switch 3.The resistance of the temperature signal of the output of described temperature sensor and described processor output by 0 ohm carries out wire jumper and select one in both.Described interface device adopts RJ45, finishes being connected of this output interface that installs each environment parameter and described equipment under test.
Need to prove that above-mentioned concrete value is a preferred embodiment of the present invention, can not therefore limit scope of patent protection of the present invention.
The analogy method of described each environment parameter to be measured of the present invention, as shown in Figure 1, it mainly comprises following step to described processor:
The first step: described processor brings into operation, and accepts the input of various control signals from described a plurality of switches.
Second step: described processor is judged the classification of this control signal, if this control signal is a switching signal, is water logging interface or the output of antitheft interface from port directly with this switching signal then; If this control signal is a smoke signal, then from the square-wave signal of port output 1KHz, this square-wave signal can be produced by a square wave maker, also can be generated by the counter of described processor; If this control signal is a simulating signal, then described processor reads in from the set pairing humidity value of aanalogvoltage of described second switch 2, carry out the processing of data, to handle the back data then and give described D/A converter, the aanalogvoltage after this D/A converter will be changed is exported from described humidity interface; If described control signal is a temperature signal, then described processor reads in the temperature value that described the 3rd switch is provided with, and the line data of going forward side by side is handled, then from described temperature interface output.
The 3rd step: after the operation of intact each the control signal correspondence of described processor processing, return and continue to read in next control signal.
The processing of the software section of the inventive method as shown in Figure 3 and Figure 4.Fig. 3 is described processor main program flow chart, mainly produces the program circuit of analog temperature signal with analog D S18S20.
The step of its execution is:
1, register in the described processor initialization sheet.Open the interrupt function of INT0, INT1, open the serial ports interrupt function; Interrupt priority level is set; It is 0 working method that serial ports is set; INT0, INT1 are set are the negative edge triggering; It is the baud rate working method that counter T2 is set; And the frequency of this baud rate is set.
2, described temperature control signals connects the common I/O mouth and the INT1 mouth of described processor simultaneously.
3, after described INT1 mouth receives negative edge,, jump to the program segment that calculates low level length and carry out by the redirect that in the INT1 interruption subroutine, is provided with; If low level length greater than a predetermined amount of time, as 480us, then sends sensor signal on the throne.Before sending sensor signal on the throne, close described INT1 interrupt function, open this INT1 interrupt function after sending sensor signal on the throne.
4, receive the temperature reading command of described equipment under test, if receive, then the numerical value with port P0 reads in described processor, exports by the pin of analog temperature signal after treatment.Because the analog temperature signal is 16 bit value, low eight bit representation temperature values, high eight-bit is represented the positive and negative of temperature; And actually, because can satisfy the test needs with 7 bit representation temperature values in the actual test, therefore can be in code switch low 7 be used to be provided with the temperature absolute value, and most significant digit is used to be provided with the positive and negative of temperature.
5, described processor sends the low byte of temperature earlier, sends upper byte again.
6, read temperature instruction and send temperature signal and all follow the 1-wire agreement.Detect low level arrival by INT1 when reading the instruction of described temperature, i.e. the opening flag of each data; And send the interrupt function of closing INT1 before the described temperature signal, open again after sending.
Be the described INT0 interruption subroutine process flow diagram in the inventive method as shown in Figure 4, promptly realize the process flow diagram of humidity function.
The data that humidity sensor LTC1655 receives are 16 serial data, and code switch can only be provided with 8 bit data, to enough as the precision of 5V aanalogvoltage in the test with 8 bit data, therefore 8 bit data that can be provided with code switch are as a high position, and it is 0 that low level replenishes.Need send this serial data at twice to described D/A converter.The removing of serial ports sign F0 is finished in the serial ports interruption subroutine, after having opened the serial ports interrupt function, after serial ports sends data, will jump into the serial ports interruption subroutine automatically, F0 changes to this serial ports sign.Its concrete execution in step is as follows:
It is that the look-at-me of described first switch 1 enters interruption subroutine that a, described processor receive touch-switch;
B, described processor read in the set 8bit numerical value of described second switch 2 from port P2;
C, described processor are provided with the chip selection signal of described D/A converter for effective;
D, described processor are provided with its serial ports and send sign F0=1;
E, described processor send upper byte from this serial ports;
F, wait F0 become 0;
G, when F0=0, described processor sends low byte from described serial ports, this low byte is 0;
H, wait F0 are 0
I, described processor are removed the chip selection signal of this D/A converter.
It as above is the method step of each environment parameter of simulation of the inventive method, the inventive method is according to the different characteristics of varying environment amount, ambient humidity, temperature, smog, water logging and varying environment amount such as antitheft have correspondingly effectively been simulated, only need apparatus of the present invention are connected described equipment under test by line, then need not time-consuming operations of taking a lot of work such as actual experiment, simply, expense is low.
Should be noted that; can or be equal to replacement according to technical conceive change of the present invention for those of ordinary skills, and all these changes or replacement all should belong to the protection domain of claims of the present invention.