UL for Linux
A user library to access supported MCC hardware in Linux
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions
Analog Input

Configure the analog input subsystem and acquire data. More...

Functions

UlError ulAIn (DaqDeviceHandle daqDeviceHandle, int channel, AiInputMode inputMode, Range range, AInFlag flags, double *data)
 Returns the value read from an A/D channel. More...
 
UlError ulAInScan (DaqDeviceHandle daqDeviceHandle, int lowChan, int highChan, AiInputMode inputMode, Range range, int samplesPerChan, double *rate, ScanOption options, AInScanFlag flags, double data[])
 Scans a range of A/D channels, and stores the samples in an array. More...
 
UlError ulAInScanStatus (DaqDeviceHandle daqDeviceHandle, ScanStatus *status, TransferStatus *xferStatus)
 Returns the status, count, and index of an A/D scan operation. More...
 
UlError ulAInScanStop (DaqDeviceHandle daqDeviceHandle)
 Stops the analog input operation currently running. More...
 
UlError ulAInScanWait (DaqDeviceHandle daqDeviceHandle, WaitType waitType, long long waitParam, double timeout)
 Returns when the scan operation completes on the specified device, or the time specified by the timeout argument elapses. More...
 
UlError ulAInLoadQueue (DaqDeviceHandle daqDeviceHandle, AiQueueElement queue[], unsigned int numElements)
 Loads the A/D queue of a specified device. More...
 
UlError ulAInSetTrigger (DaqDeviceHandle daqDeviceHandle, TriggerType type, int trigChan, double level, double variance, unsigned int retriggerSampleCount)
 Configures the trigger parameters that will be used when ulAInScan() is called with the SO_RETRIGGER or SO_EXTTRIGGER ScanOption. More...
 
UlError ulTIn (DaqDeviceHandle daqDeviceHandle, int channel, TempScale scale, TInFlag flags, double *data)
 Returns a temperature value read from an A/D channel. More...
 
UlError ulTInArray (DaqDeviceHandle daqDeviceHandle, int lowChan, int highChan, TempScale scale, TInArrayFlag flags, double data[])
 Scans a range of A/D temperature channels, and stores the samples in an array. More...
 
UlError ulAIGetInfo (DaqDeviceHandle daqDeviceHandle, AiInfoItem infoItem, unsigned int index, long long *infoValue)
 Use with AiInfoItem to retrieve information about the AI subsystem. More...
 
UlError ulAIGetInfoDbl (DaqDeviceHandle daqDeviceHandle, AiInfoItemDbl infoItem, unsigned int index, double *infoValue)
 Use with AiInfoItemDbl to retrieve information about the AI subsystem. More...
 
UlError ulAISetConfig (DaqDeviceHandle daqDeviceHandle, AiConfigItem configItem, unsigned int index, long long configValue)
 Use with AiConfigItem to set configuration options at runtime. More...
 
UlError ulAIGetConfig (DaqDeviceHandle daqDeviceHandle, AiConfigItem configItem, unsigned int index, long long *configValue)
 Use with AiConfigItem to retrieve configuration options set for a device. More...
 
UlError ulAISetConfigDbl (DaqDeviceHandle daqDeviceHandle, AiConfigItemDbl configItem, unsigned int index, double configValue)
 Use with AiConfigItemDbl to set configuration options at runtime. More...
 
UlError ulAIGetConfigDbl (DaqDeviceHandle daqDeviceHandle, AiConfigItemDbl configItem, unsigned int index, double *configValue)
 Use with AiConfigItem to retrieve configuration options set for a device. More...
 
UlError ulAIGetConfigStr (DaqDeviceHandle daqDeviceHandle, AiConfigItemStr configItem, unsigned int index, char *configStr, unsigned int *maxConfigLen)
 Use with DevConfigItemStr to retrieve configuration information as a null-terminated string. More...
 

Detailed Description

Configure the analog input subsystem and acquire data.

Function Documentation

UlError ulAIGetConfig ( DaqDeviceHandle  daqDeviceHandle,
AiConfigItem  configItem,
unsigned int  index,
long long *  configValue 
)

Use with AiConfigItem to retrieve configuration options set for a device.

Parameters
daqDeviceHandlethe handle to the DAQ device
configItemthe configuration item to retrieve
indexeither ignored or an index into the configValue
configValuethe specified configuration value is returned to this variable
Returns
The UL error code.
UlError ulAIGetConfigDbl ( DaqDeviceHandle  daqDeviceHandle,
AiConfigItemDbl  configItem,
unsigned int  index,
double *  configValue 
)

