nidaqmx


Namenidaqmx JSON
Version 0.8.0 PyPI version JSON
download
home_pagehttps://github.com/ni/nidaqmx-python
SummaryNI-DAQmx Python API
upload_time2023-07-12 19:10:39
maintainerZach Hindes
docs_urlNone
authorNI
requires_python>=3.7,<4.0
licenseMIT
keywords nidaqmx nidaq daqmx daq
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 NI-DAQmx. See `GitHub <https://github.com/ni/nidaqmx-python/>`_ for the latest source.
Author       National Instruments
===========  =================================================================================================================================

About
=====

The **nidaqmx** package contains an API (Application Programming Interface)
for interacting with the NI-DAQmx driver. The package is implemented in Python.
The package is implemented as a complex, 
highly object-oriented wrapper around the NI-DAQmx C API using the 
`ctypes <https://docs.python.org/2/library/ctypes.html>`_ Python library.

**nidaqmx** supports all versions of the NI-DAQmx driver that ships with the C
API. The C API is included in any version of the driver that supports it. The
**nidaqmx** package does not require installation of the C header files.

Some functions in the **nidaqmx** package may be unavailable with earlier 
versions of the NI-DAQmx driver. Visit the 
`ni.com/downloads <http://www.ni.com/downloads/>`_ to upgrade your version of 
NI-DAQmx.

**nidaqmx** supports Windows and Linux operating systems where the NI-DAQmx
driver is supported. Refer to
`NI Hardware and Operating System Compatibility <https://www.ni.com/r/hw-support>`_
for which versions of the driver support your hardware on a given operating
system.

**nidaqmx** supports CPython 3.7+ and PyPy3.

Installation
============

Running **nidaqmx** requires NI-DAQmx to be installed. Visit
`ni.com/downloads <http://www.ni.com/downloads/>`_ to download the latest
version of NI-DAQmx. None of the recommended **Additional items** are required
for **nidaqmx** to function, and they can be removed to minimize installation
size. It is recommended you continue to install the **NI Certificates** package
to allow your Operating System to trust NI built binaries, improving your
software and hardware installation experience.

**nidaqmx** can be installed with `pip <http://pypi.python.org/pypi/pip>`_::

  $ python -m pip install nidaqmx

Similar Packages
================

There are similar packages available that also provide NI-DAQmx functionality in
Python:

- `daqmx <https://pypi.org/project/daqmx/>`_
  (`slightlynybbled/daqmx on GitHub <https://github.com/slightlynybbled/daqmx>`_)
  provides an abstraction of NI-DAQmx in the ``ni`` module.

- PyLibNIDAQmx (`pearu/pylibnidaqmx on GitHub <https://github.com/pearu/pylibnidaqmx>`_)
  provides an abstraction of NI-DAQmx in the ``nidaqmx`` module, which collides
  with this package's module name.

.. _usage-section:

Usage
=====
The following is a basic example of using an **nidaqmx.task.Task** object. 
This example illustrates how the single, dynamic **nidaqmx.task.Task.read** 
method returns the appropriate data type.

.. code-block:: python

  >>> import nidaqmx
  >>> with nidaqmx.Task() as task:
  ...     task.ai_channels.add_ai_voltage_chan("Dev1/ai0")
  ...     task.read()
  ...
  -0.07476920729381246
  >>> with nidaqmx.Task() as task:
  ...     task.ai_channels.add_ai_voltage_chan("Dev1/ai0")
  ...     task.read(number_of_samples_per_channel=2)
  ...
  [0.26001373311970705, 0.37796597238117036]
  >>> from nidaqmx.constants import LineGrouping
  >>> with nidaqmx.Task() as task:
  ...     task.di_channels.add_di_chan(
  ...         "cDAQ2Mod4/port0/line0:1", line_grouping=LineGrouping.CHAN_PER_LINE)
  ...     task.read(number_of_samples_per_channel=2)
  ...
  [[False, True], [True, True]]

A single, dynamic **nidaqmx.task.Task.write** method also exists.

.. code-block:: python

  >>> import nidaqmx
  >>> from nidaqmx.types import CtrTime
  >>> with nidaqmx.Task() as task:
  ...     task.co_channels.add_co_pulse_chan_time("Dev1/ctr0")
  ...     sample = CtrTime(high_time=0.001, low_time=0.001)
  ...     task.write(sample)
  ...
  1
  >>> with nidaqmx.Task() as task:
  ...     task.ao_channels.add_ao_voltage_chan("Dev1/ao0")
  ...     task.write([1.1, 2.2, 3.3, 4.4, 5.5], auto_start=True)
  ...
  5

Consider using the **nidaqmx.stream_readers** and **nidaqmx.stream_writers**
classes to increase the performance of your application, which accept pre-allocated
NumPy arrays.

Following is an example of using an **nidaqmx.system.System** object.

.. code-block:: python

  >>> import nidaqmx.system
  >>> system = nidaqmx.system.System.local()
  >>> system.driver_version
  DriverVersion(major_version=16L, minor_version=0L, update_version=0L)
  >>> for device in system.devices:
  ...     print(device)
  ...
  Device(name=Dev1)
  Device(name=Dev2)
  Device(name=cDAQ1)
  >>> import collections
  >>> isinstance(system.devices, collections.Sequence)
  True
  >>> device = system.devices['Dev1']
  >>> device == nidaqmx.system.Device('Dev1')
  True
  >>> isinstance(device.ai_physical_chans, collections.Sequence)
  True
  >>> phys_chan = device.ai_physical_chans['ai0']
  >>> phys_chan
  PhysicalChannel(name=Dev1/ai0)
  >>> phys_chan == nidaqmx.system.PhysicalChannel('Dev1/ai0')
  True
  >>> phys_chan.ai_term_cfgs
  [<TerminalConfiguration.RSE: 10083>, <TerminalConfiguration.NRSE: 10078>, <TerminalConfiguration.DIFFERENTIAL: 10106>]
  >>> from enum import Enum
  >>> isinstance(phys_chan.ai_term_cfgs[0], Enum)
  True

Bugs / Feature Requests
=======================

To report a bug or submit a feature request, please use the 
`GitHub issues page <https://github.com/ni/nidaqmx-python/issues>`_.

Information to Include When Asking for Help
-------------------------------------------

Please include **all** of the following information when opening an issue:

- Detailed steps on how to reproduce the problem and full traceback, if 
  applicable.
- The python version used::

  $ python -c "import sys; print(sys.version)"

- The versions of the **nidaqmx** and numpy packages used::

  $ python -m pip list

- The version of the NI-DAQmx driver used. Follow 
  `this KB article <http://digital.ni.com/express.nsf/bycode/ex8amn>`_ 
  to determine the version of NI-DAQmx you have installed.
- The operating system and version, for example Windows 7, CentOS 7.2, ...

Documentation
=============

Documentation is available `here <http://nidaqmx-python.readthedocs.io>`_.

Additional Documentation
========================

Refer to the `NI-DAQmx Help <http://digital.ni.com/express.nsf/bycode/exagg4>`_ 
for API-agnostic information about NI-DAQmx or measurement concepts.

NI-DAQmx Help installs only with the full version of NI-DAQmx.

