Digital input-output interface measurement jig and method of testing
Technical field
The present invention relates to measurement jig, more particularly, relate to a kind of digital input-output interface measurement jig and method of testing.
Background technology
In industrial control field, particularly often need in industrial control computer to use opening or closing of " numeral exports (DO, digitaloutput) " other equipment of Interface Controller, as the switch of control gate, control light on and off of pilot lamp etc.And " numeral input (DI, digitalinput) " interface is then used for monitoring the duty of other equipment, as monitoring motor whether in working order, whether alarm in warning.The mainboard of existing industrial computer generally all can provide digital IO (DIO, the digitalinput/output) interface (4 tunnel inputs, 4 tunnels export) of 8, many can reach more than 48; Visible, extremely important to the test of DIO interface in industrial control computer product, its test result directly affects the quality of product.
But existing DIO interface testing technology realizes only by software program: first the input and output pin on DIO is carried out short circuit, then moving calculation machine program carries out judging that whether input and output are normal.This process only relying on software test, opaque for tester, tester can only see last test result, thus cannot find hiding problem.Moreover test process is also more loaded down with trivial details, needs the input and output pin on DIO interface to carry out short circuit, can testing efficiency be reduced.
Summary of the invention
The technical problem to be solved in the present invention is, DIO interface test process for prior art is opaque, can only observation test result, the problem that cannot find to hide, the defect such as test process is loaded down with trivial details, testing efficiency is low, provide a kind of digital input-output interface measurement jig and method of testing.
The technical solution adopted for the present invention to solve the technical problems is: construct a kind of digital input-output interface measurement jig, described digital input-output interface comprises multiple digital interface, and it comprises:
Interface module, for being connected with described digital input-output interface;
Channel switching module, it comprises multiple test channel; A digital interface is corresponding with two test channel, and at any time, one in described two test channel another is for exporting test channel for input test passage, and described digital interface selectively switches to described input test passage or exports test channel and be connected;
Switch control module, switches connection for controlling each digital interface between its corresponding input test passage or output test channel;
Status control module is high level input test or low level input test for controlling each input test passage;
Input test display module, for showing the test mode of each input test passage;
Export test display module, for showing the test mode of each output test channel.
In digital input-output interface measurement jig of the present invention, described input test display module comprises multiple display unit, the test mode of a display unit correspondence display input test passage.
In digital input-output interface measurement jig of the present invention, described output test display module comprises multiple display unit, and a display unit shows with corresponding the output test mode that exports test channel.
In digital input-output interface measurement jig of the present invention, described channel switching module comprises multiple relay; A relay correspondence is connected with two digital interfaces; Described switch control module comprises multiple switch; Each Switch Controller should be connected between input power and two relays, and by closed or disconnect and the connection of described input power, to control to switch at the corresponding input test passage of this digital interface and exporting between test channel with the digital interface that each relay connects.
In digital input-output interface measurement jig of the present invention, described status control module comprises multi-way switch, one way switch correspondence is connected between input power and at least one input test passage, and by closed or disconnection and described input power connection, to control each input test passage for high level input test or low level input test.
According to another aspect of the present invention, a kind of digital input-output interface test macro is provided, it comprises digital input-output interface and digital input-output interface measurement jig, and described digital input-output interface comprises multiple digital interface, and described digital input-output interface measurement jig comprises:
Interface module, for being connected with described digital input-output interface;
Channel switching module, it comprises multiple test channel; A digital interface is corresponding with two test channel, and at any time, one in described two test channel another is for exporting test channel for input test passage, and described digital interface selectively switches to described input test passage or exports test channel and be connected;
Switch control module, switches connection for controlling each digital interface between its corresponding input test passage or output test channel;
Status control module is high level input test or low level input test for controlling each input test passage;
Input test display module, for showing the test mode of each input test passage;
Export test display module, for showing the test mode of each output test channel.
In digital input-output interface test macro of the present invention, described input test display module comprises multiple display unit, the test mode of a display unit correspondence display input test passage; Described output test display module comprises multiple display unit, and a display unit shows with corresponding the output test mode that exports test channel.
According to a further aspect of the invention, a kind of industrial control computer test macro is provided, it comprises industrial control mainboard and digital input-output interface measurement jig, described industrial control mainboard is provided with digital input-output interface, described digital input-output interface comprises multiple digital interface, and described digital input-output interface measurement jig comprises:
Interface module, for being connected with described digital input-output interface;
Channel switching module, it comprises multiple test channel; A digital interface is corresponding with two test channel, and at any time, one in described two test channel another is for exporting test channel for input test passage, and described digital interface selectively switches to described input test passage or exports test channel and be connected;
Switch control module, switches connection for controlling each digital interface between its corresponding input test passage or output test channel;
Status control module is high level input test or low level input test for controlling each input test passage;
Input test display module, for showing the test mode of each input test passage;
Export test display module, for showing the test mode of each output test channel.
In industrial control computer test macro of the present invention, described input test display module comprises multiple display unit, the test mode of a display unit correspondence display input test passage; Described output test display module comprises multiple display unit, and a display unit shows with corresponding the output test mode that exports test channel.
According to a further aspect of the invention, provide a kind of digital input-output interface method of testing using described digital input-output interface measurement jig, it comprises the following steps:
A: initialize digital IO interface;
B: receive test instruction, and determine whether digital input test, if enter step C, otherwise, enter step G;
C: configuration register is configured to digital input testing mode, and each digital interface is switched to input test passage;
D: be high level input test or low level input test by the actual test mode of state controlling module controls each input test passage;
E: by input test display module, to show the virtual condition of input test passage; From data register, read the test mode value of each input test passage, and judge that whether test mode value is corresponding with the virtual condition of input test display module, if so, enter step K, otherwise, enter step F;
F: the digital interface that location is abnormal, enters step K;
G: configuration register is configured to digital test output pattern, and each digital interface is switched to output test channel;
H: to data register write test mode value, to carry out combined type test to output test channel;
I: the actual test mode showing each output test channel by exporting test display module, to judge that whether test mode value is corresponding with actual test mode, if so, enters step K; Otherwise, enter step J;
J: the digital interface that location is abnormal;
K: terminate.
Implement digital input-output interface measurement jig of the present invention and method of testing, there is following beneficial effect: by arranging special digital input-output interface measurement jig, thus with the scheme that software restraint combines, integration test is carried out to digital input-output interface, make the reliability and the testing efficiency that improve test result; Relative to single software test, the test process of technical scheme of the present invention is visible, due to digital interface corresponding two test channel respectively on each road, make input test and export test to carry out on different passages, and the corresponding display unit of each digital interface, thus quick position can be carried out to the digital interface of exception; And the process that input test is tested with output can pass through switching over, does not need again to plug tool.
Accompanying drawing explanation
Below in conjunction with drawings and Examples, the invention will be further described, in accompanying drawing:
Fig. 1 is the theory diagram of industrial control computer test macro of the present invention;
Fig. 2 A is the circuit theory diagrams of channel switching module in Fig. 1;
Fig. 2 B is the circuit theory diagrams of input test display module in Fig. 1;
Fig. 2 C is the circuit theory diagrams of Fig. 1 breaker in middle control module;
Fig. 2 D is the circuit theory diagrams exporting test display module in Fig. 1;
Fig. 2 E is the circuit theory diagrams of interface module in Fig. 1;
Fig. 2 F is the circuit theory diagrams of status control module in Fig. 1;
Fig. 3 is the process flow diagram of digital input-output interface method of testing of the present invention.
Embodiment
As shown in Figure 1, in industrial control computer test macro 1 of the present invention, it forms primarily of two parts: the first, testing apparatus, i.e. digital IO measurement jig 3; The second, tested product, is namely arranged on the digital input-output interface 21 in industrial control mainboard 11, and this digital input-output interface 21 comprises multiple digital interface, such as, can be 8 digital interfaces, 16 digital interfaces or 48 digital interfaces.Due to, testing scheme of the present invention is only for digital input-output interface, thus, can form a digital IO test macro 2 by digital IO test interface 21 and this digital IO measurement jig 3.
This digital input-output interface measurement jig 3 mainly comprises six parts: interface module 31, channel switching module 32, switch control module 33, status control module 36, output test display module 34 and input test display module 35.Wherein, this interface module 31 is connection bridges of this digital input-output interface measurement jig 3 and digital input-output interface 21, thus digital input-output interface 21 is connected to channel switching module 32 by this interface module 31, each digital interface of digital input-output interface 21 is connected with a port of channel switching module 32, and then each digital interface is connected to two test channel, these two test channel, one of them is input test passage, another exports test channel, by software merit rating and hardware operation, this digital interface is carried out between two test channel selection to switch, thus ensure that any time can only carry out input test or export test.For, the switching of each digital interface between input test passage and output test channel, controls by switch control module 33, can be specifically, when the switch in this switch control module 33 closes, namely during conducting input power 38, digital interface is switched to input test passage; When the switch in this switch control module 33 disconnects, when namely turning off input power 38, digital interface is switched to output test channel; Or also can be when the switch in this switch control module 33 closes, namely during conducting input power 38, digital interface is switched to output test channel; When the switch in this switch control module 33 disconnects, when namely turning off input power 38, digital interface is switched to input test passage.
When carrying out input test, each digital interface all with input test channel connection, and can be selected to carry out high level test or low level test by status control module 36, specifically when the switch in closure state control module 36, namely, during conducting input power 38, high level test is carried out to the digital input channel of this digital interface; When the switch of off-state control module 36, when namely turning off input power 38, by input test passage ground connection, thus low level test is carried out to the input test passage of this digital interface.In addition, one end of each input test passage is connected with digital interface, the other end is connected with the display unit of in input test display module 35, thus can by current input test state by a specific display unit output display, achieve the visual of test process, thus can when noting abnormalities digital interface, can the digital interface of quick position exception.
When carrying out output test, each digital interface is all communicated with output test channel, namely one exports one end and a digital orifice of test channel, the specific display unit that the other end tests display module with output is communicated with, thus when carrying out array output test, namely export complete bright test, entirely go out test, horse race lamp test etc. time, by checking the display unit test mode that each digital interface is corresponding, thus can when noting abnormalities digital interface, can the digital interface of quick position exception.
For output test display module 34, it comprises multiple display unit, is further used for one of them display unit corresponding with a digital interface, to show the current output test of this digital interface.When specific design, this display unit can be an independently display unit, also can be the one display state in numeral method unit.
In embodiment as shown in Fig. 2 A ~ 2F, this digital input-output interface 21 has 16 digital interfaces, and as shown in Figure 2 A, this channel switching module 32 comprises 8 relays, and each relay correspondence controls two digital interfaces.As shown in Figure 2 C, this switch control module 33 comprises two Switch Controller should control four relays, thus when the connection of the switch of two in Closing Switch control module 33 and input power VCC5, coil in corresponding relay obtains electric, thus relay carries out saltus step, realize being switched to another test channel from a test channel.Otherwise, when the connection of the switch of two in cut-off switch control module 33 and input power VCC5, i.e. ground connection, the coil blackout of relay, thus relay carries out reverse saltus step, carries out the saltus step of test channel.As shown in Figure 2 B, this input test display module 35 is shown by the input test state of digital pipeline section to current each digital interface, meanwhile, when carrying out output test, this input test module 35 can switch to output test channel, carries out output test display.As shown in Figure 2 D, this output test display module 34 is made up of 16 display units, the corresponding digital interface of each display unit, thus carry out corresponding test mode display.As shown in Figure 2 E, this interface module 31 is dual inline type stands, both sides correspondence arranges pin, with corresponding connection digital interface to the relay in channel switching module, understandable, this interface module can be also an interface chip, and the digital input-output interface realized having 16 digital interfaces carries out bridge joint.As shown in Figure 2 F, this status control module 36 comprises 8 switches, and each Switch Controller should control two input test passages, carries out high level state test or low level state is tested by realizing control inputs test channel with the conducting and shutoff of input power.
Digital input-output interface method of testing as shown in Figure 3, its idiographic flow is as follows:
S1: initialize digital IO interface; Wherein, because digital input-output interface 21 can be drawn by different hardware plans, such as south bridge (ICH), SMBUS, SuperIO etc., and IC pins corresponding to the quantity of the data register of different scheme digital input-output interfaces 21, configuration register, digital interface, each digital interface etc. are all different, therefore design configuration file is needed, be used for configuring the parameter information of this digital input-output interface, thus when testing beginning, its initialized process is read the parameter information in configuration file.
S2: receive test instruction, and determine whether digital input test, if enter step S3, otherwise, enter step S7;
S3: configuration register is configured to digital input testing mode, and the connection passing through switch control module 33 conducting or shutoff and input power 38, be switched to input test passage by each digital interface;
S4: the actual test mode being controlled each input test passage by status control module 36 is high level input test or low level input test, wherein, during the connection of status control module 36 conducting input test passage and input power 38, carry out high level input test, when status control module 36 turns off the connection of input test passage and input power 38, i.e. ground connection, carries out low level input test;
S5: the test mode value reading each input test passage from data register, simultaneously, the actual test mode of the input test passage corresponding to each digital interface is shown intuitively by each display unit, thus judge that whether test mode value is corresponding with actual test mode, if, enter step S11, otherwise, enter step S6;
S6: when test mode value and actual test mode are not identical, namely corresponding digital interface occurs abnormal, now gets final product the digital interface of quick position exception, enters step S11;
S7: configuration register is configured to digital test output pattern, and the connection passing through switch control module 33 conducting or shutoff and input power 38, be switched to output test channel by each digital interface;
S8: to data register write test mode value, to carry out combined type test to output test channel, such as by control to export entirely bright, entirely go out, horse race lamp, numeral method write data from forms such as the numerals of 0-9 to data register; Computer program makes all LED be in bright state, if having one or more lamp for going out, test crash according to the rule of setting; Mode for " horse race lamp " is tested, if some display unit lamps show not in accordance with ordinal variable, then and test crash; For the display of adjacent display unit state various combination, if certain adjacent two display unit is all bright or goes out, then test crash; The state of going out is in for all display unit lamps, if there is one or more display unit bright, then test crash; For the numeral of numeral method from 0-9, if there is display imperfect or incorrect situation, then test crash during test;
S9: the actual test mode showing each output test channel by exporting test display module, to judge that whether test mode value is corresponding with actual test mode, namely judge whether corresponding the value in data register is compared with the display result of display unit, if so, enter step S11; Otherwise, enter step S10;
S10: when test mode value and actual test mode are not identical, namely corresponding digital interface occurs abnormal, now gets final product the digital interface of quick position exception;
S11: terminate.
The present invention is described by some embodiments, and those skilled in the art know, without departing from the spirit and scope of the present invention, can carry out various change or equivalence replacement to these characteristic sum embodiments.In addition, under the teachings of the present invention, can modify to adapt to concrete situation and material to these characteristic sum embodiments and can not the spirit and scope of the present invention be departed from.Therefore, the present invention is not by the restriction of specific embodiment disclosed herein, and the embodiment in the right of all the application of falling into all belongs to protection scope of the present invention.