www.vtiinstruments.com
EX1629 Programming
75
O
PENING AN
I
NSTRUMENT
S
ESSION
Prior to performing any programmatic actions with an instrument, a session must be opened. The
following sample code illustrates this using the EX1629 VXI
plug&play
driver, along with
querying the revision of the instrument driver and instrument firmware.
Sample Code
ViStatus result = VI_SUCCESS;
ViChar instrrev[256];
ViChar driverrev[256];
ViChar filename[256];
ViSession vi;
ViChar errDescription[256] = "";
/* open a session */
result = vtex1629_init(instr, VI_ON, VI_ON, &vi);
if(result != VI_SUCCESS) {
vtex1629_error_message(vi, result, errDescription);
printf(errDescription);
}
/* query the driver and firmware revision */
result = vtex1629_revision_query(vi, driverrev, instrrev);
if(result != VI_SUCCESS) {
vtex1629_error_message(vi, result, errDescription);
printf(errDescription);
}
/* display results */
printf("Driver Revsion: %s\n", driverrev);
printf("Instrument Firmware Revision: %s\n", instrrev);
Note that in the sample code above, error code checking and handling is included. The structure
used above can be used as a template for all functions. In the examples that follow, error code
checking and handling has not been included for brevity.
C
LOSING AN
I
NSTRUMENT
S
ESSION
In order to release system resources, applications should close instrument sessions when finished
with them. The following code illustrates this.
Sample Code
/* close the instrument session*/
result = vtex1629_close(vi);
C
ONFIGURING THE
A
CQUISITION
C
HANNELS
Configuration of the EX1629 is an application-specific process. The following sample code,
however, will satisfy many applications and may serve as a template. The sample code does the
following:
Configures the scanlist to contain all 48 channels
Configures all channels for quarter-bridge 120 Ω strain gage EU (which also configures the
input multiplexer and completion resistors appropriately)
Sets the gain to 100X (most sensitive)
Disables the IIR filters
Sets the excitation voltage to ±2.5 V, and enables the excitation supplies
Sets the sampling rate to 100 Sa/s
Содержание EX1629
Страница 310: ...VTI Instruments Corp 310 EX1629 Command Set...
Страница 342: ...VTI Instruments Corp 342 EX1629 Onboard Memory...