uldaq


Nameuldaq JSON
Version 0.0.1b0 PyPI version JSON
download
home_pagehttp://www.mccdaq.com
SummaryUniversal Library Python API for Measurement Computing DAQ devices
upload_time2018-04-16 14:38:41
maintainer
docs_urlNone
authorMeasurement Computing
requires_python
licenseMIT
keywords uldaq mcc ul daq data acquisition
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===========  ===============================================================================================
Info         Contains a Python API for interacting with Measurement Computing's Universal Library for Linux.
Author       Measurement Computing
===========  ===============================================================================================

About
=====
The **uldaq** Python package contains an API (Application Programming Interface)
for interacting with Measurement Computing DAQ devices. The package is implemented
as an object-oriented wrapper around the UL for Linux C API using the `ctypes <https://docs.python.org/2/library/ctypes.html>`_ Python library.

**uldaq** supports CPython 2.7, 3.4+

Installation
============
Running the **uldaq** Python API requires the UL for Linux C API. Visit `uldaq <https://github.com/sbazaz/uldaq/>`_
to download the latest version of the UL for Linux C API.

The **uldaq** Python API can be installed with `pip <http://pypi.python.org/pypi/pip>`_::

  $ python -m pip install uldaq

You also can download the project source and run::

  $ python setup.py install

.. _usage-section:

Usage
=====
The following is a simple example for reading a single voltage value from each channel in
an analog input subsystem of a Measurement Computing DAQ device.

.. code-block:: python

  from uldaq import get_daq_device_inventory, DaqDevice, InterfaceType, AiInputMode, Range, AInFlag

  try:
      # Get a list of available devices
      devices = get_daq_device_inventory(InterfaceType.USB)
      # Create a DaqDevice Object
      daq_device = DaqDevice(devices[0])
      # Connect to the device
      daq_device.connect()
      # Create AiDevice and AiInfo objects for the analog input subsystem
      ai_device = daq_device.get_ai_device()
      ai_info = ai_device.get_info()

      # Loop through all analog input channels
      for channel in range(ai_info.get_num_chans()):
          # Get the voltage value for each channel and display the result
          data = ai_device.a_in(channel, AiInputMode.SINGLE_ENDED, Range.BIP10VOLTS, AInFlag.DEFAULT)
          print('Channel', channel, 'Data:', data)

      # Disconnect from the device and free the resource
      daq_device.disconnect()
      daq_device.release()

  except ULException as e:
      # Display any error messages
      print('\n', e)

The same example using a with block:

.. code-block:: python

  from uldaq import get_daq_device_inventory, DaqDevice, InterfaceType, AiInputMode, Range, AInFlag

  try:
      # Get a list of available devices
      devices = get_daq_device_inventory(InterfaceType.USB)
      # Create a DaqDevice Object and connect to the device
      with DaqDevice(devices[0]) as daq_device:
          # Create AiDevice and AiInfo objects for the analog input subsystem
          ai_device = daq_device.get_ai_device()
          ai_info = ai_device.get_info()

          # Loop through all analog input channels
          for channel in range(ai_info.get_num_chans()):
              # Get the voltage value for each channel and display the result
              data = ai_device.a_in(channel, AiInputMode.SINGLE_ENDED, Range.BIP10VOLTS, AInFlag.DEFAULT)
              print('Channel', channel, 'Data:', data)

  except ULException as e:
      # Display any error messages
      print('\n', e)

Additional Documentation
========================
The complete **uldaq** Python documentation can be found `here <http://www.mccdaq.com>`_.

License
=======
The **uldaq** library is licensed under an MIT-style license (see `LICENSE <https://github.com/sbazaz/uldaq/blob/master/LICENSE>`_).
Other incorporated projects may be licensed under different licenses. All
licenses allow for non-commercial and commercial use.



            