Use with AiConfigItem to retrieve configuration options set for a device.

Parameters
daqDeviceHandlethe handle to the DAQ device
configItemthe configuration item to retrieve
indexeither ignored or an index into the configValue
configValuethe specified configuration value is returned to this variable
Returns
The UL error code.
UlError ulAIGetConfigStr ( DaqDeviceHandle  daqDeviceHandle,
AiConfigItemStr  configItem,
unsigned int  index,
char *  configStr,
unsigned int *  maxConfigLen 
)

Use with DevConfigItemStr to retrieve configuration information as a null-terminated string.

Parameters
daqDeviceHandlethe handle to the DAQ device
configItemthe configuration item to retrieve
indexeither ignored or an index into the configStr
configStrpointer to the buffer where the configuration string is copied
maxConfigLenpointer to the value holding the maximum number of bytes to be read from the device into configStr
Returns
The UL error code.
UlError ulAIGetInfo ( DaqDeviceHandle  daqDeviceHandle,
AiInfoItem  infoItem,
unsigned int  index,
long long *  infoValue 
)

Use with AiInfoItem to retrieve information about the AI subsystem.

Parameters
daqDeviceHandlethe device the handle to the DAQ device
infoItemthe analog input information to retrieve
indexeither ignored or an index into the infoValue, depending on the value of the infoItem argument. index can also the specify channel mode or channel type for some AiInfoItems (AI_INFO_NUM_CHANS_BY_MODE, AI_INFO_NUM_CHANS_BY_TYPE, and AI_INFO_MAX_QUEUE_LENGTH_BY_MODE)
infoValuethe AI information is returned to this variable
Returns
The UL error code.
UlError ulAIGetInfoDbl ( DaqDeviceHandle  daqDeviceHandle,
AiInfoItemDbl  infoItem,
unsigned int  index,
double *  infoValue 
)

Use with AiInfoItemDbl to retrieve information about the AI subsystem.

Parameters
daqDeviceHandlethe handle to the DAQ device
infoItemthe analog input information to retrieve
indexeither ignored or an index into the infoValue. This argument can also specify the channel mode or channel type for some AiInfoItem values (AI_INFO_NUM_CHANS_BY_MODE, AI_INFO_NUM_CHANS_BY_TYPE, and AI_INFO_MAX_QUEUE_LENGTH_BY_MODE).
infoValuethe AI information is returned to this variable
Returns
The UL error code.
UlError ulAIn ( DaqDeviceHandle  daqDeviceHandle,
int  channel,
AiInputMode  inputMode,
Range  range,
AInFlag  flags,
double *  data 
)

Returns the value read from an A/D channel.

Parameters
daqDeviceHandlethe handle to the DAQ device
channelA/D channel number
inputModeA/D channel mode
rangeA/D range
flagsbit mask that specifies whether to scale and/or calibrate the data
dataA/D data value
Returns
The UL error code.
UlError ulAInLoadQueue ( DaqDeviceHandle  daqDeviceHandle,
AiQueueElement  queue[],
unsigned int  numElements 
)

Loads the A/D queue of a specified device.

Parameters
daqDeviceHandlethe handle to the DAQ device
queue[]an array of AiQueueElement structs, each of which contains fields specifying channel, range, and mode
numElementsthe number of elements in the queue
Returns
The UL error code.
UlError ulAInScan ( DaqDeviceHandle  daqDeviceHandle,
int  lowChan,
int  highChan,
AiInputMode  inputMode,
Range  range,
int  samplesPerChan,
double *  rate,
ScanOption  options,
AInScanFlag  flags,
double  data[] 
)

Scans a range of A/D channels, and stores the samples in an array.

Parameters
daqDeviceHandlethe handle to the DAQ device
lowChanfirst A/D channel in the scan
highChanlast A/D channel in the scan
inputModeA/D channel mode
rangeA/D range
samplesPerChanthe number of A/D samples to collect from each channel in the scan
rateA/D sample rate in samples per channel per second. Upon return, this value is set to the actual sample rate.
optionsbit mask that specifies A/D scan options
flagsbit mask that specifies whether to scale and/or calibrate the data
data[]pointer to the buffer to receive the data array
Returns
The UL error code.
UlError ulAInScanStatus ( DaqDeviceHandle  daqDeviceHandle,
ScanStatus status,
TransferStatus xferStatus 
)

