The hottest test engine based on LabWindowsCVI

  • Detail

Design and implementation of test engine based on labwindows/cvi

1. Introduction

at present, virtual instruments, data acquisition modules and GPIB instruments with VXI, PXI and PC-DAQ architectures, as well as test software such as labvew, labwindows/cvi and HP VEE provide a good development environment for the development of large-scale test systems. However, due to the complexity of VXI and the huge CVI software, Equipment testers are still unable to enter the development state in a short time. Therefore, the research group establishes a test engine between the test process and specific instrument control, which not only simplifies the program design, but also completely isolates the instrument control from the test program, and realizes the purpose that the change of hardware platform will not affect the program

as shown in Figure 1, the general structure of the virtual instrument test system is composed of three parts: hybrid bus measuring instrument and data acquisition module, special transfer and signal conditioning module, and the tested object. Virtual instruments are mainly composed of VXI, PXI, IPC bus instrument modules and their drivers. Some GPIB bus desktop instruments are often used in the test system, such as DC regulated power supply, spectrum analyzer, etc. The special transfer and signal conditioning module is a special module designed by the research group according to the specific tested object, including the signal transformation, power drive, analog load and other circuits of the tested object. The tested objects include various electronic combinations in weapon equipment, such as clock combination of guidance radar, video receiver, transmitter, display, data processing combination, etc. We define the interface between the measuring instrument and the special transfer module as AI (a1~aa), and the interface between the special transfer module and the tested object as Bi (b1~bn). The test program realizes all test functions by controlling the input and output of the instrument

2. Test engine hierarchy

the measurement and control system is generally composed of four parts: man-machine interface, data processing, test engine, namely data acquisition engine and fault diagnosis engine. With the continuous improvement of the function of visual development software, the establishment of man-machine interface becomes an easy thing: the data processing program varies according to specific tests, and it can still be well solved with the support of data processing library provided by CVI. Therefore, the key to the development of measurement and control system is to complete the test engine and fault diagnosis engine

the structure of the test engine is shown in Figure 2, which can be divided into five parts: function layer, logic layer, instrument operation layer, interface configuration file and interface configuration tool

2.1 function layer

the function layer is the highest level of the whole structure, so the reform is deepened. For the end users of the test system development, the test system development is completely aimed at the B interface, and the function layer does not appear any information related to the instrument. Therefore, it is completely isolated from the test system, and describes the process related to the test process and result judgment

2.2 logic layer

the logic layer maps the functions of the function layer to instruments and channels with logical names, which can point to a specific device in the test system. When the instrument module is replaced, it is only necessary to change the direction of the logical name to a new device, which is instrument independent

2.3 instrument operation layer

the instrument operation layer uses the instrument driver or the dynamic link library provided with the instrument module to control all operations of the hardware. The instrument driver includes VPP specification, IVI (interchangeability virtual instrumentation) specification, and the underlying interface driver

2.4 interface configuration file

interface configuration file stores the mapping information of a and B interfaces, the instrument and channel to which the interface belongs, the operation function of the channel, and other additional conditions that the instrument should have

2.5 interface configuration tool

interface configuration tool is used to interactively configure the mapping relationship of a and B interfaces, the connection mode of multi-channel switch and digital multimeter, oscilloscope and other information, and is stored in the configuration file for use by the test engine

3. Test engine data model

test engine is two software packages that encapsulate the specific function implementation details of virtual instruments and provide external function libraries and configuration tools with standard function interfaces, Put all instruments (the minimum set is the instruments in this test system)> classify the functions that can be realized, ignoring the implementation details of each instrument. For example, the functional interface of digital multimeter and a/d module for measuring voltage is the same. The specific operation of the instrument depends on the connection relationship between the instrument interface and the tested object, and the connection relationship is automatically obtained by the engine according to the configuration file.

the function of the general test engine is to describe the test process Functions are mapped to specific instrument control routines, In order to complete the mapping relationship, first introduce the following data model:

function set: f={fi| data parameter set: d={di|1 instrument logical name: n={ni|1 instrument corresponding channel classification: c={ci|1 function set of each type of instrument and channel: Fu= {fui|1

4. Implementation of test engine

the core of test engine is instrument control, interface mapping, state cache, which is developed by labwindows/cvi software.

4.1 instrument control

most instruments of VXI, GPIB, RS232, PXI bus have their own instrument drive productivity sequence and function panel, which can interactively introduce functions after loading through the instruments load menu in the CVI integrated environment. For those instruments that do not provide VPP compliance The module of standard driver adopts visa i/o library function to control the instrument through SCPI command

since most domestic ISA, PCI, PCMCIA and other bus data acquisition cards do not provide a function panel that can be loaded twice in CVI, the test engine calls the corresponding * DLL library functions to control the operation of the acquisition card

the former is expensive

4.2 function mapping

the mapping function is realized by the method of function pointer, and the function is declared in the header file as follows:

typedef void (*menufun) (void)//Define function type

void select_ fun(menufun f);//Function selection function

void m1(), m2(), m3(), m4(), m5(), m6(), m7(), m8(), m9()//Functions that perform different subfunctions

set the function name in the source file as the following variables:


Copyright © 2011 JIN SHI