Publication No. 981049 Rev. B
PXIe-3352 User Manual
Astronics Test Systems
Software Operation 4-3
Using the LabWindows / CVI Driver
The LabWindows / CVI driver provides a ‘C’ language programming interface.
This driver also includes a 32-bit and 64-bit DLL that can be used within various
programming environments such as Microsoft Visual Studio C++ and C#.
The first step to using any of the functions in the driver is to call the “ri3352e_init()”
function. This function takes the VISA descriptor that identifies which instrument is
being accessed and returns a “handle”. All of the other functions in the driver use
this handle.
The last step in using the driver is to call the “ri3352e_close()” function. Each time
you make a call to the “ri3352e_init()” function, it returns a new handle and
allocates some memory for that driver session. Calling the “ri3352e_close()”
functions releases the memory and resources associated with the handle.
A skeleton program will look something like what is shown below.
#include <ri3352e.h>
int main(int argc, char *argv[])
{
ViSession hdl3352e;
ViStatus err;
// call the initialize function
err = ri3352e_init(“PXI32::15::INSTR”, VI_TRUE, VI_TRUE,
&hdl3352e);
// check the error code
if (err < 0)
{
// do something / report error
ViChar errMsg[256];
ri3352e_error_message(hdl, err, errMsg);
printf(“ri3352e_init() returned error code %d\n”, err);
printf(“error message = ‘%s’\n”, errMsg);
return err;
}