The Python API for Linux allows users to access and control supported Measurement Computing hardware using the Python language over the Linux platform. Python 2.7 and 3.4+ are supported.

The Python package name is uldaq. The uldaq package is implemented in Python as an interface to the UL shared object library.

The UL for Linux API provides structures and enumerations to manage connected devices, obtain information about device capabilities, and configure hardware settings.


For performance reasons, data is returned in the Python API as arrays instead of lists.

The uldaq package is available on GitHub.


Refer to the README file for information about how to download the UL for Linux package and install the API.

Creating a Python program

When creating a UL for Linux program in Python, import the uldaq package to use in your code: import uldaq

Refer to the example programs and the API documentation in the Python API Reference for more information.

Example programs

UL for Linux example programs are available to run with MCC hardware. Refer to the README file for information about how to download and extract the examples.

Connect a supported Measurement Computing DAQ device to your system before running an example. Complete these steps to run a UL for Linux example:

  1. Open a terminal window in the UL for Linux examples folder directory.

  2. Enter ./ For example, enter ./ to run the analog input example.

Users can also choose to import the example code into an IDE, such as PyCharm or Eclipse, and run the examples from that environment.

The example download file includes the following example programs:




Reads an A/D input channel. Demonstrates a_in().


Scans a range of A/D input channels, and stores the data in an array. Demonstrates a_in_scan() and scan_stop().


Performs an A/D scan using events to determine the data in an array. Demonstrates when data is available or when the acquisition is complete. The example also demonstrates how to retrieve the data when it becomes available. Demonstrates enable_event(), scan_wait() and scan_stop().


Creates a queue that sets individual channel ranges for an A/D scan. Demonstrates a_in_load_queue(), a_in_scan(), and scan_stop().


Scans a range of A/D channels when a trigger is received, and stores the data in an array. This example shows how to obtain and configure trigger options. Demonstrates a_in_scan() and scan_stop().


Enables IEPE mode for a range of A/D channels, and scans the specified A/D channels. Demonstrates a_in_scan() and scan_stop().


Writes a specified value to a D/A output channel. Demonstrates a_out().


Performs a D/A scan. Data can be viewed with an oscilloscope or meter. Demonstrates a_out_scan() and scan_stop().


Sets the initial value of a counter and counts events. Demonstrates c_in() and c_clear().


Scans a range of counter channels. Demonstrates c_in_scan(), c_load() and scan_stop().


Scans a range of encoder channels. Demonstrates c_in_scan(), c_config_scan(), and scan_stop().


Simultaneously acquires analog, digital, and counter data. Demonstrates daq_in_scan() and scan_stop().


Sets up a trigger function, and simultaneously acquires analog, digital, and counter data when the trigger is received. Demonstrates daq_in_scan() and scan_stop().


Simultaneously outputs analog and digital data. Demonstrates daq_out_scan() and scan_stop().


Configures multiple digital bits for input, and reads the bit values. Demonstrates d_config_bit() and d_bit_in().


Writes a specified value to multiple digital output bits. Demonstrates d_config_bit() and d_bit_out().


Configures a port for input and reads the port value. Demonstrates d_config_port() and d_in().


Configures a port for input and continuously reads it. Demonstrates d_config_port(), d_in_scan(), and d_in_scan_stop().


Configures a port for output and writes a specified value. Demonstrates d_config_port() and d_out().


Configures the port direction and outputs digital data. Demonstrates d_config_port(), d_out_scan(), and d_out_scan_stop().


Discovers remote Ethernet DAQ devices. Demonstrates get_net_daq_device_descriptor().


Reads a temperature channel. Demonstrates t_in().


Generates an output pulse at a specified duty cycle and frequency. Demonstrates pulse_out_start() and pulse_out_stop().

Supported hardware

Refer to the Hardware Reference section for a list of all supported Measurement Computing devices with links to supported UL for Linux capabilities.


Measurement Computing Corporation
Technical Support: