Built-in eu conversion command sequence – VXI VT1422A User Manual

Page 84

Advertising
background image

82 Programming the VT1422A & VT1529A/B for Remote Strain Measurement

Chapter 3

Built-in EU Conversion

Command Sequence

Below is an example VXIplug&play command sequence. Note that this is
not executable; it has been simplified for easier reading. The C++ example
source file (euseq.cpp) is on the CD supplied with the instrument.
View the readme.txt file provided with the VXIplug&play driver for
example program file location.

/* set Engineering Units (function) to strain */
errStatus=hpe1422_cmd(sessn,"sens:func:str:hben auto,(@10000:10003)");
errStatus=hpe1422_cmd(sessn,"sens:func:str:fben auto,(@10004:10007)");

/* optionally set VT1529A/B input filters (2, 10 or 100Hz) */
errStatus = hpe1422_cmd(sessn,"input:filter:frequency 10,(@10000:10007)");
/* optionally enable VT1529A/B input filters (approx 100 kHz when OFF) */
errStatus = hpe1422_cmd(sessn,"input:filter:state ON,(@10000:10007)");

/* send gage factors to channel EU conversion routines */
errStatus=hpe1422_cmd(sessn,"sense:strain:gfactor 2,(@10000:10003)");
errStatus=hpe1422_cmd(sessn,"sense:strain:gfactor 2.5,(@10004:10007)");

/* measure the excitation voltage at each bridge. The values go to the
channel EU conversion as well as the FIFO. We'll clear the FIFO */
errStatus=hpe1422_cmdInt16_Q(sessn,"meas:volt:excitation? (@10000:10007)", &result16);
errStatus=hpe1422_cmd(sessn,"sense:data:fifo:reset"); /* throw away exc readings */

/* measure the unstrained bridge voltage at each bridge. The values go to the
channel EU conversion as well as the FIFO. We'll clear the FIFO */
errStatus=hpe1422_cmdInt16_Q(sessn,"meas:volt:unstrained? (@10000:10007)", &result16);
errStatus=hpe1422_cmd(sessn,"sense:data:fifo:reset"); /* throw away exc readings */

/* set up the scan list to include the strain channels to measure */
errStatus=hpe1422_cmd(sessn,"route:sequence:define (@10000:10007)");

/* set up the trigger system to make one scan for each trigger.
Note that the default is one scan per trigger and trigger source
is TIMer, so we only have to INITiate the trigger system to
take readings. */
errStatus=hpe1422_cmd(sessn,"trigger:count 1"); /* *RST default */
errStatus=hpe1422_cmd(sessn,"trigger:source TIMer"); /* *RST default */
errStatus=hpe1422_cmd(sessn,"arm:source IMMediate"); /* *RST default */

/* set up the sample timer. This controls the channel to channel scan
rate and can be important when channels need more than the default
40 microsecond sample time. */
errStatus=hpe1422_cmd(sessn,"sample:timer 40E-6"); /* *RST default */

/* set the data FIFO format from a command module to 64-bit */
errStatus=hpe1422_cmd(sessn,"FORM PACK,64");

/* INITiate the trigger system to execute a measurement scan */
errStatus=hpe1422_cmd(sessn,"INIT:IMMediate");

/* retrieve readings from FIFO. Notice that for each scan, we read the
number of values in the FIFO (sens:data:fifo:count?), then apply
that value to control the number of readings we read with the
hpe1422_readFifo_Q() function. For continuous data acquisition, see
Chapter 4 of the manual under "Reading Fifo Data." */
errStatus=hpe1422_cmd(sessn,"INIT:IMMediate");

/* find the number of readings present in the FIFO */
errStatus=hpe1422_cmdInt32_Q(sessn,"sense:data:fifo:count?",&result32);

/* read the values from the FIFO. count returns number actually read */
errStatus=hpe1422_readFifo_Q(sessn, result32, 65024, f64_array, &count);

Advertising
This manual is related to the following products: