Summary of the invention
For above-mentioned shortcoming and defect, the present invention proposes a kind of automatically testing platform of the programmable logic controller (PLC) for multiple CPU of having with programmable relay structure.
The present invention seeks to set up automatically testing platform with programmable relay construction, test the isolation/non-channel isolation of the programmable logic controller (PLC) of multiple CPU of having, with retrofit testing efficiency and reduce test period and cost of development.
The computing machine that platform hardware of the present invention communicates by multiple surveying instruments, by the communication port such as GPIB or RS232 or ModBUS and surveying instrument and adopt the test channel that auxiliary relay types PLC realizes to select control module to form.
Test channel is selected the structure of control module to make test platform setting more flexibly and can in the I/O of PLC test, be more widely used.System of the present invention is supported the test of analog module, digital module.
Particularly, according to the present invention, a kind of programmable logic controller (PLC) for multiple CPU of having (PLC) automatically testing platform that test sample book is tested is provided, comprise: multiple surveying instruments, be used for coordinating test that corresponding test function need to be provided, described multiple surveying instruments comprise programmable DC power supply, multimeter, controlled incubator; Test channel is selected control module, comprise: the basic control module with programmable relay structure, basic control module is connected with the I/O passage of multiple PLC test sample books, the channel setting instruction of receiving computer, according to channel setting, the passage of test sample book is selected and is controlled in instruction; The computing machine of selecting control module to communicate by communication port and multiple surveying instrument, test channel.Wherein, computing machine changes the output voltage of programmable DC power supply or electric current to select control module to set test input voltage or the current value of the load module of tested PLC sample by test channel by communication; Computing machine reads the test output voltage of load module or the internal conversion value of current signal of tested PLC sample by communication; Computing machine is by the test input voltage of output module or the internal conversion value of current signal of Control on Communication and the tested PLC sample of modification; Computing machine is read via test channel and is selected control module to be sent to multimeter and by test output voltage or the current value of the output module of the measured tested PLC sample of multimeter by communication.
Wherein, test channel selects control module also to comprise expansion control module, is attached to basic control module, has programmable relay structure, is connected with the I/O passage of multiple PLC test sample books.The channel setting instruction of basic control module receiving computer, controls the passage of expanding control module selection and controlling test sample book.
Wherein, computing machine uses LabVIEW software to monitor tested multiple PLC test sample books according to ModBUS sequence of addresses.
Wherein, basic control module selects TWDLCAE40DRF model PLC and expansion control module to select multiple TWDDRA16RT model PLC.
Wherein, numeral or the analog input module of test PLC test sample book, or numeral or the analog output module of test PLC test sample book.
Wherein, between each passage of the module of PLC test sample book, be isolation or be non-isolation.
Wherein, if the passage of the input isolation module of test PLC test sample book selects test channel all relay switchs in control module to arrive input channel and common passage; If the passage of the output isolation module of test PLC test sample book, selects test channel all relay switchs in control module to arrive output channel and common passage; If test PLC test sample book is the non-isolation module of input, Control common passage in only use test channel selecting control module, the input of other other passage of Control in then use test channel selecting control module; If test PLC test sample book is the non-isolation module of output, Control common passage in only use test channel selecting control module, the output of other other passage of Control in then use test channel selecting control module.
The present invention can test analog input and output module or the digital input and output module of programmable logic controller (PLC) (PLC) automatically.This system architecture not only can be used for the PLC test of the non-isolation of single channel, the non-isolation of hyperchannel by programmable instrument, and can be for the batch testing of the PLC of hyperchannel isolation.Compared with fixed relay system structure of the prior art, system architecture of the present invention more accurately, flexibly and save time.Facts have proved that PLC automatically testing platform of the present invention can save a large amount of human resources, greatly shorten PLC test period.
Embodiment
To introduce in detail now example embodiment of the present invention, its example is shown in the drawings.Embodiment is described with reference to the accompanying drawings with explanation the present invention.
Fig. 1 is according to the schematic diagram of the programmable logic controller (PLC) automatically testing platform of employing programmable relay structure of the present invention.
As shown in Figure 1, according to the programmable logic controller (PLC) automatically testing platform of employing programmable relay structure of the present invention comprise upper control computer 1, programmable DC power supply 2, multimeter 3, the test channel with programmable relay structure is selected control module 4, controlled incubator 5, the multiple PLC that are placed in controlled incubator 5 measure sample module EUT1......EUTn, n >=1, n is integer.In programmable logic controller (PLC) automatically testing platform according to the present invention, upper control computer 1 selects control module 4, controlled incubator 5 etc. to communicate for the equipment of testing with programmable DC power supply 2, multimeter 3, test channel.
For example, upper control computer 1 communicates to change the output voltage of programmable DC power supply 2 or electric current to select control module 4 to set test input voltage or the current value of the load module of tested PLC by test channel by GPIB port; Then, upper control computer 1 communicates to read the test output voltage of load module or the internal conversion value of current signal of tested PLC sample module EUT1......EUTn by ModBUS.
Host computer 1 communicates to control and revise the test input voltage of output module or the internal conversion value of current signal of tested PLC sample module EUT1......EUTn by ModBUS; Upper control computer 1 communicates to read via test channel by RS232 port selects control module 4 to be sent to multimeter 3 and by test output voltage or the current value of the output module of the measured tested PLC sample module EUT1......EUTn of multimeter 3.
Wherein, PLC measurement sample module EUT is the PLC system with CPU module.Instruction and parameter that the CPU module responds of measurement sample module EUT receives from upper control computer 1, set the transforming numerical of the voltage/current signals of the output channel of output module, or to upper control computer 1, return to the conversion value of input gap voltage/current signal measured value of load module.
The temperature that upper control computer 1 is communicated that the target temperature of controlled incubator 5 is set and be can read and control controlled incubator 5 by RS232 port.Wherein programmable DC power supply 2 is for voltage or the electric current supply of the input channel of the analog or digital of PLC, and multimeter 3 is for output channel voltage or the current measurement of the analog or digital of PLC.Programmable DC power supply 2, multimeter 3 are connected to test channel simultaneously and select in control module 4.
According to the present invention, upper control computer 1 communicates to arrange test channel by ModBUS and selects control module 4 to select and to control the passage of test sample book.Test channel selection control module 4 comprises the employing basic control module 41 that for example TWDLCAE40DRF model PLC realizes with programmable relay structure.Basic control module 41 is connected with the I/O passage of multiple PLC test sample books.TWDLCAE40DRF model PLC is the PLC that exchanges 24 inputs, 14 point relaies, 2 transistor outputs, built-in ethernet mouth.Basic control module 41 receives the channel setting instruction of upper control computer 1 by ModBUS, the annexation that 14 point relaies in the PLC of TWDLCAE40DRF model are set according to received channel setting instruction with and connect, disconnect that action is selected and the passage of control PLC test sample book.
If total number of channels of PLC test sample book exceeds the number of channels that basic control module 41 can be tested, test channel selects control module 4 can also comprise the expansion control module 42 with programmable relay structure that is attached to basic control module 41, and expansion control module 42 is connected with the I/O passage of multiple PLC test sample books.Expansion control module 42 can realize by the PLC that adopts multiple for example TWDDRA16RT models with programmable relay structure, and TWDDRA16RT model PLC is 16 point relay outputs.
In the situation that there is expansion control module 42, basic control module 41 receives the channel setting instruction of upper control computer 1 by ModBUS, control expansion control module 42 and select and control the passage of test sample book, according to received channel setting instruction, expansion control module 42 arrange 16 point relay annexations in the PLC of TWDDRA16RT model with and connect, disconnect action and select and control the passage of test sample book.
Can carry out programming and testing channel selecting control module 4 according to different test sample book situations.For example, if the passage of the input isolation module of test sample book, arrives input channel and common (Com end) passage by all relay switchs in basic control module 41 or expansion control module 42 (if having expansion control module 42); If the passage of the output isolation module of test sample book, arrives output channel and common (Com end) passage by all relay switchs in basic control module 41 or expansion control module 42 (if having expansion control module 42); If test sample book is the non-isolation module of input, can only use a Control common (Com end) passage in basic control module 41 or expansion control module 42 (if having expansion control module 42), then use the input of other other passage of Control in basic control module 41 or expansion control module 42 (if having expansion control module 42), and can measure at the same time multiple test sample book input channels; If test sample book is the non-isolation module of output, can only use a Control common (Com end) passage in basic control module 41 or expansion control module 42 (if having expansion control module 42), then use the output of other other passage of Control in basic control module 41 or expansion control module 42 (if having expansion control module 42), and can measure at the same time multiple test sample book output channels.
By the programming software of PLC selected in basic control module 41 or expansion control module 42 (if having expansion control module 42), complete the programming of basic control module 41 or expansion control module 42 (if having expansion control module 42) repeat circuit, for example can use the PLC of Twido series as the Control PLC in basic control module 41 or expansion control module 42 (if having expansion control module 42), then the annexation between using Twido software programming and arranging in test sample book and basic control module 41 or expansion control module 42 (if having expansion control module 42) according to measurement demand.
In the programmable logic controller (PLC) automatically testing platform of employing programmable relay structure according to the above embodiment of the present invention, the PLC that employing has programmable relay structure realizes basic control module 41 and the expansion control module 42 in test channel selection control module 4, but, the invention is not restricted to PLC, can also adopt other similar structures to realize.
Upper control computer 1 is the core of automatically testing platform of the present invention, can for example adopt the graphical program compilation platform LabVIEW (Laboratory Virtual Instrumentation Engineering Workbench, laboratory virtual instrument engineering platform) of being developed by American National instrument company (NI company) to carry out programming and testing.All command-control signals all send thus, and all setting numerical value/measurement results for measuring also all set/finally obtain and generate test result form at this
According to the programmable logic controller (PLC) automatically testing platform of employing programmable relay structure of the present invention, be mainly used in the analog quantity I/O module in the PLC of multiple CPU of possessing, the automatic test of digital quantity I/O module.As automatically testing platform, hardware aspect it comprise multiple by tested module (test sample book), such as programmable DC power supply 2, multimeter 3, test channel, select ATE (automatic test equipment) (ATE) and the relevant communication connection of control module 4, controlled incubator 5; Software aspect is included in the Software for Design such as for example LabVIEW in for example PLC IDE in programming and testing channel selecting control module 4 (programmable logic controller (PLC) Integrated design environment) and upper control computer 1.
Wherein, the analog module of PLC is the module for the analog voltage/current of input being measured and exported according to setting numerical value corresponding analog voltage/current, analog module generally comprises multiple passages, and passage is divided into two types: for the input channel of input analog amount with for exporting the output channel of analog quantity.Analog module is mainly converted to corresponding numerical value by the analog voltage of outside input or current value by linear scaling by input channel and the numerical value measuring and by output channel, user is set is converted to corresponding analog voltage or the current value line output of going forward side by side by linear scaling.Therefore, analog quantity I/O module testing analog input amount and imitated output quantity, mainly comprise accuracy coefficient, nonlinearity and temperature characterisitic etc.
For example, programmable DC power supply 2 provides power supply as input power for the analog input module of measuring sample PLC.Whether upper control computer 1 is controlled programmable DC power supply 2 by the output state of the relay in basic control module 41 or the expansion control module 42 (if having expansion control module 42) of control test channel selection control module 4 and is connected with load module.In this way, State selective measurements sample PLC's by tested passage.PLC program will be downloaded in the CPU of test sample book PLC, thereby the input value of test sample book PLC will be moved to corresponding register.And upper control computer 1 can read by Modbus the value of these registers in CPU.
When user wants test simulation amount output module, test platform can be switched to output mode.In this case, upper control computer 1 can write the value of setting by Modbus the corresponding register in the CPU of test sample book PLC.And the PLC program of downloading moves to output channel by these values.With multimeter 3, collect the output valve of measured module, existing side by side is about to export data and is sent to upper control computer 1.
In the test of execution and temperature correlation, upper control computer 1 and controlled incubator 5 are coupled together by RS-232 cable.Therefore control controlled incubator 5 and move special time period at a temperature, and after upper control computer 1 has obtained all values, at next temperature, move.Save the data in EXCEL worksheet in order to processing in the future.
On the other hand, the digital quantity input module of PLC is that on-the-spot various switching signals are converted to the standard signal for PLC inter-process.The digital output module of PLC is the inner PLC switching signal arranging or process to be outputed to scene carry out corresponding control.Digital quantity I/O module testing test digital input amount and digital output module, comprise input and output value, voltage and current threshold value, frequency test etc.
Digital quantity I/O module testing is used the test configurations identical with analog quantity I/O module testing, is only the particular content difference of the LabVIEW application program in upper control computer 1.
According to the programmable logic controller (PLC) automatically testing platform of employing programmable relay structure of the present invention owing to can the PLC sample of multiple CPU of containing being tested, upper control computer 1 arranges different the next ModBUS addresses for each test sample book, and LabVIEW will test test sample book successively according to the next ModBUS address.
According to the programmable logic controller (PLC) automatically testing platform of employing programmable relay structure of the present invention, be used for the I/O test of the PLC product that contains CPU.In test platform of the present invention, after test sample book has connected, user only need need to arrange neatly the corresponding state of the relay in test channel selection control module 4 in upper control computer 1 according to test, and other is set tests relevant parameter, then working procedure, test can automatically be carried out.Simulation with I/O module that therefore can configure easily PLC is measured, digital I/O module is measured, and greatly reduces PLC test duration and cost.
Although illustrated and described the example embodiment of the present invention of considering, but it will be appreciated by those skilled in the art that, along with the progress of technology, can make various changes and revise and can replace its element and not deviate from true scope of the present invention with equivalent.