Raw data

            {
    "maintainer": "", 
    "docs_url": null, 
    "requires_python": "", 
    "maintainer_email": "", 
    "cheesecake_code_kwalitee_id": null, 
    "keywords": "uldaq,mcc,ul,daq,data,acquisition", 
    "upload_time": "2018-04-16 14:38:41", 
    "author": "Measurement Computing", 
    "home_page": "http://www.mccdaq.com", 
    "download_url": "https://pypi.python.org/packages/12/72/d58727a111f8cb59abdad4e243d91c03820cc6869140dc6a8549aa7ec0a0/uldaq-0.0.1b0.tar.gz", 
    "platform": "", 
    "version": "0.0.1b0", 
    "cheesecake_documentation_id": null, 
    "description": "===========  ===============================================================================================\nInfo         Contains a Python API for interacting with Measurement Computing's Universal Library for Linux.\nAuthor       Measurement Computing\n===========  ===============================================================================================\n\nAbout\n=====\nThe **uldaq** Python package contains an API (Application Programming Interface)\nfor interacting with Measurement Computing DAQ devices. The package is implemented\nas an object-oriented wrapper around the UL for Linux C API using the `ctypes <https://docs.python.org/2/library/ctypes.html>`_ Python library.\n\n**uldaq** supports CPython 2.7, 3.4+\n\nInstallation\n============\nRunning the **uldaq** Python API requires the UL for Linux C API. Visit `uldaq <https://github.com/sbazaz/uldaq/>`_\nto download the latest version of the UL for Linux C API.\n\nThe **uldaq** Python API can be installed with `pip <http://pypi.python.org/pypi/pip>`_::\n\n  $ python -m pip install uldaq\n\nYou also can download the project source and run::\n\n  $ python setup.py install\n\n.. _usage-section:\n\nUsage\n=====\nThe following is a simple example for reading a single voltage value from each channel in\nan analog input subsystem of a Measurement Computing DAQ device.\n\n.. code-block:: python\n\n  from uldaq import get_daq_device_inventory, DaqDevice, InterfaceType, AiInputMode, Range, AInFlag\n\n  try:\n      # Get a list of available devices\n      devices = get_daq_device_inventory(InterfaceType.USB)\n      # Create a DaqDevice Object\n      daq_device = DaqDevice(devices[0])\n      # Connect to the device\n      daq_device.connect()\n      # Create AiDevice and AiInfo objects for the analog input subsystem\n      ai_device = daq_device.get_ai_device()\n      ai_info = ai_device.get_info()\n\n      # Loop through all analog input channels\n      for channel in range(ai_info.get_num_chans()):\n          # Get the voltage value for each channel and display the result\n          data = ai_device.a_in(channel, AiInputMode.SINGLE_ENDED, Range.BIP10VOLTS, AInFlag.DEFAULT)\n          print('Channel', channel, 'Data:', data)\n\n      # Disconnect from the device and free the resource\n      daq_device.disconnect()\n      daq_device.release()\n\n  except ULException as e:\n      # Display any error messages\n      print('\\n', e)\n\nThe same example using a with block:\n\n.. code-block:: python\n\n  from uldaq import get_daq_device_inventory, DaqDevice, InterfaceType, AiInputMode, Range, AInFlag\n\n  try:\n      # Get a list of available devices\n      devices = get_daq_device_inventory(InterfaceType.USB)\n      # Create a DaqDevice Object and connect to the device\n      with DaqDevice(devices[0]) as daq_device:\n          # Create AiDevice and AiInfo objects for the analog input subsystem\n          ai_device = daq_device.get_ai_device()\n          ai_info = ai_device.get_info()\n\n          # Loop through all analog input channels\n          for channel in range(ai_info.get_num_chans()):\n              # Get the voltage value for each channel and display the result\n              data = ai_device.a_in(channel, AiInputMode.SINGLE_ENDED, Range.BIP10VOLTS, AInFlag.DEFAULT)\n              print('Channel', channel, 'Data:', data)\n\n  except ULException as e:\n      # Display any error messages\n      print('\\n', e)\n\nAdditional Documentation\n========================\nThe complete **uldaq** Python documentation can be found `here <http://www.mccdaq.com>`_.\n\nLicense\n=======\nThe **uldaq** library is licensed under an MIT-style license (see `LICENSE <https://github.com/sbazaz/uldaq/blob/master/LICENSE>`_).\nOther incorporated projects may be licensed under different licenses. All\nlicenses allow for non-commercial and commercial use.\n\n\n", 
    "lcname": "uldaq", 
    "bugtrack_url": null, 
    "github": false, 
    "name": "uldaq", 
    "license": "MIT", 
    "summary": "Universal Library Python API for Measurement Computing DAQ devices", 
    "split_keywords": [
        "uldaq", 
        "mcc", 
        "ul", 
        "daq", 
        "data", 
        "acquisition"
    ], 
    "author_email": "info@mccdaq.com", 
    "urls": [
        {
            "has_sig": false, 
            "upload_time": "2018-04-16T14:38:40", 
            "comment_text": "", 
            "python_version": "py2", 
            "url": "https://pypi.python.org/packages/f2/ad/40c62fbc87b2119f3c22227b4b99c476fb1695465492dd7a374ecd60d54f/uldaq-0.0.1b0-py2-none-any.whl", 
            "md5_digest": "ad4acdc3beea092820d64c4d061f54b2", 
            "downloads": 0, 
            "filename": "uldaq-0.0.1b0-py2-none-any.whl", 
            "packagetype": "bdist_wheel", 
            "path": "f2/ad/40c62fbc87b2119f3c22227b4b99c476fb1695465492dd7a374ecd60d54f/uldaq-0.0.1b0-py2-none-any.whl", 
            "digests": {
                "sha256": "1591e1cdfafd5d0963a8dbe954451dd9e0f97c73ac4dc711c43ac41a6389b627", 
                "md5": "ad4acdc3beea092820d64c4d061f54b2"
            }, 
            "sha256_digest": "1591e1cdfafd5d0963a8dbe954451dd9e0f97c73ac4dc711c43ac41a6389b627", 
            "size": 60146
        }, 
        {
            "has_sig": false, 
            "upload_time": "2018-04-16T14:38:41", 
            "comment_text": "", 
            "python_version": "source", 
            "url": "https://pypi.python.org/packages/12/72/d58727a111f8cb59abdad4e243d91c03820cc6869140dc6a8549aa7ec0a0/uldaq-0.0.1b0.tar.gz", 
            "md5_digest": "39bae22b336df1243eb8c637428ad975", 
            "downloads": 0, 
            "filename": "uldaq-0.0.1b0.tar.gz", 
            "packagetype": "sdist", 
            "path": "12/72/d58727a111f8cb59abdad4e243d91c03820cc6869140dc6a8549aa7ec0a0/uldaq-0.0.1b0.tar.gz", 
            "digests": {
                "sha256": "ffe9934145326a877b484856aa41d5ddfd3154af97a8ec7a0bc1dcac5a6c4c1e", 
                "md5": "39bae22b336df1243eb8c637428ad975"
            }, 
            "sha256_digest": "ffe9934145326a877b484856aa41d5ddfd3154af97a8ec7a0bc1dcac5a6c4c1e", 
            "size": 47990
        }
    ], 
    "_id": null, 
    "cheesecake_installability_id": null
}