Python Library Reference

The UL for Linux Python library allow users to communicate and control Measurement Computing hardware using the Python language.

The library provides structures and enumerations to manage connected devices, obtain information about device capabilities, and configure hardware settings. Subsystem methods provide full-functionality for each device type.

Global Methods and Data Constants

Data Structures

Structure Description
DaqDeviceDescriptor A structure that defines a particular DAQ device.
MemDescriptor A structure that defines the location and access properties of the physical memory of a device.
AiQueueElement A structure that defines an analog input queue element.
DaqInChanDescriptor A structure that defines an input channel and its properties.
DaqOutChanDescriptor A structure that defines an output channel and its properties.
TransferStatus A structure containing information about the progress of the specified scan operation.
class uldaq.DaqDeviceDescriptor

A structure that defines a particular DAQ device.

product_name

The generic (unqualified) product name of the device referenced by the DaqDeviceDescriptor.

product_id

The numeric string indicating the product type referenced by the DaqDeviceDescriptor.

dev_interface

The DaqDeviceInterface enumeration indicating the type of interface in use by the device referenced by the DaqDeviceDescriptor.

dev_string

Similar to product_name, but may contain additional information.

unique_id

A string that uniquely identifies a specific device, usually with a serial number or MAC address.

class uldaq.MemDescriptor

A structure that defines the location and access properties of the physical memory of a device.

address

A bitmask of MemAccessType values.

size

A numeric value that specifies the size of the memory area at the specified address.

access_types

Returns a bitmask indicating the access rights to the memory at the specified address (read, write, or both).

class uldaq.AiQueueElement

A structure that defines an analog input queue element.

channel

The analog input channel number for the queue element.

input_mode

The input mode to use for the specified channel for the queue element.

range

The range to use for the specified channel for the queue element.

class uldaq.DaqInChanDescriptor

A structure that defines an input channel and its properties.

channel

The channel number.

type

The type of input for the specified channel, such as analog, digital, or counter.

range

The range to be used for the specified channel; ignored if not analog.

class uldaq.DaqOutChanDescriptor

A structure that defines an output channel and its properties.

channel

The channel number.

type

The type of input for the specified channel, such as analog or digital.

range

The range to be used for the specified channel; ignored if not analog.

class uldaq.DioPortInfo

Digital input/output port information.

port_type

The ul_daq.DigitalPortType value.

port_io_type

The ul_daq.DigitalPortIoType value.

number_of_bits

The number of bits in the port.

class uldaq.TransferStatus

A structure containing information about the progress of the specified scan operation.

current_scan_count

The number of samples per channel transferred since the scan started.

current_total_count

The total number of samples transferred since the scan started.

current_index

The index into the data buffer immediately following the last sample transferred.

Enumerated Constants

Enumeration Description
AiChanQueueLimitation Bitmask indicating device queue limitations.
AiChanType Bitmask indicating all supported channel types.
AInFlag Use as the flags argument value for a_in() to set properties of data returned.
AiInputMode A/D channel input modes.
AInScanFlag Use as the flags argument value for a_in_scan() to set properties of data returned.
AiQueueType Bitmask indicating supported queue types.
AOutFlag Use as the flags argument value for a_out() to set properties of data returned.
AOutScanFlag Use as the flags argument value for a_out_scan() to set properties of data returned.
CConfigScanFlag Use as the flags argument value for c_config_scan().
CInScanFlag Use as the flags argument value for c_in() to set properties of data returned.
CounterDebounceMode Use as the debounce_mode argument for c_config_scan() to set the glitch rejection properties of a counter.
CounterDebounceTime Use as the debounce_time argument for c_config_scan() to set the glitch rejection properties of a counter.
CounterEdgeDetection Use as the value for the edge_detection argument for c_config_scan().
CounterMeasurementMode Use as the value for the measurement_mode argument for c_config_scan().
CounterMeasurementType Use as the value for the measurement_type argument for c_config_scan(). Use get_info() with get_measurement_types() to check compatibility.
CounterRegisterType Use for the c_load() register_type argument, and as the value returned by get_register_types().
CounterTickSize Use as the value for the tick_size argument for c_config_scan() when CounterDebounceMode is PERIOD, PULSE_WIDTH, or TIMING.
DaqEventType A bitmask indicating the types of conditions that trigger an event. Used as the event_type argument value for enable_event() and disable_event().
DaqInChanType A bitmask used with synchronous input scanning operations as a field in the DaqInChanDescriptor struct, and as the DaqiInfo() object returned by get_info().
DaqInScanFlag Use as the flags argument value for daq_in_scan() to set the properties of data returned.
DaqOutChanType A bitmask used with synchronous output scanning operations as a field in the DaqOutChanDescriptor struct, and as the DaqoInfo() object returned by get_info().
DaqOutScanFlag Use as the flags argument value for daq_out_scan() to set the properties of data returned.
DevVersionType Use as the version_type argument for get_version() for the specified device.
DigitalDirection Used with get_port_direction() as the current direction that each bit in the specified port type is configured for.
DigitalPortIoType Used with DioPortInfo() as the port_io_type argument value to get the port I/O type.
DigitalPortType Used with get_port_direction() as the port_type argument.
DInScanFlag Use as the flags argument value for d_in_scan() to set the properties of data returned.
DOutScanFlag Use as the flags argument value for d_out_scan() to set the properties of data returned.
InterfaceType A bitmask indicating the physical connection interface used to communicate with a DAQ device.
MemAccessType A bitmask used with get_info() as one of the field types returned in the MemDescriptor struct.
MemRegion Specifies the memory location on the specified device.
PulseOutOption Used with pulse_out_start() as the options argument value to set advanced options for the specified device
Range Used with many analog input and output functions, as well as a return value for get_ranges().
ScanOption Used with many analog input and output functions, as well as a return value for get_scan_options().
ScanStatus Scan status.
TempUnit Temperature units.
TcType Thermocouple types.
TimerType Types of timer channels.
TmrIdleState Timer idle state.
TmrStatus Used with get_pulse_out_status() as the timer status returned for the specified device.
TriggerType Used as an individual value with the set_trigger() functions as the trig_type argument, or as a bitmask value with the get_info() functions.
ULError Error codes for Universal Library.
WaitType Used with the subsystem scan_wait functions as the wait_type argument value for the specified device.
class uldaq.AiChanQueueLimitation

Bitmask indicating device queue limitations. See also get_queue_types() and get_max_queue_length() to determine queue capabilities

UNIQUE_CHAN = 1

A particular channel number cannot appear more than once in the queue.

ASCENDING_CHAN = 2

Channel numbers must be listed in ascending order within the queue.

CONSECUTIVE_CHAN = 4

Channel numbers must be listed in consecutive order within the queue.

class uldaq.AiInputMode

A/D channel input modes.

DIFFERENTIAL = 1

Differential

SINGLE_ENDED = 2

Single-ended

PSEUDO_DIFFERENTIAL = 3

Pseudo-differential

class uldaq.AInFlag

Use as the flags argument value for a_in() to set properties of data returned.

DEFAULT = 0

Data is returned with scaling and calibration factors applied.

NOSCALEDATA = 1

Data is returned in native format, without scaling applied.

NOCALIBRATEDATA = 2

Data is returned without calibration factors applied.

class uldaq.AiQueueType

Queue types supported by the AI subsystem.

CHAN = 1

The AI subsystem supports a channel queue.

GAIN = 2

The AI subsystem supports a gain queue.

MODE = 4

The AI subsystem supports a mode queue.

class uldaq.AiChanType

Bitmask indicating all supported channel types. Returned by get_chan_types().

VOLTAGE = 1

Voltage

TC = 2

Thermocouple

RTD = 4

Resistance Temperature Detector (RTD)

THERMISTOR = 8

Thermistor

SEMICONDUCTOR = 16

Semiconductor

DISABLED = 1073741824

Disabled

class uldaq.AInFlag

Use as the flags argument value for a_in() to set properties of data returned.

DEFAULT = 0

Data is returned with scaling and calibration factors applied.

NOSCALEDATA = 1

Data is returned in native format, without scaling applied.

NOCALIBRATEDATA = 2

Data is returned without calibration factors applied.

class uldaq.AInScanFlag

Use as the flags argument value for a_in_scan() to set properties of data returned.

DEFAULT = 0

Data is returned with scaling and calibration factors applied.

NOSCALEDATA = 1

Data is returned in native format, without scaling applied.

NOCALIBRATEDATA = 2

Data is returned without calibration factors applied.

class uldaq.AiQueueType

Queue types supported by the AI subsystem.

CHAN = 1

The AI subsystem supports a channel queue.

GAIN = 2

The AI subsystem supports a gain queue.

MODE = 4

The AI subsystem supports a mode queue.

class uldaq.AiChanQueueLimitation

Bitmask indicating device queue limitations. See also get_queue_types() and get_max_queue_length() to determine queue capabilities

UNIQUE_CHAN = 1

A particular channel number cannot appear more than once in the queue.

ASCENDING_CHAN = 2

Channel numbers must be listed in ascending order within the queue.

CONSECUTIVE_CHAN = 4

Channel numbers must be listed in consecutive order within the queue.

class uldaq.AOutFlag

Options for scaling and calibrating D/A data.

DEFAULT = 0

Transfers D/A data based on the board type and sampling speed.

NOSCALEDATA = 1

No scaling is applied to raw data.

NOCALIBRATEDATA = 2

Turns off real-time software calibration for devices that are software calibrated.

class uldaq.AOutScanFlag

Use as the flags argument value for a_out_scan() to set the properties of data returned.

DEFAULT = 0

Scaled data is supplied and calibration factors are applied to output.

NOSCALEDATA = 1

