Skip to main content
Files added late

2 files were added to this release more than 14 days after its initial publication. Inspect the release files before installing.

PyUniversalLibrary is a Python wrapper for Measurement Computing’s Universal Library for data acquisition on Microsoft Windows operating systems.

This document is both the webpage for PyUniversalLibrary and the README.txt file (distributed with the source code of PyUniversalLibrary). It is in reStructuredText format.

Work in Progress

Currently PyUniversalLibrary is incomplete. I have so far wrapped analog I/O, digital I/O, and temperature functions. Some of these I have not personally needed, so please be aware of potential bugs. If you need more functionality, you will hopefully find that the start I have made in wrapping this library useful. I welcome your changes and additions. I will include them with the next release with appropriate credit.

Release 20061020

Current version

Rewrote as a pure-Python implementation, which uses ctypes and numpy (new requirements). There is no longer a requirement on Numeric, and this should work with any reasonably backwards-compatible future versions of Python, ctypes, and numpy. The analog output examples were changed to work on USB PMD-1208FS devices.

Release 20050624

Lots of Universal Library is now covered, including all analog I/O, digital I/O, and temperature input functions.

Release 20050623

First public release.

Also of interest

Various Python wrappers for data acquisition are available. Here are a few I know of:

Installation and Download

You must download and install InstaCal from Measurement Computing. This contains the various libraries needed to access your hardware.

You must have Python installed.

You must have ctypes installed (this is included with Python 2.5), but can be downloaded for older versions of Python.

You must have numpy installed.

Download PyUniversalLibrary: Grab a binary installer or the source code from the download directory.

To get the examples, download the source code. You can still install the binaries.

Optional

If you intend make significant use of PyUniversalLibrary, I suggest you buy Universal Library C API. It costs $50 and includes extensive documentation and example code.

Examples

Here is ulai01.py from the example directory. It is a direct translation of the essentials of ulai01.c, included with Universal Library. Error checking occurs automatically through Python exceptions.

import UniversalLibrary as UL

BoardNum = 0
Gain = UL.BIP5VOLTS
Chan = 0

while 1:
    DataValue = UL.cbAIn(BoardNum, Chan, Gain)
    EngUnits = UL.cbToEngUnits(BoardNum, Gain, DataValue)

    print DataValue, EngUnits

Further examples are included, including a simple wxPython/matplotlib based oscilloscope.

Usage notes

Naming conventions

‘PyUL’ is used here to mean the UniversalLibray Python module. Because UniversalLibrary is cumbersome to type, the example programs actually use “import UniversalLibrary as UL”.

PyUniversalLibrary endeavors to keep function signatures identical to the C API. These sometimes result in non-Pythonic quirks: some arguments to a function have no effect on that function because in C they are output variables. In these cases, they are returned as outputs from the function.

Error handling

The PyUL checks for errors upon every call and raises a UniversalLibraryError if an error was encountered. Instances of UniversalLibraryError have an errno attribute which can be converted to a string with a call to _get_error_message(errno).

Initialization

The short story is that importing PyUL (“import UniversalLibrary”) will do all initialization necessary.

The long story is that C programs call the cbDeclareRevision() and cbErrHandling() functions upon initialization. PyUL calls cbDeclareRevision() automatically, and calling cbErrHandling() is not needed because the default state DONTPRINT, DONTSTOP, which is exactly what PyUL expects, because PyUL checks all the error codes anyhow.

License

BSD license. See the file LICENSE.txt distributed with the source code.

Owner: California Institute of Technology Author: Andrew Straw

Metadata

Release files for PyUniversalLibrary 20061020

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Files added late

2 files were uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for PyUniversalLibrary 20061020
File Size Uploaded
PyUniversalLibrary-20061020.zip 34.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyUniversalLibrary 20061020
File Interpreter ABI Platform
PyUniversalLibrary-20061020.win32.exe Details

Total release size: 109.3 kB

Release files / PyUniversalLibrary-20061020.zip

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL PyUniversalLibrary-20061020.zip
Size 34.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5053cadb396faa9d7cf7b1bf6ba04463036a52769f6781c0cc31734eba94a559
BLAKE2b-256 checksum
How to use checksums
df916fbdda3a795c71ca22f9ad471db58343101d7bbd7c079ff87445abbc2cdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / PyUniversalLibrary-20061020.win32.exe

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL PyUniversalLibrary-20061020.win32.exe
Size 75.0 kB
Tags Source
SHA-256 checksum
How to use checksums
632a9d4fd181e74bec9c8b2d3fede33d701df7f38be7869377edf55f72d9751f
BLAKE2b-256 checksum
How to use checksums
a4a6789b44f2c753c331b127dc21e4a02255d433b1e6e204913c786b57a615fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

20061020 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page