Returns the status, count, and index of an A/D scan operation.

Parameters
daqDeviceHandlethe handle to the DAQ device
statusthe status of the background operation (idle or running)
xferStatusa TransferStatus struct containing fields that return the current sample count, scan count, and buffer index for the specified input scan operation
Returns
The UL error code.
UlError ulAInScanStop ( DaqDeviceHandle  daqDeviceHandle)

Stops the analog input operation currently running.

Parameters
daqDeviceHandlethe handle to the DAQ device
Returns
The UL error code.
UlError ulAInScanWait ( DaqDeviceHandle  daqDeviceHandle,
WaitType  waitType,
long long  waitParam,
double  timeout 
)

Returns when the scan operation completes on the specified device, or the time specified by the timeout argument elapses.

Parameters
daqDeviceHandlethe handle to the DAQ device
waitTypethe wait type
waitParamReserved for future use
timeoutthe timeout value in seconds (s); set to -1 to wait indefinitely for the scan operation to end.
Returns
The UL error code.
UlError ulAInSetTrigger ( DaqDeviceHandle  daqDeviceHandle,
TriggerType  type,
int  trigChan,
double  level,
double  variance,
unsigned int  retriggerSampleCount 
)

Configures the trigger parameters that will be used when ulAInScan() is called with the SO_RETRIGGER or SO_EXTTRIGGER ScanOption.

Parameters
daqDeviceHandlethe handle to the DAQ device
typetype of trigger
trigChanthe trigger channel; ignored if type is set to TRIG_POS_EDGE, TRIG_NEG_EDGE, TRIG_HIGH, TRIG_LOW, GATE_HIGH, GATE_LOW, TRIG_RISING, or TRIG_FALLING.
levelthe level at or around which the trigger event should be detected; ignored if type is set to TRIG_POS_EDGE, TRIG_NEG_EDGE, TRIG_HIGH, TRIG_LOW, GATE_HIGH, GATE_LOW, TRIG_RISING, or TRIG_FALLING.
variancethe degree to which the input signal can vary relative to the level parameter; ignored for all types where level is ignored. For pattern triggering, this argument serves as the mask value.
retriggerSampleCountthe number of samples per trigger to acquire with each trigger event; ignored unless the SO_RETRIGGER ScanOption is set for the scan.
Returns
The UL error code.
UlError ulAISetConfig ( DaqDeviceHandle  daqDeviceHandle,
AiConfigItem  configItem,
unsigned int  index,
long long  configValue 
)

Use with AiConfigItem to set configuration options at runtime.

Parameters
daqDeviceHandlethe handle to the DAQ device
configItemthe configuration item to set
indexeither ignored or an index into the configValue
configValuethe value to set the specified configuration item to
Returns
The UL error code.
UlError ulAISetConfigDbl ( DaqDeviceHandle  daqDeviceHandle,
AiConfigItemDbl  configItem,
unsigned int  index,
double  configValue 
)

Use with AiConfigItemDbl to set configuration options at runtime.

Parameters
daqDeviceHandlethe handle to the DAQ device
configItemthe configuration item to set
indexeither ignored or an index into the configValue
configValuethe value to set the specified configuration item to
Returns
The UL error code.
UlError ulTIn ( DaqDeviceHandle  daqDeviceHandle,
int  channel,
TempScale  scale,
TInFlag  flags,
double *  data 
)

Returns a temperature value read from an A/D channel.

Parameters
daqDeviceHandlethe handle to the DAQ device
channelA/D channel number
scaletemperature unit
flagsreserved for future use
datatemperature value; if an ERR_OPEN_CONNECTION error occurs, the value returned will be -9999.
Returns
The UL error code.
UlError ulTInArray ( DaqDeviceHandle  daqDeviceHandle,
int  lowChan,
int  highChan,
TempScale  scale,
TInArrayFlag  flags,
double  data[] 
)

Scans a range of A/D temperature channels, and stores the samples in an array.

Parameters
daqDeviceHandlethe handle to the DAQ device
lowChanfirst A/D channel in the scan
highChanlast A/D channel in the scan
scaletemperature unit
flagsreserved for future use
data[]a pointer to an array that stores the data; if an ERR_OPEN_CONNECTION error occurs, the value will be -9999 in the array element associated with the channel causing the error.
Returns
The UL error code.