License
=======

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ni/nidaqmx-python",
    "name": "nidaqmx",
    "maintainer": "Zach Hindes",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "zach.hindes@ni.com",
    "keywords": "nidaqmx,nidaq,daqmx,daq",
    "author": "NI",
    "author_email": "opensource@ni.com",
    "download_url": "https://files.pythonhosted.org/packages/27/36/e2bb05f2e769e09be5391585e5f01e3c0489d1b2b0c1d91614c485038bd9/nidaqmx-0.8.0.tar.gz",
    "platform": null,
    "description": "===========  =================================================================================================================================\nInfo         Contains a Python API for interacting with NI-DAQmx. See `GitHub <https://github.com/ni/nidaqmx-python/>`_ for the latest source.\nAuthor       National Instruments\n===========  =================================================================================================================================\n\nAbout\n=====\n\nThe **nidaqmx** package contains an API (Application Programming Interface)\nfor interacting with the NI-DAQmx driver. The package is implemented in Python.\nThe package is implemented as a complex, \nhighly object-oriented wrapper around the NI-DAQmx C API using the \n`ctypes <https://docs.python.org/2/library/ctypes.html>`_ Python library.\n\n**nidaqmx** supports all versions of the NI-DAQmx driver that ships with the C\nAPI. The C API is included in any version of the driver that supports it. The\n**nidaqmx** package does not require installation of the C header files.\n\nSome functions in the **nidaqmx** package may be unavailable with earlier \nversions of the NI-DAQmx driver. Visit the \n`ni.com/downloads <http://www.ni.com/downloads/>`_ to upgrade your version of \nNI-DAQmx.\n\n**nidaqmx** supports Windows and Linux operating systems where the NI-DAQmx\ndriver is supported. Refer to\n`NI Hardware and Operating System Compatibility <https://www.ni.com/r/hw-support>`_\nfor which versions of the driver support your hardware on a given operating\nsystem.\n\n**nidaqmx** supports CPython 3.7+ and PyPy3.\n\nInstallation\n============\n\nRunning **nidaqmx** requires NI-DAQmx to be installed. Visit\n`ni.com/downloads <http://www.ni.com/downloads/>`_ to download the latest\nversion of NI-DAQmx. None of the recommended **Additional items** are required\nfor **nidaqmx** to function, and they can be removed to minimize installation\nsize. It is recommended you continue to install the **NI Certificates** package\nto allow your Operating System to trust NI built binaries, improving your\nsoftware and hardware installation experience.\n\n**nidaqmx** can be installed with `pip <http://pypi.python.org/pypi/pip>`_::\n\n  $ python -m pip install nidaqmx\n\nSimilar Packages\n================\n\nThere are similar packages available that also provide NI-DAQmx functionality in\nPython:\n\n- `daqmx <https://pypi.org/project/daqmx/>`_\n  (`slightlynybbled/daqmx on GitHub <https://github.com/slightlynybbled/daqmx>`_)\n  provides an abstraction of NI-DAQmx in the ``ni`` module.\n\n- PyLibNIDAQmx (`pearu/pylibnidaqmx on GitHub <https://github.com/pearu/pylibnidaqmx>`_)\n  provides an abstraction of NI-DAQmx in the ``nidaqmx`` module, which collides\n  with this package's module name.\n\n.. _usage-section:\n\nUsage\n=====\nThe following is a basic example of using an **nidaqmx.task.Task** object. \nThis example illustrates how the single, dynamic **nidaqmx.task.Task.read** \nmethod returns the appropriate data type.\n\n.. code-block:: python\n\n  >>> import nidaqmx\n  >>> with nidaqmx.Task() as task:\n  ...     task.ai_channels.add_ai_voltage_chan(\"Dev1/ai0\")\n  ...     task.read()\n  ...\n  -0.07476920729381246\n  >>> with nidaqmx.Task() as task:\n  ...     task.ai_channels.add_ai_voltage_chan(\"Dev1/ai0\")\n  ...     task.read(number_of_samples_per_channel=2)\n  ...\n  [0.26001373311970705, 0.37796597238117036]\n  >>> from nidaqmx.constants import LineGrouping\n  >>> with nidaqmx.Task() as task:\n  ...     task.di_channels.add_di_chan(\n  ...         \"cDAQ2Mod4/port0/line0:1\", line_grouping=LineGrouping.CHAN_PER_LINE)\n  ...     task.read(number_of_samples_per_channel=2)\n  ...\n  [[False, True], [True, True]]\n\nA single, dynamic **nidaqmx.task.Task.write** method also exists.\n\n.. code-block:: python\n\n  >>> import nidaqmx\n  >>> from nidaqmx.types import CtrTime\n  >>> with nidaqmx.Task() as task:\n  ...     task.co_channels.add_co_pulse_chan_time(\"Dev1/ctr0\")\n  ...     sample = CtrTime(high_time=0.001, low_time=0.001)\n  ...     task.write(sample)\n  ...\n  1\n  >>> with nidaqmx.Task() as task:\n  ...     task.ao_channels.add_ao_voltage_chan(\"Dev1/ao0\")\n  ...     task.write([1.1, 2.2, 3.3, 4.4, 5.5], auto_start=True)\n  ...\n  5\n\nConsider using the **nidaqmx.stream_readers** and **nidaqmx.stream_writers**\nclasses to increase the performance of your application, which accept pre-allocated\nNumPy arrays.\n\nFollowing is an example of using an **nidaqmx.system.System** object.\n\n.. code-block:: python\n\n  >>> import nidaqmx.system\n  >>> system = nidaqmx.system.System.local()\n  >>> system.driver_version\n  DriverVersion(major_version=16L, minor_version=0L, update_version=0L)\n  >>> for device in system.devices:\n  ...     print(device)\n  ...\n  Device(name=Dev1)\n  Device(name=Dev2)\n  Device(name=cDAQ1)\n  >>> import collections\n  >>> isinstance(system.devices, collections.Sequence)\n  True\n  >>> device = system.devices['Dev1']\n  >>> device == nidaqmx.system.Device('Dev1')\n  True\n  >>> isinstance(device.ai_physical_chans, collections.Sequence)\n  True\n  >>> phys_chan = device.ai_physical_chans['ai0']\n  >>> phys_chan\n  PhysicalChannel(name=Dev1/ai0)\n  >>> phys_chan == nidaqmx.system.PhysicalChannel('Dev1/ai0')\n  True\n  >>> phys_chan.ai_term_cfgs\n  [<TerminalConfiguration.RSE: 10083>, <TerminalConfiguration.NRSE: 10078>, <TerminalConfiguration.DIFFERENTIAL: 10106>]\n  >>> from enum import Enum\n  >>> isinstance(phys_chan.ai_term_cfgs[0], Enum)\n  True\n\nBugs / Feature Requests\n=======================\n\nTo report a bug or submit a feature request, please use the \n`GitHub issues page <https://github.com/ni/nidaqmx-python/issues>`_.\n\nInformation to Include When Asking for Help\n-------------------------------------------\n\nPlease include **all** of the following information when opening an issue:\n\n- Detailed steps on how to reproduce the problem and full traceback, if \n  applicable.\n- The python version used::\n\n  $ python -c \"import sys; print(sys.version)\"\n\n- The versions of the **nidaqmx** and numpy packages used::\n\n  $ python -m pip list\n\n- The version of the NI-DAQmx driver used. Follow \n  `this KB article <http://digital.ni.com/express.nsf/bycode/ex8amn>`_ \n  to determine the version of NI-DAQmx you have installed.\n- The operating system and version, for example Windows 7, CentOS 7.2, ...\n\nDocumentation\n=============\n\nDocumentation is available `here <http://nidaqmx-python.readthedocs.io>`_.\n\nAdditional Documentation\n========================\n\nRefer to the `NI-DAQmx Help <http://digital.ni.com/express.nsf/bycode/exagg4>`_ \nfor API-agnostic information about NI-DAQmx or measurement concepts.\n\nNI-DAQmx Help installs only with the full version of NI-DAQmx.\n\nLicense\n=======\n\n**nidaqmx** is licensed under an MIT-style license (see\n`LICENSE <https://github.com/ni/nidaqmx-python/blob/master/LICENSE>`_).\nOther incorporated projects may be licensed under different licenses. All\nlicenses allow for non-commercial and commercial use.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "NI-DAQmx Python API",
    "version": "0.8.0",
    "project_urls": {
        "Documentation": "https://nidaqmx-python.readthedocs.io",
        "Homepage": "https://github.com/ni/nidaqmx-python",
        "Repository": "https://github.com/ni/nidaqmx-python"
    },
    "split_keywords": [
        "nidaqmx",
        "nidaq",
        "daqmx",
        "daq"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b301106891ff13a11d26c42cb417ba5e75e35ea8dfcc41faee8610535d7a1e6b",
                "md5": "cb3e48d54baa75aad6909c986f6a903d",
                "sha256": "7a5d5b3f78c125d31a8d00349f216f63bb8f6b887d0eca882001b729904d68bc"
            },
            "downloads": -1,
            "filename": "nidaqmx-0.8.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cb3e48d54baa75aad6909c986f6a903d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 470910,
            "upload_time": "2023-07-12T19:10:36",
            "upload_time_iso_8601": "2023-07-12T19:10:36.826209Z",
            "url": "https://files.pythonhosted.org/packages/b3/01/106891ff13a11d26c42cb417ba5e75e35ea8dfcc41faee8610535d7a1e6b/nidaqmx-0.8.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2736e2bb05f2e769e09be5391585e5f01e3c0489d1b2b0c1d91614c485038bd9",
                "md5": "df0f384ce889982f55fa5b988025e288",
                "sha256": "6c72ca4ec5da95e8603c1e6d5085d59bb3c1c2ea1f45bdfaa4acac40fe82ae0c"
            },
            "downloads": -1,
            "filename": "nidaqmx-0.8.0.tar.gz",
            "has_sig": false,
            "md5_digest": "df0f384ce889982f55fa5b988025e288",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 430054,
            "upload_time": "2023-07-12T19:10:39",
            "upload_time_iso_8601": "2023-07-12T19:10:39.552994Z",
            "url": "https://files.pythonhosted.org/packages/27/36/e2bb05f2e769e09be5391585e5f01e3c0489d1b2b0c1d91614c485038bd9/nidaqmx-0.8.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-12 19:10:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ni",
    "github_project": "nidaqmx-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "nidaqmx"
}
        
NI
Elapsed time: 0.08693s