UL for Linux
User library to access and control supported MCC hardware over the Linux platform
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions
Counter Input

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

Functions

UlError ulCIn (DaqDeviceHandle daqDeviceHandle, int counterNum, unsigned long long *data)
 Reads the value of a count register. More...
 
UlError ulCRead (DaqDeviceHandle daqDeviceHandle, int counterNum, CounterRegisterType regType, unsigned long long *data)
 Reads the value of the specified counter register. More...
 
UlError ulCLoad (DaqDeviceHandle daqDeviceHandle, int counterNum, CounterRegisterType registerType, unsigned long long loadValue)
 Loads a value into the specified counter register. More...
 
UlError ulCClear (DaqDeviceHandle daqDeviceHandle, int counterNum)
 Sets the count of the specified counter to 0. More...
 
UlError ulCConfigScan (DaqDeviceHandle daqDeviceHandle, int counterNum, CounterMeasurementType type, CounterMeasurementMode mode, CounterEdgeDetection edgeDetection, CounterTickSize tickSize, CounterDebounceMode debounceMode, CounterDebounceTime debounceTime, CConfigScanFlag flags)
 Configures a counter channel, for counters with programmable types. More...
 
UlError ulCInScan (DaqDeviceHandle daqDeviceHandle, int lowCounterNum, int highCounterNum, int samplesPerCounter, double *rate, ScanOption options, CInScanFlag flags, unsigned long long data[])
 Reads a range of counter channels. More...
 
UlError ulCInSetTrigger (DaqDeviceHandle daqDeviceHandle, TriggerType type, int trigChan, double level, double variance, unsigned int retriggerSampleCount)
 Configures the trigger parameters that will be used when ulCInScan() is called with the SO_RETRIGGER or SO_EXTTRIGGER ScanOption. More...
 
UlError ulCInScanStatus (DaqDeviceHandle daqDeviceHandle, ScanStatus *status, TransferStatus *xferStatus)
 Returns the status of a counter input operation. More...
 
UlError ulCInScanStop (DaqDeviceHandle daqDeviceHandle)
 Stops the counter input operation currently running. More...
 
