Summary of the invention
The object of the present invention is to provide a kind of apparatus and method that can test automatically distant control function, strengthening versatility, and reduce testing cost, improve testing efficiency.
The technical solution used in the present invention is:
A kind of device of automatically testing distant control function is characterized in that, comprising: storage unit, remote-control transmitting module, remote control receiver module and processing module; Also comprise: communication interface circuit; Wherein
Described storage unit has been deposited telecommand sign indicating number sequence;
The described remote-control transmitting module emission telecommand sign indicating number that processing module provided;
Described remote control receiver module receives the telecommand sign indicating number of being launched and is transferred to processing module;
Described processing module is obtained the telecommand sign indicating number in the storage unit and is offered the remote-control transmitting module;
Described processing module receives the telecommand sign indicating number of remote control receiver module transmission, and itself and the telecommand sign indicating number that offers the remote-control transmitting module are compared, and judges whether emission is correct;
Described communication interface circuit provides the communication interface of host computer and processing module;
Described processing module receives telecommand sign indicating number sequence from described host computer, and is kept in the described storage unit.
Further, described storage unit is the storer of host computer.
Further, described storage unit is a memory circuitry, comprises memory chip and the pull-up resistor that is connected with the communication pin of this memory chip; Described memory circuitry is communicated by letter with processing module by universal serial bus.
Further, described processing module is universal 51 single chip computer AT 89C55.
Further, this device also comprises:
Power light is lighted when device work;
The emission pilot lamp by processing module control, is lighted when emission;
The serial ports observation circuit connects computer by Serial Port Line, the processing Debugging message of inspection process module transmission on computers.
The present invention also provides a kind of method of automatically testing distant control function, it is characterized in that, may further comprise the steps:
A1, host computer load the telepilot simulator program;
A2, utilize described program to set up being connected of host computer and proving installation;
A3, utilize described procedure Selection or create telepilot;
A4, utilize described program pin that the telepilot that obtains among the a3 is loaded by one or the telecommand sign indicating number sequence formed more than one telecommand sign indicating number; The implementation method of described loading telecommand sign indicating number sequence is to create new sequence or be written into existing sequence;
A5, host computer send to proving installation with described sequence
B, proving installation are stored into storage unit with described sequence;
C, proving installation are analyzed one by one and are launched each telecommand sign indicating number, receive the telecommand sign indicating number of being launched; The telecommand sign indicating number that contrast transmits and receives judges whether emission is correct.
Further, when described telecommand sign indicating number sequence is made up of a telecommand sign indicating number, also have steps d behind the step c: described proving installation returns to host computer and becomes function signal when emission is correct, returns to the host computer failure signal when emission is incorrect.
Further, when described telecommand sign indicating number sequence when forming more than one telecommand sign indicating number, described step c is refined as:
Read a telecommand sign indicating number in the sequence that c1, proving installation are deposited from storage unit;
C2, proving installation analysis are also launched this telecommand sign indicating number, receive the telecommand sign indicating number of being launched;
The telecommand sign indicating number that c3, proving installation contrast transmit and receive judges whether emission is correct; C4 is correctly then carried out in emission, otherwise returns c2;
C4, judge whether the telecommand sign indicating number in the described sequence has been launched; Be then to finish test; Otherwise return step c1.
Further, among the described step c4, after having launched, the telecommand sign indicating number in the described sequence needs to judge whether repeat its transmission; Then return step c1 if desired; Otherwise finish test.
Adopt technical scheme of the present invention can test the distant control function of plurality of devices, have versatility, new equipment just can use the solution of the present invention to test as long as by host computer its telecommand sign indicating number is set; Thereby reduction testing cost; And the employing automatic test method, can launch telecommand sign indicating number sequence repeatedly, can realize deeper remote-control pressure strength test, reduce the fatigue of personnel's button, reduce false failure rate, and improved efficient; Host computer can be worked out the remote-control transmitting sequence, and sends to proving installation, is launched by proving installation and specifies the remote control sequence, can control number of times, the sequential scheduling of the test of telecommand sign indicating number like this, thereby also reduce false failure rate.
Embodiment
Below in conjunction with the drawings and specific embodiments the present invention is done more detailed description.
The device of a kind of automatically testing distant control function of the present invention (hereafter is a proving installation), as shown in Figure 1, comprise single-chip microcomputer vibration 1, storage unit 2, remote-control transmitting module 3, remote control receiver module 4, indicator light circuit 5, serial ports observation circuit 6, reset circuit of SCM 7, communication interface circuit 8, processing module 9 and power supply.Wherein:
Power supply is used for to each circuit and module for power supply;
Single-chip microcomputer oscillatory circuit 1 offers the reliable and stable clock oscillation of processing module 9, guarantees that its treating apparatus stablizes operate as normal;
Storage unit 2 is used to deposit the telecommand sign indicating number sequence of test usefulness; This storage unit 2 is arranged on the inner or outside memory circuitry of proving installation; This memory circuitry comprises memory chip EEPROM and pull-up resistor, EEPROM communication pin connects and draws resistance, chip does not have concrete model requirement, communicates with processing module 9 by I2C bus (universal serial bus that is made of data line SDA and clock SCL), realizes the exchange of data;
Remote-control transmitting module 3 comprises infrared transmitting tube and modulation circuit, is connected with processing module 9 by an I/O mouth, is responsible for the pulse that receiving processing module 9 provides---be the telecommand sign indicating number, and launch by infrared transmitting tube after being modulated into infrared remote-controlled signal;
Remote control receiver module 4 comprises infrared receiving tube and signal demodulation, plastic filter circuit, and infrared receiving tube receives infrared remote-controlled signal, and signal demodulation, plastic filter circuit are defeated by processing module 9 by I/O oral instructions after with its shaping filter and demodulation;
Indicator light circuit 5 comprises power light, emission pilot lamp and related circuit, and the duty of power light sign automatic remote control proving installation is lighted when device work; The emission pilot lamp is controlled by an I/O mouth of processing module 9, and the state of expression remote-control transmitting is lighted when remote-control transmitting module 3 emission remote signals;
Serial ports observation circuit 6 is made up of RS232 level transferring chip and series interface part SPCP825A, can connect PC (PC) by Serial Port Line, the working condition of inspection process module 9 on PC; Can use serial ports receiving software such as hyper terminal to observe processing module 9 and adopt the processing Debugging message that serial ports sent;
Reset circuit of SCM 7 provides the reset level of powered on moment to processing module 9, is connected to the RESET pin of signal processing apparatus 9;
Communication interface circuit 8 is finished the communication interface function of processing module 9 and host computer 10;
Processing module 9 is CPU (central processing unit) of automatic remote control proving installation, can adopt universal 51 single chip computer AT 89C55; Be responsible for before test, from host computer 10, receive telecommand sign indicating number sequence and leave it in storage unit 2 li, also be responsible for from storage unit 2, reading the telecommand sign indicating number and analyzing, offer remote-control transmitting module 3 then, also be responsible for to receive the telecommand sign indicating number of remote control receiver module 4 transmission, and itself and the telecommand sign indicating number that offers remote-control transmitting module 3 compared, represent that when identical emission is correct, not the mistake of expression emission simultaneously; Write down judged result or the result is returned to host computer 10.
Utilize the method for above-mentioned proving installation automatically testing distant control function, may further comprise the steps:
A, loading telecommand sign indicating number sequence; This sequence can be made up of a telecommand sign indicating number, also can be made up of the telecommand sign indicating number more than.
Step a need be undertaken by host computer, as shown in Figure 2, comprises following concrete steps:
A1, host computer load the telepilot simulation softward; Here be that example describes with IRC TOOL program; IRC TOOL starts demonstration main interface as shown in Figure 3, back;
A2, select to connect the com port of proving installation in tabulation 21, set up communicating to connect of host computer and proving installation, it is selective to preset COM1~COM4;
A3, selection or establishment telepilot; Can in tabulation 22, select the IR telepilot,, in the KeyMap interface as shown in Figure 4 of ejecting, create new IR (infrared) telepilot if the telepilot of wherein not wanting can be put button 25.
The process of creating telepilot comprises the telepilot name, selects the receiver address of telepilot agreement, definition telepilot and load or create the remote control key table;
The step of creating new IR telepilot is as follows:
It in input frame 27 newly-built telepilot name, the IR agreement of selecting this telepilot to use in tabulation 28, next in input frame 29, import IR Receive Addr (infrared receiver address), this address is used to discern the different remote of using same agreement, corresponding with telepilot itself, be the sexadecimal number of a double byte; Can one of Load in this interface or the file of brand-new expansion of Build irc by name, this document is used to store IR keymap (remote control key table); The position that demonstrates each button of the left side image at interface, click wherein any one, will eject InputKey interface as shown in Figure 5, can in this interface, define the title and the key assignments of each button, after needed button all defines, just set up and got well whole Keymap, understand each button title and layout of demonstrating of image in the KeyMap interface; Button click 32 also can show the button title and the layout of the telepilot of being created in the main interface, as shown in Figure 6, new telepilot is created and finished.
A4, utilize described program to load the Pattern (template) that stores telecommand sign indicating number sequence at the telepilot that obtains among the a3; Here, loading Pattern has two kinds of implementation methods: the one, and button click 23 is created new Pattern; The 2nd, button click 24 is written into existing Pattern, and the extension name of Pattern is generally pat.
A5, the telecommand sign indicating number sequence of storing among the described Pattern in the host computer is sent to proving installation.
So far, finished the step of loading telecommand sign indicating number sequence.
B, proving installation are stored into storage unit with described sequence; Described storage unit can be the storer that proving installation carries, and also can be the external memory storage that can carry out exchanges data with proving installation.
C, proving installation are analyzed each telecommand sign indicating number one by one, confirm infrared protocol, infrared receiver address, key assignments in the telecommand sign indicating number, and it is modulated to the remote signal emission; Receive the remote signal of being launched, demodulate the telecommand sign indicating number; The proving installation contrast receives the telecommand sign indicating number with emission, judges whether emission is correct; If reception is consistent with the telecommand sign indicating number of emission, illustrate that emission is correct; Otherwise illustrate that emission is incorrect.
When in the described sequence during a more than telecommand sign indicating number, what test was adopted is the loop test pattern, and step c specifically comprises:
Read a telecommand sign indicating number in the sequence that c1, proving installation are deposited from storage unit;
C2, proving installation analysis are also launched this telecommand sign indicating number, receive the telecommand sign indicating number of being launched;
The telecommand sign indicating number that c3, proving installation contrast transmit and receive judges whether emission is correct; C4 is correctly then carried out in emission, otherwise returns c2;
C4, judge whether the telecommand sign indicating number in the described sequence has been launched; Be then to finish test; Otherwise return step c1.
When having only a telecommand sign indicating number in the described sequence, what test was adopted is the single stepping test pattern, also exists behind the step c:
D, described proving installation return to host computer and become function signal when emission is correct, return to the host computer failure signal when emission is incorrect.
In actual applications, launch one group of telecommand sign indicating number sequence if desired repeatedly, then can set when a sequence has been launched and carry out repeat its transmission again, or carry out repeat its transmission by manual operation.
By said apparatus and method, just can test the telecommand sign indicating number---promptly distant control function is tested because have only the correct telecommand sign indicating number of emission, could correct execution accordingly to the distant control function of electrical equipment.Testing which telecommand sign indicating number, its testing sequence and number of times can set, and should use very flexible; When needs test during to the distant control function of different electrical equipment, the telecommand sign indicating number that only needs to change test usefulness just can, therefore the enough device to test of energy are to the distant control function of multiple electrical equipment.
In addition, can also arrange corresponding electrical equipment to accept remote control in test, as shown in Figure 7, electrical equipment can receive the telecommand sign indicating number of being launched and carry out corresponding operating.When the test electric property, in the time of behind switch repeatedly, whether can abnormal conditions occurring such as test electrical equipment, the telecommand sign indicating number that just can utilize device of the present invention to launch out repeatedly and close.This is an additional use of the present invention.
Further specify the present invention with two application examples below.
Example one, telecommand sign indicating number sequence is made up of a telecommand sign indicating number, carries out single stepping test, referring to Fig. 8, may further comprise the steps:
101, select the connectivity port to set up being connected of host computer and proving installation;
102, select or create telepilot among the IRC TOOL in host computer earlier;
103, load the telecommand sign indicating number at described telepilot;
104, host computer is transferred to proving installation with described telecommand sign indicating number;
105, judge whether transmission success, if get nowhere then repeating step 104; Carry out step 106 after the transmission success;
106, proving installation is stored into storage unit with the telecommand sign indicating number, analyzes described telecommand sign indicating number, confirms the infrared protocol in this telecommand sign indicating number, infrared receiver address, key assignments; Modulating the telecommand sign indicating number then is remote signal and emission, receives the remote signal of being launched simultaneously, demodulates the telecommand sign indicating number;
107, proving installation contrasts the telecommand sign indicating number that transmits and receives, and judges whether emission is correct; Identical then expression emission is correct, and proving installation returns to host computer and becomes function signal; If inequality promptly incorrect, then return to the host computer failure signal.Just wait for after the proving installation return signal that host computer continues the transmission data.
Example two, telecommand sign indicating number sequence are made up of the telecommand sign indicating number more than, adopt the loop test pattern, referring to Fig. 9, may further comprise the steps:
201, load telecommand sign indicating number sequence according to above-mentioned flow process; Just set up being connected of host computer and proving installation, select or create telepilot then among the IRC TOOL in host computer, and create or be written into Pattern at described telepilot; Then the telecommand sign indicating number sequence among the described Pattern is sent to proving installation;
202, proving installation stores described sequence in the storage unit into;
203, proving installation reads a telecommand sign indicating number from described storage unit; When just beginning to test, that reads is first telecommand sign indicating number in the described sequence;
204, proving installation is analyzed described telecommand sign indicating number, confirms the infrared protocol in this telecommand sign indicating number, infrared receiver address, key assignments;
205, proving installation modulation telecommand sign indicating number is remote signal and emission, receives the remote signal of being launched simultaneously, demodulates the telecommand sign indicating number;
206, contrast receives and the telecommand sign indicating number of launching, and judges whether emission is correct.When inequality, represent to launch mistake, represent that when identical emission is correct, when emission is wrong, return step 205; Launch execution in step 207 when correct;
207, proving installation judges whether that test finishes, and judges promptly whether the telecommand sign indicating number sequence in the described storage unit is empty; If finish then execution in step 208; Otherwise return step 203, promptly read the next telecommand sign indicating number in the described sequence;
208, proving installation need to judge whether repeat its transmission, need then return step 203, promptly reads first telecommand sign indicating number in the described sequence; Otherwise finish test.
Certainly; the present invention also can have other various embodiments; under the situation that does not deviate from spirit of the present invention and essence thereof; being familiar with those of ordinary skill in the art ought can make various corresponding changes and distortion according to the present invention, but these corresponding changes and distortion all should belong to the protection domain of the appended claim of the present invention.