VXi VT1529A/B 사용자 설명서

다운로드
페이지 529
Programming the VT1422A & VT1529A/B for Remote Strain Measurement   85
Custom 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 (mxbseq.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 bridge configuration switches */
errStatus=hpe1422_cmd(sessn,"sens:str:bridge fben,(@10000:10007)");
/* optionally set VT1529A/B input filters (2, 10 or 100 Hz) */
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)");
/* enable excitation voltage to strain bridges. Note that excitation is
   switched in banks of channels. So "VT1529A/B relative" channels to switch
   are 0, 8, 16 and 24. The channel-range shown works too and is easier. */
errStatus=hpe1422_cmd(sessn,"sense:strain:excitation:state ON,(@10000:10007)");
/* set the data FIFO format for the command module to 64-bit */
errStatus=hpe1422_cmd(sessn,"FORM PACK,64");
/* measure the excitation voltage at each bridge. The values go to the
   FIFO. We'll put them in their own array */
errStatus=hpe1422_cmdInt16_Q(sessn,"meas:volt:excitation? (@10000:10007)", &result16);
/* read the values from the FIFO. count returns number actually read */
errStatus=hpe1422_readFifo_Q(sessn, 0, 512, exc_array, &count);
/* 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);
/* read the values from the FIFO. count returns number actually read */
errStatus=hpe1422_readFifo_Q(sessn, 0, 512, uns_array, &count);
/************************ Custom EU Pre-processing ***************************
 *                                                                           *
 *  Solve your custom equation for M (slope) and B (offset) as a function    *
 *  of channel Vexcitation (exc_array), Vunstrained (uns_array) and          *
 *  gage factor.                                                             *
 *  For this example, we'll just fix M and B at 2 and 0 respectively.        *
 *                                                                           *
 *  **************************************************************************
*/
M=2;
B=0;
     
/* download your derived Ms and Bs. We show downloading the same M and B to all 8
   channels. For highest accuracy, you would generate M and B for each channel to
   account for the channel-to-channel variability of the unstrained and excitation
   values measured. */
 /* create scpi command string with M, B and channel list */
    sprintf( cmd_str, "diag:cust:mxb %f, %f,(@%s)", M, B, "10000:10007");
errStatus=hpe1422_cmd(sessn,cmd_str);
/* link your derived linear EU conversion(s) to the required channels */
errStatus=hpe1422_cmd(sessn,"sens:func:custom (@10000:10007)");
/* set up the scan list to include the strain channels to measure bridge outputs */
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 */