Data is supplied in native format (usually, values ranging from 0 to 2resolution- 1.

NOCALIBRATEDATA = 2

Data is output without calibration factors applied..

class uldaq.CConfigScanFlag

Use as the flags argument value for c_config_scan.

DEFAULT = 0

Placeholder value; standard functionality.

class uldaq.CInScanFlag

Use as the flags argument value for c_in_scan() to set the properties of data returned.

DEFAULT = 0

Default counter behavior.

CTR16_BIT = 1

Sets up the counter as a 16-bit counter channel.

CTR32_BIT = 2

Sets up the counter as a 32-bit counter channel.

CTR64_BIT = 4

Sets up the counter as a 64-bit counter channel.

NOCLEAR = 8

Does not clear the counter to 0 at the start of each scan.

class uldaq.CounterDebounceMode

Use as the debounce_mode argument for c_config_scan() to set the glitch rejection properties of a counter.

NONE = 0

Disables the debounce feature.

TRIGGER_AFTER_STABLE = 1

The counter is incremented only after the counter input is stable for a period of a length defined by CounterDebounceTime.

TRIGGER_BEFORE_STABLE = 2

The counter is incremented on the first edge at the counter input, then waits for a stable period of a length defined by CounterDebounceTime before counting the next edge.

class uldaq.CounterDebounceTime

Use as the value for the debounce_time argument for c_config_scan() when CounterDebounceMode is not NONE.

DEBOUNCE_0ns = 0

Disables the debounce feature. Valid only when CounterDebounceMode is set to None.

DEBOUNCE_500ns = 1

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 500 ns.

DEBOUNCE_1500ns = 2

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 1500 ns.

DEBOUNCE_3500ns = 3

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 3500 ns.

DEBOUNCE_7500ns = 4

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 7500 ns.

DEBOUNCE_15500ns = 5

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 15500 ns.

DEBOUNCE_63500ns = 7

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 63500 ns.

DEBOUNCE_127500ns = 8

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 127500 ns.

DEBOUNCE_100us = 9

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 100 us.

DEBOUNCE_300us = 10

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 300 us.

DEBOUNCE_700us = 11

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 700 us.

DEBOUNCE_1500us = 12

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 1500 us.

DEBOUNCE_3100us = 13

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 3100 us.

DEBOUNCE_6300us = 14

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 6300 us.

DEBOUNCE_12700us = 15

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 12700 us.

DEBOUNCE_25500us = 16

Sets the time period that the counter input must be stable when using TRIGGER_AFTER_STABLE or TRIGGER_BEFORE_STABLE CounterDebounceModes to 25500 us.

class uldaq.CounterEdgeDetection

Use as the value for the edge_detection argument for c_config_scan().

RISING_EDGE = 1

Rising edge

FALLING_EDGE = 2

Falling edge

class uldaq.CounterMeasurementMode

Use as the value for the measurement_mode argument for c_config_scan(). This value should be set consistent with the measurement_type argument value.

DEFAULT = 0

Configures the counter for default counting modes for the COUNT measurement type.

CLEAR_ON_READ = 1

Configures the counter to clear after every read for the COUNT measurement type.

COUNT_DOWN = 2

Configures the counter to count down for the COUNT measurement type.

GATE_CONTROLS_DIR = 4

Configures the counter to increment when the gate pin is high, and decrement when the gate pin is low for the COUNT measurement type.

GATE_CLEARS_CTR = 8

Configures the counter to clear when the gate input is high for the COUNT measurement type.

GATE_TRIG_SRC = 16

Configures the counter to start counting when the gate input goes active for the COUNT measurement type. By default, active is on the rising edge. The gate is re-armed when the counter is loaded and when c_config_scan() is called.

OUTPUT_ON = 32

Configures the counter output to go high when the counter reaches the value of output register 0 for the COUNT measurement type, and go low when the counter reaches the value of output register 1. Use c_load() to set or read the value of the output registers.

OUTPUT_INITIAL_STATE_HIGH = 64

Configures the initial state of the counter output pin high for the COUNT measurement type.

NO_RECYCLE = 128

Configures the counter to restart when a clear or load operation is performed, or the count direction changes for the COUNT measurement type.

RANGE_LIMIT_ON = 256

When counting up, configures the counter to roll over to the min limit when the max limit is reached for the COUNT measurement type. When counting down, configures the counter to roll over to max limit when the min limit is reached. When counting up with NO_RECYCLE enabled, the counter freezes whenever the count reaches the value that was loaded into the max limit register. When counting down with NO_RECYCLE enabled, the counter freezes whenever the count reaches the value that was loaded into the min limit register. Counting resumes if the counter is reset or the direction changes.

GATING_ON = 512

Enables the counter when the mapped channel or gate pin is high for the COUNT measurement type.

INVERT_GATE = 1024

Inverts the polarity of the gate input for the COUNT measurement type.

PERIOD_X1 = None

Latches the counter measurement each time 1 complete period is observed for the PERIOD measurement type.

PERIOD_X10 = 2048

Latches the counter measurement each time 10 complete periods are observed for the PERIOD measurement type.

PERIOD_X100 = 4096

Latches the counter measurement each time 100 complete periods are observed for the PERIOD measurement type.

PERIOD_X1000 = 8192

Latches the counter measurement each time 1000 complete periods are observed for the PERIOD measurement type.

PERIOD_GATING_ON = 16384

Inverts the polarity of the gate input for the PERIOD measurement type.

PERIOD_INVERT_GATE = 32768

Inverts the polarity of the gate input for the PERIOD measurement type.

PULSE_WIDTH_INVERT_GATE = 131072

Inverts the polarity of the gate input for the PULSE_WIDTH measurement type.

TIMING_DEFAULT = None

Configures the counter for default timing modes for the TIMING measurement type.

TIMING_MODE_INVERT_GATE = 262144

Inverts the polarity of the gate input for the TIMING measurement type.

ENCODER_X1 = None

Sets the encoder measurement mode to X1 for the ENCODER measurement type.

ENCODER_X2 = 524288

Sets the encoder measurement mode to X2 for the ENCODER measurement type.

ENCODER_X4 = 1048576

Sets the encoder measurement mode to X4 for the ENCODER measurement type.

ENCODER_LATCH_ON_Z = 2097152

Configures the encoder Z mapped signal to latch the counter outputs for the ENCODER measurement type.

ENCODER_CLEAR_ON_Z = 4194304

Clears the counter when the index (Z input) goes active for the ENCODER measurement type.

ENCODER_NO_RECYCLE = 8388608

Disables the counter when a count overflow or underflow occurs for the ENCODER measurement type; re-enables when a clear or load operation is performed on the counter.

ENCODER_RANGE_LIMIT_ON = 16777216

Enables upper and lower limits for the ENCODER measurement type.

ENCODER_Z_ACTIVE_EDGE = 33554432

Sets the encoder Z signal as the active edge for the ENCODER measurement type.

class uldaq.CounterMeasurementType

Use as the value for the measurement_type argument for c_config_scan(). Use get_info() with get_measurement_types() to check compatibility.

COUNT = 1

Counter measurement. The counter increments on the active edge of the input.

PERIOD = 2

Period measurement. Measures the number of ticks between active edges of the input, with the granularity of measurement set by the tick_size argument of c_config_scan().

PULSE_WIDTH = 4

Pulse width measurement. Measures the number of ticks between the active edge of the counter input and the following edge of the counter input, with the granularity of measurement set by the tick_size argument of c_config_scan().

TIMING = 8

Timing measurement. Measures the number of ticks between the between the active edge of the counter input and the active edge of the gate input, with the granularity of measurement set by the tick_size argument of c_config_scan().

ENCODER = 16

Encoder measurement. Configures the counter as an encoder, if supported.

class uldaq.CounterRegisterType

Used for the c_load() register_type argument, and as the value returned by get_register_types().

COUNT = 1

Counter register

LOAD = 2

Load register

MIN_LIMIT = 4

Max Limit register

MAX_LIMIT = 8

Min Limit register

OUTPUT_VAL0 = 16

The register that sets the count value at which the counter output will change state from its original state.

OUTPUT_VAL1 = 32

The register that sets the count value at which the counter output will reset to its original state.

class uldaq.CounterTickSize

Use as the value for the tick_size argument for c_config_scan() when CounterDebounceMode is PERIOD, PULSE_WIDTH, or TIMING. Refer to the device hardware manual to determine which sizes are compatible with your device.

TICK_20PT83ns = 1

Sets the tick size to 20.83 ns

TICK_208PT3ns = 2

Sets the tick size to 208.3 ns

TICK_2083PT3ns = 3

Sets the tick size to 2083.3 ns

TICK_20833PT3ns = 4

Sets the tick size to 20833.3 ns

TICK_20ns = 11

Sets the tick size to 20 ns

TICK_200ns = 12

Sets the tick size to 200 ns

TICK_2000ns = 13

Sets the tick size to 2000 ns

TICK_20000ns = 14

Sets the tick size to 20000 ns

class uldaq.DaqInChanType

A bitmask used with synchronous input scanning operations as a field in the DaqInChanDescriptor struct, and as the DaqiInfo() object returned by get_info().

ANALOG_DIFF = 1

Analog input channel, differential mode

ANALOG_SE = 2

Analog input channel, single-ended mode

DIGITAL = 4

Digital channel

CTR16 = 8

16-bit counter channel

CTR32 = 16

32-bit counter channel

CTR48 = 32

48-bit counter channel

class uldaq.DaqInScanFlag

Use as the flags argument value for daq_in_scan() to set the properties of data returned.

DEFAULT = 0

Data is returned with scaling and calibration factors applied to analog channel data.

NOSCALEDATA = 1

Data for analog channels is returned in native format, without scaling applied.

NOCALIBRATEDATA = 2

Data for analog channels is returned without calibration factors applied.

NOCLEAR = 8

Counters are not cleared (set to 0) when a scan starts

class uldaq.DaqEventType

A bitmask indicating the types of conditions that trigger an event. Used as the event_type argument value for enable_event() and disable_event().

NONE = 0

No event type. Possible return value for get_info()(). Not a valid value for enable_event() and disable_event().

ON_DATA_AVAILABLE = 1

Defines an event trigger condition that occurs when a specified number of samples are available.

ON_INPUT_SCAN_ERROR = 2

Defines an event trigger condition that occurs when an input scan error occurs.

ON_END_OF_INPUT_SCAN = 4

Defines an event trigger condition that occurs upon completion of an input scan operation such as a_in_scan().

ON_OUTPUT_SCAN_ERROR = 8

Defines an event trigger condition that occurs when an output scan error occurs.

ON_END_OF_OUTPUT_SCAN = 16

Defines an event trigger condition that occurs upon completion of an input scan operation such as a_out_scan().

class uldaq.DaqOutChanType

Channel types for synchronous output operations.

ANALOG = 1

Analog output channel.

DIGITAL = 2

Digital output channl.

class uldaq.DaqOutScanFlag

Use as the flags argument value for daq_out_scan() to set the properties of data returned.

DEFAULT = 0

The data buffer contains scaled data for analog channels, and calibration factors are applied to analog outputs.

NOSCALEDATA = 1

Data for analog channels is in native format, without scaling applied.

NOCALIBRATEDATA = 2

Data for analog channels is output without calibration factors applied.

class uldaq.DigitalDirection

Used with get_port_direction() as the current direction that each bit in the specified port type is configured for.

INPUT = 1

Input

OUTPUT = 2

Output

class uldaq.DigitalPortIoType

Used with get_port_info() as the current direction that each bit in the specified port type is configured for.

IN = 1

Fixed input port

OUT = 2

Fixed output port

IO = 3

Bidirectional (input or output) port

BITIO = 4

Bitwise configurable

NONCONFIG = 5

Bidirectional (input or output) port; configuration is not required.

class uldaq.DigitalPortType

Used with DioPortInfo() as the port_io_type argument value to get the port I/O type.

AUXPORT = 1

AuxPort

AUXPORT0 = None

AuxPort0

AUXPORT1 = 2

AuxPort1

AUXPORT2 = 3

AuxPort2

FIRSTPORTA = 10

FirstPortA

FIRSTPORTB = 11

FirstPortB

FIRSTPORTC = 12

FirstPortC

FIRSTPORTCL = None

FirstPortC Low

FIRSTPORTCH = 13

FirstPortC High

SECONDPORTA = 14

SecondPortA

SECONDPORTB = 15

SecondPortB

SECONDPORTCL = 16

SecondPortC Low

SECONDPORTCH = 17

SecondPortC High

THIRDPORTA = 18

ThirdPortA

THIRDPORTB = 19

ThirdPortB

THIRDPORTCL = 20

ThirdPortC Low

THIRDPORTCH = 21

ThirdPortC High

FOURTHPORTA = 22

FourthPortA

FOURTHPORTB = 23

FourthPortB

FOURTHPORTCL = 24

FourthPortC Low

FOURTHPORTCH = 25

FourthPortC High

FIFTHPORTA = 26

FifthPortA

FIFTHPORTB = 27

FifthPortB

FIFTHPORTCL = 28

FifthPortC Low

FIFTHPORTCH = 29

FifthPortC High

SIXTHPORTA = 30

SixthPortA

SIXTHPORTB = 31

SixthPortB

SIXTHPORTCL = 32

SixthPortC Low

SIXTHPORTCH = 33

SixthPortC High

SEVENTHPORTA = 34

SeventhPortA

SEVENTHPORTB = 35

SeventhPortB

SEVENTHPORTCL = 36

SeventhPortC Low

SEVENTHPORTCH = 37

SeventhPortC High

EIGHTHPORTA = 38

EighthPortA

EIGHTHPORTB = 39

EighthPortB

EIGHTHPORTCL = 40

EighthPortC Low

EIGHTHPORTCH = 41

EighthPortC High

class uldaq.DInScanFlag

Use as the flags argument value for d_in_scan() to set the properties of data returned.

class uldaq.DOutScanFlag

Use as the flags argument value for d_out_scan() to set the properties of data returned.

class uldaq.DevVersionType

Use as the version_type argument for get_version() for the specified device.

FW_MAIN = 0

Firmware version installed on the current device.

FPGA = 1

FPGA version installed on the current device.

RADIO = 2

Radio firmware version installed on the current device.

class uldaq.InterfaceType

A bitmask indicating the physical connection interface used to communicate with a DAQ device.

USB = 1

USB interface

BLUETOOTH = 2

Bluetooth interface

ETHERNET = 4

Ethernet interface

ANY = 7

Any interface

class uldaq.MemAccessType

A bitmask used with get_info() as one of the field types returned in the MemDescriptor struct.

READ = 1

Indicates read access for the location specified by MemRegion()

WRITE = 2

Indicates write access for the location specified by MemRegion()

class uldaq.MemRegion

Use with get_info to specify the memory location on the specified device.

CAL = 1

Specifies the calibration data region information returned to the MemDescriptor struct.

USER = 2

Specifies the user data region information returned to the MemDescriptor struct.

SETTINGS = 4

Specifies the data settings region information returned to the MemDescriptor struct.

class uldaq.PulseOutOption

Used with pulse_out_start() as the options argument value to set advanced options for the specified device.

PO_DEFAULT = 0

No PulseOutOption values are applied.

PO_EXTTRIGGER = 32

The output operation is held off until the specified trigger condition is met. Trigger conditions may be modified using set_trigger().

class uldaq.Range

Used with many analog input and output functions, as well as a return value for get_ranges().

BIP60VOLTS = 1

-60 to +60 Volts

BIP30VOLTS = 2

-30 to +30 Volts

BIP15VOLTS = 3

-15 to +15 Volts

BIP20VOLTS = 4

-20 to +20 Volts

BIP10VOLTS = 5

-10 to +10 Volts

BIP5VOLTS = 6

-5 to +5 Volts

BIP4VOLTS = 7

-4 to +4 Volts

BIP2PT5VOLTS = 8

-2.5 to +2.5 Volts

BIP2VOLTS = 9

-2.0 to +2.0 Volts

BIP1PT25VOLTS = 10

-1.25 to +1.25 Volts

BIP1VOLTS = 11

-1 to +1 Volts

BIPPT625VOLTS = 12

-.625 to +.625 Volts

BIPPT5VOLTS = 13

-.5 to +.5 Volts

BIPPT25VOLTS = 14

-0.25 to +0.25 Volts

BIPPT125VOLTS = 15

-0.125 to +0.125 Volts

BIPPT2VOLTS = 16

-0.2 to +0.2 Volts

BIPPT1VOLTS = 17

-.1 to +.1 Volts

BIPPT078VOLTS = 18

-0.078 to +0.078 Volts

BIPPT05VOLTS = 19

-.05 to +.05 Volts

BIPPT01VOLTS = 20

-.01 to +.01 Volts

BIPPT005VOLTS = 21

-.005 to +.005 Volts

UNI60VOLTS = 1001

0 to +60 Volts

UNI30VOLTS = 1002

0 to +30 Volts

UNI15VOLTS = 1003

0 to +15 Volts

UNI20VOLTS = 1004

0 to +20 Volts

UNI10VOLTS = 1005

0 to +10 Volts

UNI5VOLTS = 1006

0 to +5 Volts

UNI4VOLTS = 1007

0 to +4 Volts

UNI2PT5VOLTS = 1008

0 to +2.5 Volts

UNI2VOLTS = 1009

0 to +2.0 Volts

UNI1PT25VOLTS = 1010

0 to +1.25 Volts

UNI1VOLTS = 1011

0 to +1 Volts

UNIPT625VOLTS = 1012

0 to +.625 Volts

UNIPT5VOLTS = 1013

0 to +.5 Volts

UNIPT25VOLTS = 1014

0 to +0.25 Volts

UNIPT125VOLTS = 1015

0 to +0.125 Volts

UNIPT2VOLTS = 1016

0 to +0.2 Volts

UNIPT1VOLTS = 1017

0 to +.1 Volts

UNIPT078VOLTS = 1018

0 to +0.078 Volts

UNIPT05VOLTS = 1019

0 to +.05 Volts

UNIPT01VOLTS = 1020

0 to +.01 Volts

UNIPT005VOLTS = 1021

0 to +.005 Volts

class uldaq.ScanOption

Used with many analog input and output functions, as well as a return value for get_scan_options().

DEFAULTIO = 0

Transfers A/D data based on the board type and sampling speed.

SINGLEIO = 1

Transfers one packet of data at a time.

BLOCKIO = 2

Transfers A/D data in blocks.

BURSTIO = 4

Transfers A/D data from the FIFO after the scan completes. Allows maximum rates for finite scans up to the full capacity of the FIFO. Not recommended for slow acquisition rates.

CONTINUOUS = 8

Scans data in an endless loop. The only way to stop the operation is with scan_stop().

EXTCLOCK = 16

Data conversions are controlled by an external clock signal.

EXTTRIGGER = 32

Sampling begins when a trigger condition is met.

RETRIGGER = 64

Re-arms the trigger after a trigger event is performed.

BURSTMODE = 128

Enables burst mode sampling, minimizing the channel skew.

PACEROUT = 256

Enables or disables the internal pacer output on a DAQ device.

class uldaq.ScanStatus

Scan status.

IDLE = 0

The scan is idle.

RUNNING = 1

The scan is running.

class uldaq.TcType

Thermocouple types.

J = 1

Type J

K = 2

Type K

T = 3

Type T

E = 4

Type E

R = 5

Type R

S = 6

Type S

B = 7

Type B

N = 8

Type N

class uldaq.TempUnit

Temperature units.

CELSIUS = 1

Celcius

FAHRENHEIT = 2

Fahrenheit

KELVIN = 3

Kelvin

class uldaq.TimerType

Types of timer channels.

STANDARD = 1

Programmable frequency timer

ADVANCED = 2

Programmable frequency timer, plus other attributes such as pulse width

class uldaq.TmrIdleState

Timer idle state.

LOW = 1

Idle low

HIGH = 2

Idle high

class uldaq.TmrStatus

Used with get_pulse_out_status(), as the timer status returned for the specified device.

IDLE = 0

The timer is currently idle.

RUNNING = 1

The timer is currently running.

class uldaq.TriggerType

Used as an individual value with subsystem set_trigger() functions as the trig_type argument, or as a bitmask value with the get_info() functions.

NONE = 0

No trigger type. Valid for subsystem get_info() functions; not a valid value for subsystem set_trigger functions.

POS_EDGE = 1

A digital trigger. The trigger condition is met when the trigger input transitions from a logic low level to a logic high level. This is the default condition when triggering is enabled. All others require configuration using the subsystem set_trigger() functions.

NEG_EDGE = 2

A digital trigger. The trigger condition is met when the trigger input transitions from a logic high level to a logic low level.

HIGH = 4

A digital trigger. The trigger condition is met when the trigger input is at a logic high level.

LOW = 8

A digital trigger. The trigger condition is met when the trigger input is at a logic low level.

GATE_HIGH = 16

A digital gate. The operation is enabled only when the trigger input is at a logic high level.

GATE_LOW = 32

A digital gate. The operation is enabled only when the trigger input is at a logic low level.

RISING = 64

An analog trigger. The trigger condition is met when the trigger input transitions from below the threshold specified by (the level argument value minus the variance argument value) to above the threshold specified by the level argument value.

FALLING = 128

An analog trigger. The trigger condition is met when the trigger input transitions from above the threshold specified by (the level argument value minus the variance argument value) to below the threshold specified by the level argument value.

ABOVE = 256

An analog trigger. The trigger condition is met when the trigger input is above the threshold specified by the level argument value.

BELOW = 512

An analog trigger. The trigger condition is met when the trigger input is below the threshold specified by the level argument value.

GATE_ABOVE = 1024

An analog trigger. The trigger condition is met only when the trigger input is above the threshold specified by the level argument value.

GATE_BELOW = 2048

An analog trigger. The trigger condition is met only when the trigger input is below the threshold specified by the level argument value.

PATTERN_EQ = 16384

A digital pattern trigger. The trigger condition is met when the digital pattern at the trigger input is equal to the pattern specified by the level argument value ANDed with bitwise mask specified by the variance argument value of the set_trigger function for each subsystem.

PATTERN_NE = 32768

A digital pattern trigger. The trigger condition is met when the digital pattern at the trigger input is not equal to the pattern specified by the level argument value ANDed with bitwise mask specified by the variance argument value of the set_trigger function for each subsystem.

PATTERN_ABOVE = 65536

A digital pattern trigger. The trigger condition is met when the digital pattern at the trigger input is greater than the pattern specified by the level argument value ANDed with bitwise mask specified by the variance argument value of the set_trigger function for each subsystem. Value is determined by additive bit weights.

PATTERN_BELOW = 131072

A digital pattern trigger. The trigger condition is met when the digital pattern at the trigger input is less than the pattern specified by the level argument value ANDed with bitwise mask specified by the variance argument value of the set_trigger function for each subsystem. Value is determined by additive bit weights.

class uldaq.ULError

Error codes for Universal Library.

NO_ERROR = 0

No error has occurred

UNHANDLED_EXCEPTION = 1

Unhandled internal exception

BAD_DEV_HANDLE = 2

Invalid device handle

BAD_DEV_TYPE = 3

This function cannot be used with this device

USB_DEV_NO_PERMISSION = 4

Insufficient permission to access this device

USB_INTERFACE_CLAIMED = 5

USB interface is already claimed

DEV_NOT_FOUND = 6

Device not found

DEV_NOT_CONNECTED = 7

Device not connected or connection lost

DEAD_DEV = 8

Device no longer responding

BAD_BUFFER_SIZE = 9

Buffer too small for operation

BAD_BUFFER = 10

Invalid buffer

BAD_MEM_TYPE = 11

Invalid memory type

BAD_MEM_REGION = 12

Invalid memory region

BAD_RANGE = 13

Invalid range

BAD_AI_CHAN = 14

Invalid analog input channel specified

BAD_INPUT_MODE = 15

Invalid input mode specified

ALREADY_ACTIVE = 16

A background process is already in progress

BAD_TRIG_TYPE = 17

Invalid trigger type specified

OVERRUN = 18

FIFO overrun, data was not transferred from device fast enough

UNDERRUN = 19

FIFO underrun, data was not transferred to device fast enough

TIMEDOUT = 20

Operation timed out

BAD_OPTION = 21

Invalid option specified

BAD_RATE = 22

Invalid sampling rate specified

BAD_BURSTIO_COUNT = 23

Sample count cannot be greater than FIFO size for BURSTIO scans

CONFIG_NOT_SUPPORTED = 24

Configuration not supported

BAD_CONFIG_VAL = 25

Invalid configuration value

BAD_AI_CHAN_TYPE = 26

Invalid analog input channel type specified

ADC_OVERRUN = 27

ADC overrun occurred

BAD_TC_TYPE = 28

Invalid thermocouple type specified

BAD_UNIT = 29

Invalid unit specified

BAD_QUEUE_SIZE = 30

Invalid queue size

BAD_CONFIG_ITEM = 31

Invalid config item specified

BAD_INFO_ITEM = 32

Invalid info item specified

BAD_FLAG = 33

Invalid flag specified

BAD_SAMPLE_COUNT = 34

Invalid sample count specified

INTERNAL = 35

Internal error

BAD_COUPLING_MODE = 36

Invalid coupling mode

BAD_SENSOR_SENSITIVITY = 37

Invalid sensor sensitivity

BAD_IEPE_MODE = 38

Invalid IEPE mode

BAD_AI_CHAN_QUEUE = 39

Invalid channel queue specified

BAD_AI_GAIN_QUEUE = 40

Invalid gain queue specified

BAD_AI_MODE_QUEUE = 41

Invalid mode queue specified

FPGA_FILE_NOT_FOUND = 42

FPGA file not found

UNABLE_TO_READ_FPGA_FILE = 43

Unable to read FPGA file

NO_FPGA = 44

FPGA not loaded

BAD_ARG = 45

Invalid argument

MIN_SLOPE_VAL_REACHED = 46

Minimum slope value reached

MAX_SLOPE_VAL_REACHED = 47

Maximum slope value reached

MIN_OFFSET_VAL_REACHED = 48

Minimum offset value reached

MAX_OFFSET_VAL_REACHED = 49

Maximum offset value reached

BAD_PORT_TYPE = 50

Invalid port type specified

WRONG_DIG_CONFIG = 51

Digital I/O is configured incorrectly

BAD_BIT_NUM = 52

Invalid bit number

BAD_PORT_VAL = 53

Invalid port value specified

BAD_RETRIG_COUNT = 54

Invalid re-trigger count

BAD_AO_CHAN = 55

Invalid analog output channel specified

BAD_DA_VAL = 56

Invalid D/A output value specified

BAD_TMR = 57

Invalid timer specified

BAD_FREQUENCY = 58

Invalid frequency specified

BAD_DUTY_CYCLE = 59

Invalid duty cycle specified

BAD_INITIAL_DELAY = 60

Invalid initial delay specified

BAD_CTR = 61

Invalid counter specified

BAD_CTR_VAL = 62

Invalid counter value specified

BAD_DAQI_CHAN_TYPE = 63

Invalid DAQ input channel type specified

BAD_NUM_CHANS = 64

Invalid number of channels specified

BAD_CTR_REG = 65

Invalid counter register specified

BAD_CTR_MEASURE_TYPE = 66

Invalid counter measurement type specified

BAD_CTR_MEASURE_MODE = 67

Invalid counter measurement mode specified

BAD_DEBOUNCE_TIME = 68

Invalid debounce time specified

BAD_DEBOUNCE_MODE = 69

Invalid debounce mode specified

BAD_EDGE_DETECTION = 70

Invalid edge detection mode specified

BAD_TICK_SIZE = 71

Invalid tick size specified

BAD_DAQO_CHAN_TYPE = 72

Invalid DAQ output channel type specified

NO_CONNECTION_ESTABLISHED = 73

No connection established

BAD_EVENT_TYPE = 74

Invalid event type specified

EVENT_ALREADY_ENABLED = 75

An event handler has already been enabled for this event type

BAD_EVENT_SIZE = 76

Invalid event count specified

BAD_CALLBACK_FUCNTION = 77

Invalid callback function specified

BAD_MEM_ADDRESS = 78

Invalid memory address

MEM_ACCESS_DENIED = 79

Memory access denied

DEV_UNAVAILABLE = 80

Device is not available at time of request

BAD_RETRIG_TRIG_TYPE = 81

Re-trigger option is not supported for the specified trigger type

BAD_DESCRIPTOR = 100001

Invalid descriptor

class uldaq.WaitType

Used with the subsystem scan_wait functions as the wait_type argument value for the specified device.

WAIT_UNTIL_DONE = 1

Function returns when the scan operation completes or the time specified by the timeout argument value elapses.

ULException class

Exception for an error in the UL.

exception uldaq.ULException(error_code)

Exception for an error in the UL.

Parameters:error_code – A ULError error code value.
error_code = None

The ULError error code value.

error_message = None

The error message

Device Management

The API provides classes to manage devices connected to the system:

DaqDevice class

UL DAQ Device.

Methods

class uldaq.DaqDevice(daq_device_descriptor)

UL DAQ Device.

Parameters:daq_device_descriptor – A DaqDeviceDescriptor object.
Raises:ULException
Method Description
get_descriptor() Get descriptor information for a device.
connect() Establish a connection to a physical DAQ device.
is_connected() Gets the connection status of a DAQ device.
disconnect() Disconnects from the DAQ device.
flash_led() Flashes the LED on the DAQ device.
get_info() Gets the DAQ device information object used to retrieve information about the DAQ device.
get_ai_device() Gets the analog input subsystem object used to retrieve information about the AI subsystem.
get_ao_device() Gets the analog output subsystem object used to retrieve information about the AO subsystem.
get_dio_device() Gets the digital input/output subsystem object used to retrieve information about the DIO subsystem.
get_ctr_device() Gets the counter subsystem object used to retrieve information about the counter subsystem.
get_tmr_device() Gets the counter subsystem object used to retrieve information about the timer subsystem.
get_daqi_device() Gets the DAQ input subsystem object used to retrieve information about the DAQ input subsystem.
get_daqo_device() Gets the DAQ output subsystem object used to retrieve information about the DAQ output subsystem.
get_mem_info() Gets the DAQ device memory information object used to retrieve information about the reserved memory regions on the DAQ device.
enable_event() Binds one or more event conditions to a callback function.
disable_event() Disables one or more event conditions and unbinds the associated callback function.
mem_read() Reads a value from a specified region in memory.
mem_write() Writes a block of data to the specified address in the reserved memory area.
release() Removes a device from the Universal Library, and releases all resources associated with that device.
get_descriptor()

Get descriptor information for a device.

Returns:DaqDeviceDescriptor
Raises:ULException
connect()

Establish a connection to a physical DAQ device.

Raises:ULException
is_connected()

Gets the DAQ device connection status.

Returns:True if the DAQ device is connected, otherwise False.
Raises:ULException
disconnect()

Disconnects from the DAQ device.

Raises:ULException
flash_led(number_of_flashes)

Flashes the LED on the DAQ device.

Parameters:number_of_flashes – The number of flashes; set to 0 for a continuous flash until the next call with a non-zero value.
Raises:ULException
get_info()

Gets the DAQ device information object.

Returns: DaqDeviceInfo used for getting the capabilities of the DAQ device.

get_config()

Gets the DAQ device configuration object.

Returns:DaqDeviceConfig used for getting the configuration of the DAQ device.
get_ai_device()

Gets the analog input subsystem object used to retrieve information about the AI subsystem.

Returns:AiDevice
get_ao_device()

Gets the analog output subsystem object used to retrieve information about the AO subsystem.

Returns:AoDevice
get_dio_device()

Gets the digital input/output subsystem object used to retrieve information about the DIO subsystem.

Returns:DioDevice
get_ctr_device()

Gets the counter subsystem object used to retrieve information about the counter subsystem.

Returns:CtrDevice
get_tmr_device()

Gets the timer subsystem object used to retrieve information about the timer subsystem.

Returns:TmrDevice
get_daqi_device()

Gets the DAQ input subsystem object used to retrieve information about the DAQ input subsystem.

Returns:DaqiDevice
get_daqo_device()

Gets the DAQ input subsystem object used to retrieve information about the DAQ output subsystem.

Returns:DaqoDevice
get_mem_info()

Gets the DAQ device memory information object used to retrieve information about the memory region of a DAQ device.

Returns:DevMemInfo
enable_event(event_types, event_parameter, event_callback_function, user_data)

Binds one or more event conditions to a callback function.

Parameters:
  • event_types – A bitmask containing the event types to which the callback function will be bound. Possible options are enumerated by DaqEventType.
  • event_parameter – Additional data that specifies an event condition
  • event_callback_function – The callback function to be executed on the event condition.
  • user_data – Data to be passed to the callback function.
Raises:

ULException

disable_event(event_types)

Disables one or more event conditions and unbinds the associated callback function.

Parameters:event_types – A bitmask containing the event types to disable. Possible options are enumerated by DaqEventType.
Raises:ULException
mem_read(mem_region_type, address, count)

Reads a value from a specified region in memory. Use with the MemDescriptor struct to retrieve information about the memory region on a DAQ device.

Parameters:
  • mem_region_type – A MemRegion to read.
  • address – The memory address.
  • count – The number of bytes to read.
Raises:

ULException

mem_write(mem_region_type, address, mem_buffer)

Writes a block of data to the specified address in the reserve memory area.

Parameters:
  • mem_region_type – A MemRegion to write.
  • address – The memory address .
  • mem_buffer – The data to write.
Raises:

ULException

release()

Removes a device from the Universal Library, and releases all resources associated with that device.

Raises:ULException

DaqDeviceInfo class

Provides information about the capabilities of the DAQ device.

Methods

class uldaq.DaqDeviceInfo(handle)

Provides information about the capabilities of the DAQ device.

Parameters:handle – UL DAQ Device handle.
Method Description
get_product_id() Gets the numeric string indicating the product type referenced by the DaqDeviceDescriptor.
get_event_types() Gets the event types supported by the device.
get_mem_info() Gets the DAQ device memory information object used to retrieve information about the reserved memory regions on the DAQ device.
get_product_id()

Gets the numeric string indicating the product type referenced by the DaqDeviceDescriptor.

Returns:The product ID.
Raises:ULException
get_event_types()

Gets the DAQ event types supported by the DAQ device.

Returns:A list of supported AiChanType values.
Raises:ULException
get_mem_info()

Gets the DAQ device memory information object used to retrieve information about the reserved memory regions on the DAQ device.

Returns:An instance of the device memory information object DevMemInfo that contains information about the reserved memory regions on the DAQ device.
Raises:ULException

DaqDeviceConfig class

Provides information about the configuration of the DAQ device.

Methods

class uldaq.DaqDeviceConfig(handle)

Provides information about the configuration of the DAQ device.

Parameters:handle – UL DAQ Device handle.
Method Description
get_version() Gets the firmware version installed on the current device.
get_version(version_type)

Gets the firmware version installed on the current device.

Parameters:version_typeDevVersionType
Returns:The version of the specified type of firmware.
Raises:ULException

DevMemInfo class

Constructor for the DaqDeviceInfo class.

Methods

class uldaq.DevMemInfo(handle)

Provides information about the reserved memory of the DAQ device.

Parameters:handle – UL DAQ Device handle.
Method Description
get_mem_regions() Gets a bitmask of memory regions.
get_mem_region_info() Gets the memory region info objects which contain information about the specified region of memory.
get_mem_regions()

Gets a bitmask of memory regions.

Returns:A list of supported MemRegion objects.
Raises:ULException
get_mem_region_info(mem_region)

Gets memory region info objects which contain information about the specified region of memory.

Returns:A MemRegionInfo object.
Raises:ULException

MemRegionInfo class

Constructor for the MemRegionInfo class.

Methods

class uldaq.MemRegionInfo(region_type, address, size, access_types)

Information about a region of memory.

Parameters:
  • region_type – A MemRegion value.
  • address – The address of the memory region.
  • size – The size of the memory region in bytes.
  • access_type – A list of MemAccessType values.
Method Description
get_region_type() Gets a bitmask of memory region types.
get_address() Gets the address of the memory region.
get_size() Gets the size of the memory region.
get_access_type() Gets a bitmask of memory access types.
get_region_type()

Gets a bitmask of memory region types.

Returns:A MemRegion value.
get_address()

Gets the address of the memory region.

Returns:The address of the memory region.
get_size()

Gets the size of the memory region.

Returns:The size of the memory region in bytes.
get_access_types()

Gets the access types of the memory region.

Returns:A list of MemAccessType values.

Analog Input Subsystem

The API provides classes to manage the AI subsystem on a device:

AiDevice class

Analog input subsystem of the UL DAQ Device.

Methods

class uldaq.AiDevice(handle)

Analog input subsystem of the UL DAQ Device.

Parameters:handle – UL DAQ Device handle.
Method Description
get_info() Get the analog input information object for the UL DAQ Device.
a_in() Gets the value read from an A/D channel.
a_in_scan() Scans a range of A/D channels, and stores the samples in an array.
a_in_load_queue() Loads the A/D queue of the specified device.
set_trigger() Configures the trigger parameters that will be used when a_in_scan() is called with the RETRIGGER or EXTTRIGGER ScanOption.
get_scan_status() Gets the status, count, and index of an A/D scan operation.
scan_stop() Stops the analog input operation currently running.
scan_wait() Waits until the scan operation completes or the specified timeout elapses.
get_info()

Gets the analog input information object for the UL DAQ Device.

Returns:AiInfo object used for retrieving configuration information about the analog input subsystem of the UL DAQ Device.
get_config()

Gets analog input configuration object for the UL DAQ Device.

Returns:AiConfig object used for retrieving configuration information about the analog input subsystem of the UL DAQ Device.
a_in(channel, input_mode, voltage_range, flags)

Returns the value read from an A/D channel.

Parameters:
  • channel – A/D channel number.
  • input_modeAiInputMode
  • voltage_rangeRange
  • flags – A bitmask specifying whether to scale and/or calibrate data. Possible options are enumerated by AInFlag.
Returns:

The value of the A/D channel.

Raises:

ULException

a_in_scan(low_channel, high_channel, input_mode, voltage_range, samples_per_channel, rate, options, flags, data)

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

Parameters:
  • low_channel – First A/D channel in the scan.
  • high_channel – Last A/D channel in the scan.
  • input_modeAiInputMode
  • voltage_rangeRange.
  • samples_per_channel – the number of A/D samples to collect from each channel in the scan.
  • rate – A/D sample rate in samples per channel per second.
  • options – A bitmask that specifies A/D scan options. Possible options are enumerated by ScanOption.
  • flags – A bitmask specifying whether to scale and/or calibrate data. Possible options are enumerated by AInScanFlag.
  • data – Pointer to the buffer to receive the data.
Returns:

The actual input scan rate of the scan.

Raises:

ULException

a_in_load_queue(queue)

Loads the A/D queue of a specified device.

Parameters:queue – An array of AiQueueElement structs, each of which contains fields specifying the channel, range, and mode.
Raises:ULException
set_trigger(trig_type, trig_chan, level, variance, retrigger_sample_count)

Configures the trigger parameters that will be used when a_in_scan() is called with the RETRIGGER or EXTTRIGGER ScanOption

Parameters:
  • trig_typeTriggerType based on the external trigger source.
  • trig_chan – The trigger channel; ignored if trig_type is set to POS_EDGE, NEG_EDGE, HIGH, LOW, GATE_HIGH, GATE_LOW, RISING, or FALLING.
  • level – The level at or around which the trigger event should be detected; ignored if trig_type is set to POS_EDGE, NEG_EDGE, HIGH, LOW, GATE_HIGH, GATE_LOW, RISING, or FALLING.
  • variance – The 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.
  • retrigger_sample_count – The number of samples per trigger to acquire with each trigger event; ignored unless the RETRIGGER ScanOption is set for the scan.
Raises:

ULException

get_scan_status()

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

Returns:A tuple containing the scan status ScanStatus and transfer status TransferStatus for the analog input background operation.
Raises:ULException
scan_stop()

Stops the analog input operation currently running.

Raises:ULException
scan_wait(wait_type, timeout)

Waits until the scan operation completes or the specified timeout elapses.

Parameters:
  • wait_type – The WaitType.
  • timeout – The timeout value in seconds (s); set to -1 to wait indefinitely for the scan function to end.
Raises:

ULException

AiInfo class

Provides information about the capabilities of the analog input subsystem.

Methods

class uldaq.AiInfo(handle)

Provides information about the capabilities of the analog input subsystem.

Parameters:handle – UL DAQ Device handle.
Method Description
get_num_chans() Gets the total number of A/D channels.
get_num_chans_by_mode() Gets the number of A/D channels for the specified input mode.
get_num_chans_by_type() Gets the number of A/D channels for the specified channel type.
get_resolution() Gets the A/D resolution in number of bits.
get_min_scan_rate() Gets the minimum scan rate in samples per second.
get_max_scan_rate() Gets the maximum scan rate in samples per second.
get_max_throughput() Gets the maximum throughput in samples per second.
get_max_burst_rate() Gets the maximum burst rate in samples per second.
get_max_burst_throughput() Gets the maximum burst throughput in samples per second.
get_fifo_size() Gets the FIFO size in bytes.
get_scan_options() Gets a bitmask of supported scan options.
has_pacer() Determines whether the device supports paced operations.
get_chan_types() Gets a bitmask of supported channel types.
get_ranges() Gets a bitmask of supported ranges for the specified input mode.
get_trigger_types() Gets a bitmask of supported trigger types.
get_max_queue_length() Gets the maximum length of the queue for the specified channel mode.
get_queue_types() Gets a bitmask of supported queue types.
get_chan_queue_limitations() Gets a bitmask of device queue limitations.
get_num_chans()

Gets the total number of A/D channels.

Returns:The number of analog input channels.
Raises:ULException
get_num_chans_by_mode(input_mode)

Gets the number of A/D channels for the specified input mode.

Parameters:input_modeAiInputMode
Returns:The number of analog input channels.
Raises:ULException
get_num_chans_by_type(channel_type)

Gets the number of A/D channels for the specified AiChanType.

Parameters:channel_typeAiChanType for the analog input subsystem.
Returns:The number of analog input channels.
Raises:ULException
get_resolution()

Gets the A/D resolution in number of bits.

Returns:The number of bits per sample for the analog input channels.
Raises:ULException
get_min_scan_rate()

Gets the minimum scan rate in samples per second.

Returns:The minimum scan rate in samples per second.
Raises:ULException
get_max_scan_rate()

Gets the maximum scan rate in samples per second.

Returns:The maximum scan rate in samples per second.
Raises:ULException
get_max_throughput()

Gets the maximum throughput in samples per second.

Returns:The maximum throughput in samples per second.
Raises:ULException
get_max_burst_rate()

Gets the maximum burst rate in samples per second when using the BURSTIO ScanOption.

Returns:The maximum burst rate in samples per second.
Raises:ULException
get_max_burst_throughput()

Gets the maximum burst throughput in samples per second.

Returns:The maximum burst throughput in samples per second.
Raises:ULException
get_fifo_size()

Gets the FIFO size in bytes.

Returns:The FIFO size in bytes.
Raises:ULException
get_scan_options()

Gets a bitmask of supported scan options.

Returns:A bitmask of supported ScanOption values.
Raises:ULException
has_pacer()

Determines whether the device supports paced operations.

Returns:True if the device has an analog input hardware pacer. False if the device does not have an analog input hardware pacer.
Raises:ULException
get_chan_types()

Gets a bitmask of supported channel types.

Returns:AiChanType
Raises:ULException
get_ranges(input_mode)

Gets a bitmask of supported ranges for the specified input mode.

Parameters:input_modeAiInputMode
Returns:Range
Raises:ULException
get_trigger_types()

Gets a bitmask of supported trigger types.

Returns:TriggerType
Raises:ULException
get_max_queue_length(input_mode)

Gets the maximum length of the queue for the specified channel mode.

Parameters:input_modeAiInputMode
Returns:The maximum number of channels in the queue.
Raises:ULException
get_queue_types()

Gets a bitmask of supported queue types.

Returns:AiQueueType
Raises:ULException
get_chan_queue_limitations()

Gets a bitmask of device queue limitations.

Returns:AiChanQueueLimitation
Raises:ULException

AiConfig class

Provides information about the configuration of the analog input subsystem.

Methods

class uldaq.AiConfig(handle)

Provides information about the configuration of the analog input subsystem.

Parameters:handle – UL DAQ Device handle.
Method Description
set_chan_type() Configures the channel type for the specified A/D channel.
get_chan_type() Gets the channel type for the specified A/D channel.
set_chan_tc_type() Configures the thermocouple type for the specified A/D channel.
get_chan_tc_type() Gets the thermocouple type for the specified A/D channel.
get_cal_date() Gets the calibration date for the specified DAQ device.
set_chan_type(channel, chan_type)

Configures the channel type for the specified A/D channel.

Parameters:
  • channel – The A/D channel number.
  • chan_typeAiChanType
Raises:

ULException

get_chan_type(channel)

Gets the channel type for the specified A/D channel.

Parameters:channel – The A/D channel number.
Returns:AiChanType
Raises:ULException
set_chan_tc_type(channel, tc_type)

Configures the thermocouple type for the specified A/D channel.

Parameters:
  • channel – The A/D channel number.
  • tc_typeTcType
Raises:

ULException

get_chan_tc_type(channel)

Gets the thermocouple type for the specified A/D channel.

Parameters:channel – The A/D channel number.
Returns:TcType
Raises:ULException
get_cal_date()

Gets the calibration date for the DAQ device.

Returns:The calibration date for the DAQ device.
Raises:ULException

Analog Output Subsystem

The API provides classes to manage the AO subsystem on a device:

AoDevice class

Analog output subsystem of the UL DAQ Device.

Methods

class uldaq.AoDevice(handle)

Analog output subsystem of the UL DAQ Device.

Parameters:handle – UL DAQ Device handle.
Method Description
get_info() Gets the analog output information object for the UL DAQ device.
a_out() Writes the value of a D/A output.
a_out_scan() Writes values to a range of D/A channels.
get_scan_status() Gets the current status of the D/A operation.
scan_stop() Stops the analog output operation currently running.
scan_wait() Waits until the scan operation completes or the specified timeout elapses.
set_trigger() Configures the trigger parameters that will be used when a_out_scan() is called with the RETRIGGER or EXTTRIGGER ScanOption.
get_info()

Get the analog output information object for the UL DAQ Device.

Returns:AoInfo used for getting the capabilities of the analog output subsystem.
a_out(channel, voltage_range, flags, data)

Writes the value of a D/A output.

Parameters:
  • channel – D/A channel number.
  • voltage_range – D/A Range.
  • flags – bitmask that specifies whether to scale and/or calibrate the data. Possible options are enumerated by AOutFlag.
  • data – The value to write.
Raises:

ULException

a_out_scan(low_chan, high_chan, voltage_range, samples_per_channel, rate, options, flags, data)

Writes values to a range of D/A channels.

Parameters:
  • low_chan – First D/A channel in the scan.
  • high_chan – Last D/A channel in the scan.
  • voltage_range – D/A Range.
  • samples_per_channel – Number of D/A samples to output.
  • rate – Sample output rate in scans per second.
  • options – A bitmask that specifies D/A scan options. Possible options are enumerated by ScanOption.
  • flags – A bitmask specifying whether to scale and/or calibrate data. Possible options are enumerated by AOutScanFlag.
  • data – The data buffer to write.
Returns:

The actual output scan rate.

Raises:

ULException

get_scan_status()

Gets the current status of the D/A operation.

Returns:A tuple containing the ScanStatus and TransferStatus of the analog output background operation.
Raises:ULException
scan_stop()

Stops the D/A scan operation currently running.

Raises:ULException
scan_wait(wait_type, timeout)

Waits until the scan operation completes or the specified timeout elapses.

Parameters:
  • wait_type – The WaitType.
  • timeout – The timeout value in seconds (s); set to -1 to wait indefinitely for the scan function to end.
Raises:

ULException

set_trigger(trigger_type, channel, level, variance, retrigger_count)

Configures the trigger parameters that will be used when a_out_scan() is called with the RETRIGGER or EXTTRIGGER ScanOption.

Parameters:
  • trigger_typeTriggerType based on the external trigger source.
  • channel – Analog output channel number; ignored if trigger_type is set to POS_EDGE, NEG_EDGE, HIGH, LOW, GATE_HIGH, GATE_LOW, RISING, or FALLING.
  • level – The level at or around which the trigger event should be detected; ignored if trig_type is set to POS_EDGE, NEG_EDGE, HIGH, LOW, GATE_HIGH, GATE_LOW, RISING, or FALLING.
  • variance – The 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.
  • retrigger_count – The number of samples to generate with each trigger event; ignored unless the RETRIGGER ScanOption is set for the scan.
Raises:

ULException

AoInfo class

Provides information about the capabilities of the analog output subsystem.

Methods

class uldaq.AoInfo(handle)

Provides information about the capabilities of the analog output subsystem.

Parameters:handle – UL DAQ Device handle.
Method Description
get_num_chans() Gets the total number of D/A channels.
get_resolution() Gets the D/A resolution in number of bits.
get_min_scan_rate() Gets the minimum scan rate in samples per second.
get_max_scan_rate() Gets the maximum scan rate in samples per second.
get_max_throughput() Gets the maximum throughput in samples per second.
get_fifo_size() Gets the FIFO size in bytes.
get_scan_options() Gets a bitmask of supported scan options.
has_pacer() Determines whether the device supports paced operations.
get_ranges() Gets a bitmask of supported ranges.
get_trigger_types() Gets a bitmask of supported trigger types.
get_num_chans()

Gets the total number of D/A channels.

Returns:The number of analog output channels.
Raises:ULException
get_resolution()

Gets the D/A resolution in number of bits.

Returns:The number of bits per sample for the analog output channels.
Raises:ULException
get_min_scan_rate()

Gets the minimum scan rate in samples per second.

Returns:The minimum scan rate in samples per second.
Raises:ULException
get_max_scan_rate()

Gets the maximum scan rate in samples per second.

Returns:The maximum scan rate in samples per second.
Raises:ULException
get_max_throughput()

Gets the maximum throughput in samples per second.

Returns:The maximum throughput in samples per second.
Raises:ULException
get_fifo_size()

Gets the FIFO size in bytes.

Returns:The FIFO size in bytes.
Raises:ULException
get_scan_options()

Gets a bitmask of supported scan options.

Returns:A list of supported ScanOption objects.
Raises:ULException
has_pacer()

Determines whether the device supports paced operations.

Returns:True if the device has an analog output hardware pacer. False if the device does not have an analog output hardware pacer.
Raises:ULException
get_ranges()

Gets a bitmask of supported ranges.

Returns:Range
Raises:ULException
get_trigger_types()

Gets a bitmask of supported trigger types.

Returns:TriggerType
Raises:ULException

Digital I/O Subsystem

The API provides classes to manage the Digital I/O subsystem on a device:

DioDevice class

Digital I/O subsystem of the UL DAQ Device.

Methods

class uldaq.DioDevice(handle)

Digital I/O subsystem of the UL DAQ Device.

Parameters:handle – UL DAQ Device handle.
Method Description
get_info() Gets the digital I/O information object for the UL DAQ Device.
d_config_port() Configures a digital port as input or output.
d_config_bit() Configures a digital bit as input or output.
d_in() Returns the value read from a digital port.
d_out() Writes the value to the digital port type.
d_bit_in() Returns the value of a digital bit.
d_bit_out() Writes a value to a digital bit.
d_in_scan() Reads a range of digital ports.
d_out_scan() Writes data to a digital port.
d_in_set_trigger() Configures the trigger parameters that will be used when d_in_scan() is called with the RETRIGGER or EXTTRIGGER ScanOption.
d_out_set_trigger() Configures the trigger parameters that will be used when d_out_scan() is called with the RETRIGGER or EXTTRIGGER ScanOption.
d_in_get_scan_status() Gets the current status of the digital input operation.
d_out_get_scan_status() Gets the current status of the digital output operation.
d_in_scan_stop() Stops the digital input operation currently running.
d_out_scan_stop() Stops the digital output operation currently running.
d_in_scan_wait() Returns when the input scan operation completes on the specified device, or the time specified by the timeout argument elapses.
d_out_scan_wait() Returns when the output scan operation completes on the specified device, or the time specified by the timeout argument elapses.
get_info()

Get Digital I/O Information object for the UL DAQ Device.

Returns:A DioInfo object used for retrieving information about the digital I/O subsystem of the UL DAQ Device.
get_config()

Get Digital I/O Configuration object for the UL DAQ Device.

Returns:A DioConfig object used for retrieving configuration information about the digital I/O subsystem of the UL DAQ Device.
d_config_port(port_type, direction)

Configures a digital port as input or output.

Parameters:
Raises:

ULException

d_config_bit(port_type, bit_number, direction)

Configures a digital bit as input or output.

Parameters:
  • port_type – The digital port containing the bit to configure DigitalPortType;the bit must be configurable.
  • bit_number – The bit number within the specified port.
  • direction – The bit direction DigitalDirection (input or output).
Raises:

ULException

d_in(port_type)

Returns the value read from a digital port.

Parameters:port_type – Digital port to read DigitalPortType.
Returns:The port value.
Raises:ULException
d_out(port_type, data)

Writes the specified value to a digital output port.

Parameters:
  • port_type – Digital port type DigitalPortType.
  • data – The port value.
Raises:

ULException

d_bit_in(port_type, bit_number)

Returns the value of a digital bit.

Parameters:
  • port_type – Digital port DigitalPortType containing the bit to be read.
  • bit_number – The bit position within the port to read.
Returns:

The bit value.

Raises:

ULException

d_bit_out(port_type, bit_number, data)

Writes a value to a digital bit.

Parameters:
  • port_type – Digital port DigitalPortType containing the bit to be written.
  • bit_number – The number of the bit to be written.
  • data – The bit value to write.
Raises:

ULException

d_in_scan(low_port_type, high_port_type, samples_per_port, rate, options, flags, data)

Reads a range of digital ports.

Parameters:
  • low_port_type – First port DigitalPortType in the scan.
  • high_port_type – Last port DigitalPortType in the scan.
  • samples_per_port – The number of samples to read.
  • rate – Sample input rate in samples per second.
  • options – A bitmask specifying scan options. Possible options are enumerated by ScanOption.
  • flags – A bitmask specifying data options for the scan. Possible options are enumerated by DInScanFlag.
  • data – The buffer to receive the digital data.
Returns:

The actual sample input rate of the scan.

Raises:

ULException

d_out_scan(low_port_type, high_port_type, samples_per_port, rate, options, flags, data)

Writes data to a digital port.

Parameters:
  • low_port_type – First port DigitalPortType in the scan.
  • high_port_type – Last port DigitalPortType in the scan.
  • samples_per_port – The number of samples per port to write.
  • rate – Sample output rate in samples per second.
  • options – A bitmask specifying scan options. Possible options are enumerated by ScanOption.
  • flags – A bitmask specifying data options for the scan. Possible options are enumerated by DInScanFlag.
  • data – The data buffer to be written.
Returns:

The actual sample output rate of the scan.

Raises:

ULException

d_in_set_trigger(trig_type, trig_chan, level, variance, retrigger_sample_count)

Configures the trigger parameters that will be used when d_in_scan() is called with the RETRIGGER or EXTTRIGGER ScanOption.

Parameters:
  • trig_typeTriggerType based on the external trigger source.
  • trig_chan – The trigger channel; ignored if trig_type is set to POS_EDGE, NEG_EDGE, HIGH, LOW, GATE_HIGH, GATE_LOW, RISING, or FALLING.
  • level – The level at or around which the trigger event should be detected; ignored if trig_type is set to POS_EDGE, NEG_EDGE, HIGH, LOW, GATE_HIGH, GATE_LOW, RISING, or FALLING.
  • variance – The 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.
  • retrigger_sample_count – The number of samples per trigger to acquire with each trigger event; ignored unless the RETRIGGER ScanOption is set for the scan.
Raises:

ULException

d_out_set_trigger(trig_type, trig_chan, level, variance, retrigger_sample_count)

Configures the trigger parameters that will be used when d_out_scan() is called with the RETRIGGER or EXTTRIGGER ScanOption.

Parameters:
  • trig_typeTriggerType based on the external trigger source.
  • trig_chan – The trigger channel; ignored if trig_type is set to POS_EDGE, NEG_EDGE, HIGH, LOW, GATE_HIGH, GATE_LOW, RISING, or FALLING.
  • level – The level at or around which the trigger event should be detected; ignored if trig_type is set to POS_EDGE, NEG_EDGE, HIGH, LOW, GATE_HIGH, GATE_LOW, RISING, or FALLING.
  • variance – The 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.
  • retrigger_sample_count – The number of samples per trigger to acquire with each trigger event; ignored unless the RETRIGGER ScanOption is set for the scan.
Raises:

ULException

d_in_get_scan_status()

Gets the status of the digital input scan operation.

Returns:A tuple containing the scan status ScanStatus and transfer status TransferStatus of the digital input background operation.
Raises:ULException
d_out_get_scan_status()

Gets the status of the digital output scan operation.

Returns:A tuple containing the scan status ScanStatus and transfer status TransferStatus of the digital output background operation.
Raises:ULException
d_in_scan_stop()

Stops the digital input operation currently running.

Raises:ULException
d_out_scan_stop()

Stops the digital output operation currently running.

Raises:ULException
d_in_scan_wait(wait_type, timeout)

Waits until the scan operation completes or the specified timeout elapses.

Parameters:
  • wait_type – The WaitType.
  • timeout – The timeout value in seconds (s); set to -1 to wait indefinitely for the scan function to end.
Raises:

ULException

d_out_scan_wait(wait_type, timeout)

Stops a background output operation for a specified time.

Parameters:
  • wait_type – The WaitType.
  • timeout – The timeout value in milliseconds (ms).
Raises:

ULException

DioInfo class

Provides information about the capabilities of the digital I/O subsystem.

Methods

class uldaq.DioInfo(handle)

Provides information about the capabilities of the digital I/O subsystem.

Parameters:handle – UL DAQ Device handle.
Method Description
get_num_ports() Gets the total number of digital I/O ports.
get_port_types() Gets a bitmask of supported port types.
get_port_info() Gets the I/O type and number of bits in the specified port.
get_num_bits() Gets the number of bits in a specified port.
get_port_io_type() Gets input, output, and programmability information. for the specified port.
has_pacer() Determines whether the device supports paced digital digital operation (scanning).
get_min_scan_rate() Gets the minimum scan rate in samples per second for the specified digital direction.
get_max_scan_rate() Gets the maximum scan rate in samples per second for the specified digital direction.
get_max_throughput() Gets the maximum throughput in samples per second for the specified digital direction.
get_fifo_size() Gets the FIFO size in bytes for the specified digital direction.
get_scan_options() Gets a bitmask of supported scan options.
get_trigger_types() Gets a bitmask of supported trigger types.
get_num_ports()

Gets the total number of digital I/O ports.

Returns:The number of digital I/O ports.
Raises:ULException
get_port_types()

Gets a bitmask of supported port types.

Returns:DigitalPortType
Raises:ULException
get_port_info(port_type)

Gets the I/O type and number of bits in the specified port.

Parameters:port_typeDigitalPortType
Returns:A DioPortInfo object containing the port I/O type and number of bits in the port.
Raises:ULException
has_pacer(direction)

Determines whether the device supports paced digital operation (scanning).

Parameters:directionDigitalDirection
Returns:True if the device has an analog output hardware pacer. False if the device does not have an analog output hardware pacer.
Raises:ULException
get_min_scan_rate(direction)

Gets the minimum scan rate in samples per second for the specified digital direction.

Parameters:directionDigitalDirection
Returns:The minimum scan rate in samples per second.
Raises:ULException
get_max_scan_rate(direction)

Gets the maximum scan rate in samples per second for the specified digital direction.

Parameters:directionDigitalDirection
Returns:The maximum scan rate in samples per second.
Raises:ULException
get_max_throughput(direction)

Gets the maximum throughput in samples per second for the specified digital direction.

Parameters:directionDigitalDirection
Returns:The maximum throughput in samples per second.
Raises:ULException
get_fifo_size(direction)

Gets the FIFO size in bytes for the specified digital direction.

Parameters:direction – The direction DigitalDirection whose fifo size is being determined.
Returns:The FIFO size in bytes.
Raises:ULException
get_scan_options(direction)

Gets a bitmask of supported scan options.

Parameters:directionDigitalDirection
Returns:ScanOption
Raises:ULException
get_trigger_types(direction)

Gets a bitmask of supported trigger types for the specified digital direction.

Parameters:directionDigitalDirection
Returns:TriggerType
Raises:ULException

DioConfig class

Provides information about the configuration of the digital I/O subsystem.

Methods

class uldaq.DioConfig(handle)

Provides information about the configuration of the digital I/O subsystem.

Parameters:handle – UL DAQ Device handle.
Method Description
get_port_direction() Gets the direction that each bit in the specified port is configured for.
get_port_direction(port_type)

Gets the direction that each bit in the specified port is configured for.

Parameters:port_type – The port type DigitalPortType whose direction is being determined.
Returns:A list of DigitalDirection values that specify the direction of each bit in the specified port.
Raises:ULException

Counter Subsystem

The API provides classes to manage the counter subsystem on a device:

CtrDevice class

Counter subsystem of the UL DAQ Device.

Methods

class uldaq.CtrDevice(handle)

Counter subsystem of the UL DAQ Device.

Parameters:handle – UL DAQ Device handle.
Method Description
get_info() Gets the counter information object for the UL DAQ device.
c_in() Reads the value of a count register.
c_load() Loads a value into the specified counter register.
c_clear() Sets the counter to 0.
c_read() Reads the value of the specified counter register.
c_in_scan() Reads a range of counter channels.
c_config_scan() Configures a counter channel, for counters with programmable types.
set_trigger() Configures the trigger parameters that will be used when c_in_scan() is called with the RETRIGGER or EXTTRIGGER ScanOption.
get_scan_status() Gets the current status of the counter input operation.
scan_stop() Stops the counter input operation currently running.
get_info()

Get counter subsystem information object for the UL DAQ Device.

Returns:CtrInfo used for getting the capabilities of the counter subsystem.
c_in(counter_number)

Reads the value of a count register.

Parameters:counter_number – The counter number.
Returns:The data value.
Raises:ULException
c_load(counter_number, register_type, load_value)

Loads a value into the specified counter register.

Parameters:
  • counter_number – The counter number.
  • register_type – The CounterRegisterType value.
  • load_value – The load value.
Raises:

ULException

c_clear(counter_number)

Sets the specified counter to 0.

Parameters:counter_number – The counter number to clear.
Raises:ULException
c_read(counter_number, register_type)

Reads the value of the specified counter register.

Parameters:
Returns:

The value of the counter register.

Raises:

ULException

c_in_scan(low_channel, high_channel, samples_per_channel, rate, options, flags, data)

Reads a series of values from a range of counter channels.

Parameters:
  • low_channel – The first channel of the scan.
  • high_channel – The last channel of the scan.
  • samples_per_channel – The number of samples per counter to read.
  • rate – The rate in samples per second per counter.
  • options – A bitmask specifying scan options. Possible options are enumerated by ScanOption.
  • flags – A bitmask specifying whether to scale and/or calibrate data. Possible options are enumerated by CInScanFlag.
  • data – The data buffer to receive the data being read.
Returns:

The actual input scan rate.

Raises:

ULException

c_config_scan(counter_number, measurement_type, measurement_mode, edge_detection, tick_size, debounce_mode, debounce_time, flags=<CConfigScanFlag.DEFAULT: 0>)

Configures a counter channel; for counters with programmable types.

Parameters:
  • counter_number – The counter number.
  • measurement_type – The CounterMeasurementType value.
  • measurement_mode – A bitmask of CounterMeasurementMode values.
  • edge_detection – The CounterEdgeDetection value; sets the counter to increment on a positive edge or negative edge of the input signal.
  • tick_size – The CounterTickSize value; bitmask that specifies the counter resolution for measurement modes such as period, pulse width, and timing.
  • debounce_mode – The CounterDebounceMode value.
  • debounce_time – The CounterDebounceTime value.
  • flags (optional) – A bitmask specifying the counter scan option. Possible options are enumerated by CConfigScanFlag. Default is CConfigScanFlag.DEFAULT.
Raises:

ULException

set_trigger(trig_type, trig_chan, level, variance, retrigger_count)

Configures the trigger parameters that will be used when c_in_scan() is called with the RETRIGGER or EXTTRIGGER ScanOption.

Parameters:
  • trig_typeTriggerType based on the external trigger source.
  • trig_chan – The trigger channel; ignored if trig_type is set to POS_EDGE, NEG_EDGE, HIGH, LOW, GATE_HIGH, GATE_LOW, RISING, or FALLING.
  • level – The level at or around which the trigger event should be detected; ignored if trig_type is set to POS_EDGE, NEG_EDGE, HIGH, LOW, GATE_HIGH, GATE_LOW, RISING, or FALLING.
  • variance – The degree to which the input signal can vary relative to the level parameter; ignored for all types where level is ignored.
  • retrigger_count – The number of samples per trigger to acquire with each trigger event; ignored unless the RETRIGGER ScanOption is set for the scan.
Raises:

ULException

get_scan_status()

Gets the current status of the counter input operation.

Returns:A tuple containing the ScanStatus and TransferStatus of the analog output background operation.
Raises:ULException
scan_stop()

Stops the counter input operation currently running.

Raises:ULException
scan_wait(wait_type, timeout)

Waits until the scan operation completes or the specified timeout elapses.

Parameters:
  • wait_type – The WaitType.
  • timeout – The timeout value in seconds (s); set to -1 to wait indefinitely for the scan function to end.
Raises:

ULException

CtrInfo class

Provides information about the capabilities of the counter subsystem.

Methods

class uldaq.CtrInfo(handle)

Provides information about the capabilities of the counter subsystem.

Parameters:handle – UL DAQ Device handle.
Method Description
get_num_ctrs() Gets the total number of counter channels.
get_measurement_types() Gets a bitmask of supported measurement types for a specified counter.
get_measurement_modes() Gets a bitmask of supported measurement modes compatible with the specified measurement type.
get_register_types() Gets a bitmask of supported register types. .
get_resolution() Gets the resolution in number of bits. .
get_min_scan_rate() Gets the minimum scan rate in samples per second.
get_max_scan_rate() Gets the maximum scan rate in samples per second.
get_max_throughput() Gets the maximum throughput in samples per second.
get_fifo_size() Gets the FIFO size in bytes.
get_scan_options() Gets a bitmask of supported scan options.
has_pacer() Determines whether the device supports paced operations.
get_trigger_types() Gets a bitmask of supported trigger types.
get_num_ctrs()

Gets the total number of counter channels.

Returns:The number of counter channels.
Raises:ULException
get_measurement_types(counter_number)

Gets a bitmask of supported measurement types for a specified counter.

Parameters:counter_number – The counter number.
Returns:CounterMeasurementType
Raises:ULException
get_measurement_modes(counter_measurement_type)

Gets a bitmask of supported measurement modes compatible with the specified measurement type.

Parameters:counter_measurement_type – The CounterMeasurementType whose measurement modes are being returned.
Returns:CounterMeasurementMode
Raises:ULException
get_register_types()

Gets a bitmask of supported register types.

Returns:A list of supported CounterRegisterType values.
Raises:ULException
get_resolution()

Gets the resolution in number of bits.

Returns:The number of bits per counter sample.
Raises:ULException
get_min_scan_rate()

Gets the minimum scan rate in samples per second.

Returns:The minimum scan rate in samples per second.
Raises:ULException
get_max_scan_rate()

Gets the maximum scan rate in samples per second.

Returns:The maximum scan rate in samples per second.
Raises:ULException
get_max_throughput()

Gets the maximum throughput in samples per second.

Returns:The maximum throughput in samples per second.
Raises:ULException
get_fifo_size()

Gets the FIFO size in bytes.

Returns:The FIFO size in bytes.
Raises:ULException
get_scan_options()

Gets a bitmask of supported scan options.

Returns:ScanOption
Raises:ULException
has_pacer()

Determines whether the device supports paced operations.

Returns:True if the device has a counter hardware pacer. False if the device does not have a counter hardware pacer.
Raises:ULException
get_trigger_types()

Gets a bitmask of supported trigger types.

Returns:TriggerType
Raises:ULException

Timer Subsystem

The API provides classes to manage the timer subsystem on a device:

TmrDevice class

Timer subsystem of the UL DAQ Device.

Methods

class uldaq.TmrDevice(handle)

Timer subsystem of the UL DAQ Device.

Parameters:handle – UL DAQ Device handle.
Method Description
get_info() Get the timer information object for the UL DAQ Device.
pulse_out_start() Starts a timer to generate digital pulses at a specified frequency and duty cycle.
pulse_out_stop() Stops a timer output.
get_pulse_out_status() Gets the status of the timer output operation.
set_trigger() Configures the trigger parameters that will be used when pulse_out_start() is called with the RETRIGGER or EXTTRIGGER PulseOutOption.
get_info()

Gets timer subsystem information object for the UL DAQ Device.

Returns:TmrInfo used for getting the capabilities of the timer subsystem.
pulse_out_start(timer_number, frequency, duty_cycle, pulse_count, initial_delay, idle_state, options)

Starts a timer to generate digital pulses at a specified frequency and duty cycle.

Parameters:
  • timer_number – The timer number.
  • frequency – The frequency of the timer pulse output.
  • duty_cycle – The duty cycle of the timer pulse output.
  • pulse_count – The number of pulses to generate; set to 0 for continuous pulse output
  • initial_delay – The amount of time in seconds to wait before the the first pulse is generated at the timer output.
  • idle_stateTmrIdleState
  • options – A bitmask of PulseOutOption values.
Returns:

A tuple containing the actual frequency, duty cycle, and initial delay values.

Raises:

ULException

pulse_out_stop(timer_number)

Stops a timer output.

Parameters:timer_number – The timer number.
Raises:ULException
get_pulse_out_status(timer_number)

Gets the status of the timer output operation.

Parameters:timer_number – The timer number.
Returns:A TmrStatus value.
Raises:ULException
set_trigger(trig_type, trig_chan, level, variance, retrigger_count)

Configures the trigger parameters that will be used when pulse_out_start() is called with the RETRIGGER or EXTTRIGGER PulseOutOption.

Parameters:
  • trig_type – The digital trigger type TriggerType value.
  • trig_chan – Ignored.
  • level – Ignored.
  • variance – Ignored.
  • retrigger_count – Ignored.
Raises:

ULException

TmrInfo class

Provides information about the capabilities of the timer subsystem.

Methods

class uldaq.TmrInfo(handle)

Provides information about the capabilities of the timer subsystem.

Parameters:handle – UL DAQ Device handle.
Method Description
get_num_tmrs() Gets the total number of timer channels.
get_timer_type() Get the timer type.
get_min_frequency() Gets the minimum output frequency.
get_max_frequency() Gets the maximum output frequency.
get_num_tmrs()

Gets the total number of timer channels.

Returns:The total number of timer channels.
Raises:ULException
get_timer_type(timer_number)

Gets the timer type.

Parameters:timer_number – The timer number.
Returns:The TimerType for the specified timer.
Raises:ULException
get_min_frequency()

Gets the minimum output frequency.

Returns:The minimum output frequency.
Raises:ULException
get_max_frequency()

Gets the maximum output frequency.

Returns:The maximum output frequency.
Raises:ULException

Daq Input Subsystem

The API provides classes to manage the DAQ input subsystem on a device:

DaqiDevice class

Daq Input subsystem of the UL DAQ Device.

Methods

class uldaq.DaqiDevice(handle)

Daq Input subsystem of the UL DAQ Device.

Parameters:handle – UL DAQ Device handle.
Method Description
get_info() Gets daq input information object for the UL DAQ Device.
set_trigger() Configures the trigger parameters that will be used when daq_in_scan() is called with the RETRIGGER or EXTTRIGGER ScanOption.
daq_in_scan() Allows scanning of multiple input subsystems, such as analog, digital, counter, and stores the samples in an array.
get_scan_status() Gets the current status of the synchronous input operation.
scan_stop() Stops the synchronous input operation currently running.
scan_wait() Returns when the scan operation completes on the specified device, or the time specified by the timeout argument elapses.
get_info()

Gets the daq input information object for the UL DAQ Device.

Returns:A DaqiInfo object used for retrieving information about the DAQ input subsystem of the UL DAQ Device.
set_trigger(trig_type, trig_chan, level, variance, retrigger_sample_count)

Configures the trigger parameters that will be used when daq_in_scan() is called with the RETRIGGER or EXTTRIGGER ScanOption.

Parameters:
  • trig_type – The type of triggering TriggerType based on the external trigger source.
  • trig_chan – A DaqInChanDescriptor object.
  • level – The level at or around which the trigger event should be detected; ignored if trig_type is set to POS_EDGE, NEG_EDGE, HIGH, LOW, GATE_HIGH, GATE_LOW, RISING, or FALLING.
  • variance – The 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.
  • retrigger_sample_count – The number of samples per trigger to acquire with each trigger event; ignored unless the RETRIGGER ScanOption is set for the scan.
Raises:

ULException

daq_in_scan(channel_descriptors, samples_per_channel, rate, options, flags, data)

Allows scanning of multiple input subsystems, such as analog, digital, counter, and stores the samples in an array. This method only works with devices that support synchronous input.

Parameters:
  • channel_descriptors – An array of DaqInChanDescriptor structs.
  • samples_per_channel – the number of samples to collect from each channel in the scan.
  • rate – Sample input rate in samples per second.
  • options – A bitmask that specifies scan options. Possible options are enumerated by ScanOption.
  • flags – A bitmask that specifies whether to scale and/or calibrate data. Possible options are enumerated by DaqInScanFlag.
  • data – The data buffer to receive the data being read.
Returns:

The actual input scan rate of the scan.

Raises:

ULException

get_scan_status()

Gets the current status of the synchronous input operation.

Returns:A tuple containing the scan status ScanStatus and transfer status TransferStatus for the daq input background operation.
Raises:ULException
scan_stop()

Stops the synchronous input operation currently running.

Raises:ULException
scan_wait(wait_type, timeout)

Waits until the scan operation completes or the specified timeout elapses.

Parameters:
  • wait_type – The WaitType.
  • timeout – The timeout value in seconds (s); set to -1 to wait indefinitely for the scan function to end.
Raises:

ULException

DaqiInfo class

Provides information about the capabilities of the DAQ input subsystem.

Methods

class uldaq.DaqiInfo(handle)

Provides information about the capabilities of the DAQ input subsystem.

Parameters:handle – UL DAQ Device handle.
Method Description
get_channel_types() Gets a bitmask of supported input channel types.
get_min_scan_rate() Gets the minimum scan rate in samples per second.
get_max_scan_rate() Gets the maximum scan rate in samples per second.
get_max_throughput() Gets the maximum throughput in samples per second.
get_fifo_size() Gets the FIFO size in bytes.
get_scan_options() Gets a bitmask of supported scan options.
get_trigger_types() Gets a bitmask of supported trigger types.
get_channel_types()

Gets the total number of A/D channels.

Returns:A bitmask of supported DaqInChanType objects
Raises:ULException
get_min_scan_rate()

Gets the minimum scan rate in samples per second.

Returns:The minimum scan rate in samples per second.
Raises:ULException
get_max_scan_rate()

Gets the maximum scan rate in samples per second.

Returns:The maximum scan rate in samples per second.
Raises:ULException
get_max_throughput()

Gets the maximum throughput in samples per second.

Returns:The maximum throughput in samples per second.
Raises:ULException
get_fifo_size()

Gets the FIFO size in bytes.

Returns:The FIFO size in bytes.
Raises:ULException
get_scan_options()

Gets a bitmask of supported scan options.

Returns:ScanOption
Raises:ULException
get_trigger_types()

Gets a bitmask of supported trigger types.

Returns:TriggerType
Raises:ULException

Daq Output Subsystem

The API provides classes to manage the DAQ output subsystem on a device:

DaqoDevice class

DAQ output subsystem of the UL DAQ Device.

Methods

class uldaq.DaqoDevice(handle)

DAQ output subsystem of the UL DAQ Device.

Parameters:handle – UL DAQ Device handle.
Method Description
get_info() Gets the DAQ output information object for the UL DAQ device.
set_trigger() Sets the DAQ output trigger source and parameters.
daq_out_scan() Outputs values synchronously to analog output channels and digital output ports.
get_scan_status() Gets the current status of the synchronous D/A operation.
scan_stop() Stops the synchronous output operation currently running.
get_info()

Gets the DAQ output information object for the UL DAQ Device.

Returns:DaqoInfo object used for retrieving for retrieving information about the DAQ output subsystem of the UL DAQ Device.
daq_out_scan(channel_descriptors, samples_per_channel, rate, options, flags, data)

Outputs values synchronously to analog output channels and digital output ports. This function only works with devices that support synchronous output.

Parameters:
  • channel_descriptors – An array of DaqOutChanDescriptor structs.
  • samples_per_channel – The number of samples per channel to output.
  • rate – The sample rate in scans per second.
  • options – A bitmask specifying scan options. Possible options are enumerated by ScanOption.
  • flags – A bitmask specifying whether to scale and/or calibrate data. Possible options are enumerated by DaqOutScanFlag.
  • data – The data buffer to be written.
Returns:

The actual output scan rate.

Raises:

ULException

get_scan_status()

Gets the current status of the synchronous output operation.

Returns:A tuple containing the ScanStatus and TransferStatus of the DAQ output background operation.
Raises:ULException
scan_stop()

Stops the synchronous output operation currently running.

Raises:ULException
scan_wait(wait_type, timeout)

Waits until the scan operation completes or the specified timeout elapses.

Parameters:
  • wait_type – The WaitType.
  • timeout – The timeout value in seconds (s); set to -1 to wait indefinitely for the scan function to end.
Raises:

ULException

set_trigger(trigger_type, channel, level, variance, retrigger_count)

Configures the trigger parameters that will be used when daq_out_scan() is called with the RETRIGGER or EXTTRIGGER ScanOption.

Parameters:
  • trigger_typeTriggerType
  • channel – A DaqOutChanDescriptor object.
  • level – The level at or around which the trigger event should be detected; ignored if trig_type is set to POS_EDGE, NEG_EDGE, HIGH, LOW, GATE_HIGH, GATE_LOW, RISING, or FALLING.
  • variance – The 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.
  • retrigger_count – The number of samples per trigger to acquire with each trigger event; ignored unless the RETRIGGER ScanOption is set for the scan.
Raises:

ULException

DaqiInfo class

Provides information about the capabilities of the DAQ output subsystem.

Methods

class uldaq.DaqoInfo(handle)

Provides information about the capabilities of the DAQ output subsystem.

Parameters:handle – UL DAQ Device handle.
Method Description
get_channel_types() Gets a bitmask of supported channel types.
get_min_scan_rate() Gets the minimum scan rate in samples per second.
get_max_scan_rate() Gets the maximum scan rate in samples per second.
get_max_throughput() Gets the maximum throughput in samples per second.
get_fifo_size() Gets the size of the FIFO for the DAQ output subsystem.
get_scan_options() Gets a bitmask of supported scan options.
get_trigger_types() Gets a bitmask of supported trigger types.
get_channel_types()

Gets a bitmask of supported channel types.

Returns:DaqOutChanType
Raises:ULException
get_min_scan_rate()

Gets the minimum scan rate in samples per second.

Returns:The minimum scan rate in samples per second.
Raises:ULException
get_max_scan_rate()

Gets the maximum scan rate in samples per second.

Returns:The maximum scan rate in samples per second.
Raises:ULException
get_max_throughput()

Gets the maximum throughput in samples per second.

Returns:The maximum throughput.
Raises:ULException
get_fifo_size()

Gets the FIFO size in bytes.

Returns:The FIFO size in bytes.
Raises:ULException
get_scan_options()

Gets a bitmask of supported scan options.

Returns:A list of supported ScanOption objects.
Raises:ULException
get_trigger_types()

Gets a bitmask of supported trigger types.

Returns:TriggerType
Raises:ULException