Introduction

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

The Python package name is ulwd. The ulwd 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.

Note

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

The ulwd package is available on GitHub.

Installation

Refer to the README for information about how to download the UL for Linux for WebDAQ 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 ulwd

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

Example programs

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

Connect a supported Measurement Computing WebDAQ 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 ~/libulwd/examples folder.
  2. Enter ./file_name.py. For example, enter ./a_in_scan.py to run the analog input scan 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:

Method Description
a_in_scan Scans a range of A/D input channels, and stores the data in an array. Demonstrates a_in_scan() and scan_stop().
a_in_scan_iepe Scans a range of IEPE input channels, and stores the data in an array. Demonstrates set_chan_iepe_mode() and set_chan_sensor_sensitivity().

Support

Measurement Computing Corporation
508-946-5100
Technical Support: www.mccdaq.com/support
Knowledgebase: kb.mccdaq.com