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
Digital I/O

Configure the digital I/O subsystem and acquire data. More...

Functions

UlError ulDConfigPort (DaqDeviceHandle daqDeviceHandle, DigitalPortType portType, DigitalDirection direction)
 Configures a digital port as input or output. More...
 
UlError ulDConfigBit (DaqDeviceHandle daqDeviceHandle, DigitalPortType portType, int bitNum, DigitalDirection direction)
 Configures a digital bit as input or output. More...
 
UlError ulDIn (DaqDeviceHandle daqDeviceHandle, DigitalPortType portType, unsigned long long *data)
 Returns the value read from a digital port. More...
 
UlError ulDOut (DaqDeviceHandle daqDeviceHandle, DigitalPortType portType, unsigned long long data)
 Writes the specified value to a digital output port. More...
 
UlError ulDInArray (DaqDeviceHandle daqDeviceHandle, DigitalPortType lowPort, DigitalPortType highPort, unsigned long long data[])
 Reads the specified digital ports, and Returns the data in an array. More...
 
UlError ulDOutArray (DaqDeviceHandle daqDeviceHandle, DigitalPortType lowPort, DigitalPortType highPort, unsigned long long data[])
 Sets the values of the specified digital ports. More...
 
UlError ulDBitIn (DaqDeviceHandle daqDeviceHandle, DigitalPortType portType, int bitNum, unsigned int *bitValue)
 Returns the value of a digital bit. More...
 
UlError ulDBitOut (DaqDeviceHandle daqDeviceHandle, DigitalPortType portType, int bitNum, unsigned int bitValue)
 Writes a value to a digital bit. More...
 
UlError ulDInScan (DaqDeviceHandle daqDeviceHandle, DigitalPortType lowPort, DigitalPortType highPort, int samplesPerPort, double *rate, ScanOption options, DInScanFlag flags, unsigned long long data[])
 Reads a range of digital ports. More...
 
UlError ulDInScanStatus (DaqDeviceHandle daqDeviceHandle, ScanStatus *status, TransferStatus *xferStatus)
 The status of a digital scan operation. More...
 
UlError ulDInScanStop (DaqDeviceHandle daqDeviceHandle)
 Stops the digital input operation currently running. More...
 
