Skip to main content

MCC Universal Library Python API for Windows

Project description

Info

Contains a Python API for interacting with Measurement Computing’s Universal Library in Windows. See GitHub for the latest source.

Author

Measurement Computing

About

The mcculw package contains an API (Application Programming Interface) for interacting with the I/O Library for Measurement Computing Data Acquisition products, Universal Library. This package was created and is supported by MCC. The package is implemented in Python as a wrapper around the Universal Library C API using the ctypes Python Library.

Note: The mcculw examples included in version 1.0.0 and later are not backward compatible with pre-release versions of the mcculw Python package. See the Examples section for more details.

mcculw is supported for Universal Library 6.55 and later. Some functions in the mcculw package may be unavailable with earlier versions of Universal Library. Visit http://www.mccdaq.com/Software-Downloads.aspx to upgrade your version of UL.

mcculw supports only the Windows operating system.

mcculw supports CPython 2.7 and 3.4+.

The mcculw package is available on GitHub and PyPI.

Installation

  1. Install Python version 2.7, 3.4, or later from https://www.python.org/downloads/ .

  2. Install the latest version of InstaCal from http://www.mccdaq.com/Software-Downloads.aspx .

  3. Install the the MCC UL Python API for Windows (mcculw) and any dependencies using pip:

    1. Open the Windows command prompt: press Win+R, type cmd.exe and press Enter.

    2. Upgrade pip to the latest version by entering the following command:

      pip install --upgrade pip
    3. Install the mcculw library by entering the following command:

      pip install mcculw

    Note: If you get a message like “pip is not recognized as an internal or external command…”, or if you have multiple Python installations, enter the full path to the pip executable, such as C:\Python27\Scripts\pip install –upgrade pip or C:\Python27\Scripts\pip install mcculw. The pip command is in the Scripts subdirectory of your Python install location.

Examples

Download the examples zip file from the mcculw GitHub repository.

Unzip the examples to a known location, such as:

C:\Users\Public\Documents\Measurement Computing\DAQ\Python

Refer to the knowledgebase article Importing Python for Windows example programs into an IDE for detailed instructions on how to import examples into popular IDEs such as Eclipse and Visual Studio.

Note: The latest examples take advantage of the mcculw.device_info subpackage added in version 1.0.0. Software developed using the props subpackage included in the examples folder of pre-release versions will continue to work with version 1.0.0 and later of the mcculw Python package, but requires the inclusion of the props subdirectory. See the mcculw GitHub Releases page for a complete archive of previous releases.

Usage

The following is a basic example of using the Universal Library to perform analog input. Further examples may be found on GitHub.

from mcculw import ul
from mcculw.enums import ULRange
from mcculw.ul import ULError

board_num = 0
channel = 0
ai_range = ULRange.BIP5VOLTS

try:
    # Get a value from the device
    value = ul.a_in(board_num, channel, ai_range)
    # Convert the raw value to engineering units
    eng_units_value = ul.to_eng_units(board_num, ai_range, value)

    # Display the raw value
    print("Raw Value: " + str(value))
    # Display the engineering value
    print("Engineering Value: " + '{:.3f}'.format(eng_units_value))
except ULError as e:
    # Display the error
    print("A UL error occurred. Code: " + str(e.errorcode)
          + " Message: " + e.message)

Support/Feedback

The mcculw package is supported by MCC. For support for mcculw, contact technical support through http://www.mccdaq.com/Support.aspx . Please include version information for Python, Universal Library and the mcculw packages used as well as detailed steps on how to reproduce the problem in your request.

Bugs/Feature Requests

To report a bug or submit a feature request, please use the mcculw GitHub Issues page.

Documentation

Documentation is available in the Universal Library Help.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcculw-1.0.0.tar.gz (86.0 kB view details)

Uploaded Source

Built Distribution

mcculw-1.0.0-py2.py3-none-any.whl (89.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mcculw-1.0.0.tar.gz.

File metadata

  • Download URL: mcculw-1.0.0.tar.gz
  • Upload date:
  • Size: 86.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.0

File hashes

Hashes for mcculw-1.0.0.tar.gz
Algorithm Hash digest
SHA256 233e0146798c184c02250ed2a9518642c924c09da4b826ba0014244e76198665
MD5 caacdb8468806fb0af0caa40ff9969ae
BLAKE2b-256 ceb66660584a8b05f9325114949eae71778dc4abcee1b544e147cf1a3a64ec82

See more details on using hashes here.

File details

Details for the file mcculw-1.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: mcculw-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 89.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.0

File hashes

Hashes for mcculw-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2c7f97b6f5a498c1543f784b0a6813fcd762d3de253a98b7eedf931a8b7af6cd
MD5 1293a2098adc7edaf562bc0ef29ce684
BLAKE2b-256 b9d6f296a574d444a28038db26b4b30c130412ccfb7cb32c39e2b5dc7819fe22

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page