Acqiris U5309A User Manual page 57

Acquisition card, 2 or 8 channels, 8-bit, 500 ms/s to 2 gs/s, dc to 500 ghz bandwidth, with real-time processing
Hide thumbs Also See for U5309A:
Table of Contents

Advertisement

Initializing the Driver
Calling AqMD3_InitWithOptions will establish an I/O connection to an instrument (often referred to
as an "I/O session") or setup the driver to work in simulation mode. Calling AqMD3_close at the end
of your program is required by the IVI specifications, else unpredictable driver behavior could result.
Any resources held by the driver will not be properly released if close is not called.
For more details on initializing the driver, see AqMD3.chm, section Initializing the Driver.
ViSession session;
ViStatus status;
status = AqMD3_InitWithOptions("PXI40::0::0::INSTR", VI_TRUE, VI_TRUE, "", &session);
status = AqMD3_close(session);
Initializing Using Options
This example shows how IVI-defined initialization options and driver-specific options can be passed to
the Initialize function.
// If true, this will query the instrument model and fail initialization
// if the model is not supported by the driver
ViBoolean idQuery = VI_FALSE;
// If true, the instrument is reset at initialization
ViBoolean reset = VI_FALSE;
// Setup IVI-defined initialization options
ViConstString standardInitOptions =
"Cache=true, InterchangeCheck=false, QueryInstrStatus=true, RangeCheck=true,
RecordCoercions=false, Simulate=false";
status = AqMD3_InitWithOptions("PXI40::0::0::INSTR", idQuery, reset, standardInitOptions,
&session);
status = AqMD3_close(vi);
Accessing Attributes
Accessing attributes in an IVI-C driver is accomplished via a set of IVI-defined accessor functions.
There are two accessor functions for each attribute type -- one accessor for reading attribute values
and another accessor for writing attribute values.
The standard attribute accessors for reading attribute values are:
GetAttributeViInt32
GetAttributeViInt64
GetAttributeViReal64
GetAttributeViBoolean
GetAttributeViString
Correspondingly, the standard attribute accessors for writing attribute values are:
SetAttributeViInt32
SetAttributeViInt64
SetAttributeViReal64
SetAttributeViBoolean
SetAttributeViString
Each attribute accessor takes an attribute ID that uniquely identifies the attribute to access. These
attribute IDs are #define'd constants listed in the AqMD3.h header file and documented in the
"Attributes by Name" section of the help file.
The following example demonstrates basic usage of attribute accessors to read and write IVI-C driver
attribute values.
U5309A User's Manual
6.2   Programming with the IVI-C Driver in various development environments
57

Advertisement

Table of Contents
loading

Table of Contents