UlError ulDInScanWait (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 ulDInSetTrigger (DaqDeviceHandle daqDeviceHandle, TriggerType type, int trigChan, double level, double variance, unsigned int retriggerSampleCount)
 Configures the trigger parameters that will be used when ulDInScan() is called with the SO_RETRIGGER or SO_EXTTRIGGER ScanOption. More...
 
UlError ulDOutScan (DaqDeviceHandle daqDeviceHandle, DigitalPortType lowPort, DigitalPortType highPort, int samplesPerPort, double *rate, ScanOption options, DOutScanFlag flags, unsigned long long data[])
 Writes data to a range of digital ports. More...
 
UlError ulDOutScanStatus (DaqDeviceHandle daqDeviceHandle, ScanStatus *status, TransferStatus *xferStatus)
 Returns the status of the digital output operation. More...
 
UlError ulDOutScanStop (DaqDeviceHandle daqDeviceHandle)
 Stops the digital output operation currently running. More...
 
UlError ulDOutScanWait (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 ulDOutSetTrigger (DaqDeviceHandle daqDeviceHandle, TriggerType type, int trigChan, double level, double variance, unsigned int retriggerSampleCount)
 Configures the trigger parameters that will be used when ulDOutScan() is called with the SO_RETRIGGER or SO_EXTTRIGGER ScanOption. More...
 
UlError ulDIOGetInfo (DaqDeviceHandle daqDeviceHandle, DioInfoItem infoItem, unsigned int index, long long *infoValue)
 Use with DioInfoItem to retrieve information about the DIO subsystem. More...
 
UlError ulDIOGetInfoDbl (DaqDeviceHandle daqDeviceHandle, DioInfoItemDbl infoItem, unsigned int index, double *infoValue)
 Use with DioInfoItemDbl to retrieve information about the DIO subsystem. More...
 
UlError ulDIOSetConfig (DaqDeviceHandle daqDeviceHandle, DioConfigItem configItem, unsigned int index, long long configValue)
 Use with DioConfigItem to retrieve information about the DIO subsystem. More...
 
UlError ulDIOGetConfig (DaqDeviceHandle daqDeviceHandle, DioConfigItem configItem, unsigned int index, long long *configValue)
 Use with DioConfigItem to retrieve the current configuration about the DIO subsystem. More...
 

Detailed Description

Configure the digital I/O subsystem and acquire data.

Function Documentation

UlError ulDBitIn ( DaqDeviceHandle  daqDeviceHandle,
DigitalPortType  portType,
int  bitNum,
unsigned int *  bitValue 
)

Returns the value of a digital bit.

Parameters
daqDeviceHandlethe handle to the DAQ device
portTypethe digital port containing the bit to be read
bitNumthe bit number
bitValuethe number of the bit within the port specified by portType
Returns
The UL error code.
UlError ulDBitOut ( DaqDeviceHandle  daqDeviceHandle,
DigitalPortType  portType,
int  bitNum,
unsigned int  bitValue 
)

Writes a value to a digital bit.

Parameters
daqDeviceHandlethe handle to the DAQ device
portTypethe digital port containing the bit to be written
bitNumthe number of the bit within the port specified by portType to be written
bitValuethe bit value to write
Returns
The UL error code.
UlError ulDConfigBit ( DaqDeviceHandle  daqDeviceHandle,
DigitalPortType  portType,
int  bitNum,
DigitalDirection  direction 
)

Configures a digital bit as input or output.

Parameters
daqDeviceHandlethe handle to the DAQ device
portTypethe digital port containing the bit to configure; the port must be configurable.
bitNumthe bit number within the specified port
directionthe bit direction (input or output)
Returns
The UL error code.
UlError ulDConfigPort ( DaqDeviceHandle  daqDeviceHandle,
DigitalPortType  portType,
DigitalDirection  direction 
)

Configures a digital port as input or output.

Parameters
daqDeviceHandlethe handle to the DAQ device
portTypethe digital port; the port must be configurable
directionthe port direction (input or output)
Returns
The UL error code.
UlError ulDIn ( DaqDeviceHandle  daqDeviceHandle,
DigitalPortType  portType,
unsigned long long *  data 
)

Returns the value read from a digital port.

Parameters
daqDeviceHandlethe handle to the DAQ device
portTypethe port type
datathe port value
Returns
The UL error code.
UlError ulDInArray ( DaqDeviceHandle  daqDeviceHandle,
DigitalPortType  lowPort,
DigitalPortType  highPort,
unsigned long long  data[] 
)

Reads the specified digital ports, and Returns the data in an array.

Parameters
daqDeviceHandlethe handle to the DAQ device
lowPortthe first port in the scan
highPortthe last port in the scan
datainput data array
Returns
The UL error code.
UlError ulDInScan ( DaqDeviceHandle  daqDeviceHandle,
DigitalPortType  lowPort,
DigitalPortType  highPort,
int  samplesPerPort,
double *  rate,
ScanOption  options,
DInScanFlag  flags,
unsigned long long  data[] 
)

Reads a range of digital ports.

Parameters
daqDeviceHandlethe handle to the DAQ device
lowPortthe number of the first port in the scan
highPortthe number of the last port in the scan
samplesPerPortthe number of samples to read from each port
ratethe number of times per second (Hz) to read the port. Upon return, this value is set to the actual scan rate.
optionsscan options
flagsreserved for future use
data[]pointer to an array to receive the digital data
Returns
The UL error code.
UlError ulDInScanStatus ( DaqDeviceHandle  daqDeviceHandle,
ScanStatus status,
TransferStatus xferStatus 
)

The status of a digital scan operation.

Parameters
daqDeviceHandlethe handle to the DAQ device
statusthe status of the background operation
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 ulDInScanStop ( DaqDeviceHandle  daqDeviceHandle)

Stops the digital input operation currently running.

Parameters
daqDeviceHandlethe handle to the DAQ device
Returns
The UL error code.
UlError ulDInScanWait ( 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 ulDInSetTrigger ( DaqDeviceHandle  daqDeviceHandle,
TriggerType  type,
int  trigChan,
double  level,
double  variance,
unsigned int  retriggerSampleCount 
)

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

Parameters
daqDeviceHandlethe handle to the DAQ device
typethe trigger type
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 to acquire with each trigger event; ignored unless the SO_RETRIGGER ScanOption is set for the scan.
Returns
The UL error code.
UlError ulDIOGetConfig ( DaqDeviceHandle  daqDeviceHandle,
DioConfigItem  configItem,
unsigned int  index,
long long *  configValue 
)

Use with DioConfigItem to retrieve the current configuration about the DIO subsystem.

Parameters
daqDeviceHandlethe handle to the DAQ device
configItemthe configuration item to retrieve
indexthe port index
configValuethe specified configuration value is returned to this variable
Returns
The UL error code.
UlError ulDIOGetInfo ( DaqDeviceHandle  daqDeviceHandle,
DioInfoItem  infoItem,
unsigned int  index,
long long *  infoValue 
)

Use with DioInfoItem to retrieve information about the DIO subsystem.

Parameters
daqDeviceHandlethe handle to the DAQ device
infoItemthe digital I/O information to retrieve
indexan index into the infoValue, depending on the value of the infoItem argument; usually specifies port direction (DD_INPUT or DD_OUTPUT); ignored when infoItem is set to DIO_INFO_NUM_PORTS and DIO_INFO_HAS_PACER
infoValuethe DIO information is returned to this variable
Returns
The UL error code.
UlError ulDIOGetInfoDbl ( DaqDeviceHandle  daqDeviceHandle,
DioInfoItemDbl  infoItem,
unsigned int  index,
double *  infoValue 
)

Use with DioInfoItemDbl to retrieve information about the DIO subsystem.

Parameters
daqDeviceHandlethe handle to the DAQ device
infoItemthe digital I/O information to retrieve
indexthe port direction (DD_INPUT or DD_OUTPUT)
infoValuethe DIO information is returned to this variable
Returns
The UL error code.
UlError ulDIOSetConfig ( DaqDeviceHandle  daqDeviceHandle,
DioConfigItem  configItem,
unsigned int  index,
long long  configValue 
)

Use with DioConfigItem to retrieve information about the DIO subsystem.

Parameters
daqDeviceHandlethe handle to the DAQ device
configItemthe configuration item to retrieve
indexthe port index
configValuethe value to set the specified configuration item to
Returns
The UL error code.
UlError ulDOut ( DaqDeviceHandle  daqDeviceHandle,
DigitalPortType  portType,
unsigned long long  data 
)

Writes the specified value to a digital output port.

Parameters
daqDeviceHandlethe handle to the DAQ device
portTypethe digital port type
datathe port value
Returns
The UL error code.
UlError ulDOutArray ( DaqDeviceHandle  daqDeviceHandle,
DigitalPortType  lowPort,
DigitalPortType  highPort,
unsigned long long  data[] 
)

Sets the values of the specified digital ports.

Parameters
daqDeviceHandlethe handle to the DAQ device
lowPortthe first port in the scan
highPortthe last port in the scan
dataoutput data array
Returns
The UL error code.
UlError ulDOutScan ( DaqDeviceHandle  daqDeviceHandle,
DigitalPortType  lowPort,
DigitalPortType  highPort,
int  samplesPerPort,
double *  rate,
ScanOption  options,
DOutScanFlag  flags,
unsigned long long  data[] 
)

Writes data to a range of digital ports.

Parameters
daqDeviceHandlethe handle to the DAQ device
lowPortnumber of the first port in the scan
highPortnumber of the last port in the scan
samplesPerPortthe number of samples per port to write
ratethe number of times per second to write to each port (scan rate). Upon return, this value is set to the actual scan rate.
optionsscan options
flagsreserved for future use
data[]a pointer to an array to receive the digital data
Returns
The UL error code.
UlError ulDOutScanStatus ( DaqDeviceHandle  daqDeviceHandle,
ScanStatus status,
TransferStatus xferStatus 
)

Returns the status of the digital output operation.

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

Stops the digital output operation currently running.

Parameters
daqDeviceHandlethe handle to the DAQ device
Returns
The UL error code.
UlError ulDOutScanWait ( 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 ulDOutSetTrigger ( DaqDeviceHandle  daqDeviceHandle,
TriggerType  type,
int  trigChan,
double  level,
double  variance,
unsigned int  retriggerSampleCount 
)

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

Parameters
daqDeviceHandlethe handle to the DAQ device
typethe trigger type
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.