UlError ulCInScanWait (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 ulCtrGetInfo (DaqDeviceHandle daqDeviceHandle, CtrInfoItem infoItem, unsigned int index, long long *infoValue)
 Use with CtrInfoItem to retrieve information about the counter subsystem. More...
 
UlError ulCtrGetInfoDbl (DaqDeviceHandle daqDeviceHandle, CtrInfoItemDbl infoItem, unsigned int index, double *infoValue)
 Use with CtrInfoItemDbl to retrieve information about the counter subsystem. More...
 
UlError ulCtrGetConfig (DaqDeviceHandle daqDeviceHandle, CtrConfigItem configItem, unsigned int index, long long *configValue)
 Use with CtrConfigItem to retrieve configuration options set for a device. More...
 
UlError ulCtrSetConfig (DaqDeviceHandle daqDeviceHandle, CtrConfigItem configItem, unsigned int index, long long configValue)
 Use with CtrConfigItem to set configuration options at runtime. More...
 

Detailed Description

Configure the counter input subsystem and acquire data.

Function Documentation

UlError ulCClear ( DaqDeviceHandle  daqDeviceHandle,
int  counterNum 
)

Sets the count of the specified counter to 0.

Parameters
daqDeviceHandlethe handle to the DAQ device
counterNumthe counter number
Returns
The UL error code.
UlError ulCConfigScan ( DaqDeviceHandle  daqDeviceHandle,
int  counterNum,
CounterMeasurementType  type,
CounterMeasurementMode  mode,
CounterEdgeDetection  edgeDetection,
CounterTickSize  tickSize,
CounterDebounceMode  debounceMode,
CounterDebounceTime  debounceTime,
CConfigScanFlag  flags 
)

Configures a counter channel, for counters with programmable types.

Parameters
daqDeviceHandlethe handle to the DAQ device
counterNumthe counter number
typethe type of counter measurement
modethe counter mode
edgeDetectionsets the active edge of the counter input signal to positive or negative
tickSizebit mask that specifies the counter resolution for measurement modes such as period, pulse width, and timing
debounceModebit mask that specifies the counter debounce mode
debounceTimebit mask that specifies the counter debounce time
flagsbit mask that specifies counting properties such as resolution and clear on scan start
Returns
The UL error code.
UlError ulCIn ( DaqDeviceHandle  daqDeviceHandle,
int  counterNum,
unsigned long long *  data 
)

Reads the value of a count register.

Use ulCRead() to read any available register type (count, load, max limit, or min limit).

Parameters
daqDeviceHandlethe handle to the DAQ device
counterNumthe counter number
datathe data value
Returns
The UL error code.
UlError ulCInScan ( DaqDeviceHandle  daqDeviceHandle,
int  lowCounterNum,
int  highCounterNum,
int  samplesPerCounter,
double *  rate,
ScanOption  options,
CInScanFlag  flags,
unsigned long long  data[] 
)

Reads a range of counter channels.

Parameters
daqDeviceHandlethe handle to the DAQ device
lowCounterNumthe first channel of the scan
highCounterNumthe last channel of the scan
samplesPerCounterthe number of samples per counter to read
ratethe rate in samples per second per counter. Upon return, this value is set to the actual sample rate.
optionsscan options
flagsbit mask that specifies the counter scan option
data[]pointer to the buffer to receive the data
Returns
The UL error code.
UlError ulCInScanStatus ( DaqDeviceHandle  daqDeviceHandle,
ScanStatus status,
TransferStatus xferStatus 
)

Returns the status of a counter input 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 ulCInScanStop ( DaqDeviceHandle  daqDeviceHandle)

Stops the counter input operation currently running.

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

Configures the trigger parameters that will be used when ulCInScan() 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 ulCLoad ( DaqDeviceHandle  daqDeviceHandle,
int  counterNum,
CounterRegisterType  registerType,
unsigned long long  loadValue 
)

Loads a value into the specified counter register.

Parameters
daqDeviceHandlethe handle to the DAQ device
counterNumthe counter number
registerTypethe register type
loadValuethe load value
Returns
The UL error code.
UlError ulCRead ( DaqDeviceHandle  daqDeviceHandle,
int  counterNum,
CounterRegisterType  regType,
unsigned long long *  data 
)

Reads the value of the specified counter register.

Parameters
daqDeviceHandlethe handle to the DAQ device
counterNumthe counter number
regTypethe register type
datathe data value
Returns
The UL error code.
UlError ulCtrGetConfig ( DaqDeviceHandle  daqDeviceHandle,
CtrConfigItem  configItem,
unsigned int  index,
long long *  configValue 
)

Use with CtrConfigItem 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 ulCtrGetInfo ( DaqDeviceHandle  daqDeviceHandle,
CtrInfoItem  infoItem,
unsigned int  index,
long long *  infoValue 
)

Use with CtrInfoItem to retrieve information about the counter subsystem.

Parameters
daqDeviceHandlethe handle to the DAQ device
infoItemthe counter information to retrieve
indexeither ignored or an index into the infoValue, depending on the value of the infoItem argument
infoValuethe counter information is returned to this variable
Returns
The UL error code.
UlError ulCtrGetInfoDbl ( DaqDeviceHandle  daqDeviceHandle,
CtrInfoItemDbl  infoItem,
unsigned int  index,
double *  infoValue 
)

Use with CtrInfoItemDbl to retrieve information about the counter subsystem.

Parameters
daqDeviceHandlethe handle to the DAQ device
infoItemthe counter information to retrieve
indexeither ignored or an index into the infoValue, depending on the value of the infoItem argument
infoValuethe counter information is returned to this variable
Returns
The UL error code.
UlError ulCtrSetConfig ( DaqDeviceHandle  daqDeviceHandle,
CtrConfigItem  configItem,
unsigned int  index,
long long  configValue 
)

Use with CtrConfigItem 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.