• Stars
    star
    432
  • Rank 100,650 (Top 2 %)
  • Language
    Python
  • License
    Other
  • Created almost 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Python API for interacting with NI-DAQmx
Info Contains a Python API for interacting with NI-DAQmx. See GitHub 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 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 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 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 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:

$ python -m pip install nidaqmx

Similar Packages

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

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.

>>> 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.

>>> 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.

>>> 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.

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 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.

Additional Documentation

Refer to the NI-DAQmx Help 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). Other incorporated projects may be licensed under different licenses. All licenses allow for non-commercial and commercial use.

More Repositories

1

python_labview_automation

Python
154
star
2

nimi-python

Python bindings for NI Modular Instrument drivers.
Python
110
star
3

webvi-examples

Examples of WebVI functionality in G Web Development Software
HTML
91
star
4

grpc-labview

gRPC client and server support for LabVIEW
LabVIEW
82
star
5

linux

Linux kernel source for NI Linux Real-Time
C
70
star
6

nilrt

Tools to build NI Linux RT distribution.
Python
68
star
7

grpc-device

gRPC server providing remote access to NI device driver APIs.
C++
68
star
8

nifpga-python

Python API for LabVIEW FPGA devices
Python
64
star
9

usb3vision

Driver for USB3 Vision(TM) class devices
C
56
star
10

VireoSDK

Compact runtime for a subset of LabVIEW
C++
48
star
11

csharp-styleguide

NI's internal and external C# coding conventions, analyzers and tooling.
C#
41
star
12

FINALE

FINALE Is Not A LabVIEW Editor
TypeScript
32
star
13

nimble

The NI Nimble Design System
TypeScript
29
star
14

nidevlabs

Documentation and examples for extending NI Software
C#
23
star
15

nixnet-python

NI-XNET Python API
Python
22
star
16

NI-ns3-ApplicationExample

This is an implementation of an API to interface ns-3 network simulator to NI software defined radios for 802.11 and LTE.
Python
22
star
17

measurement-plugin-python

Python framework to develop measurement plug-ins for NI application software. Contains sample measurement plug-ins for InstrumentStudio and TestStand.
Python
19
star
18

labview-memory-management-tools

LabVIEW
18
star
19

niveristand-custom-device-build-tools

Tools for automating builds of NI VeriStand custom devices.
LabVIEW
17
star
20

niveristand-custom-device-development-tools

LabVIEW VIs providing common functionality used by multiple VeriStand custom devices.
LabVIEW
17
star
21

python-styleguide

NI's internal and external Python linter rules, plugins, and tooling.
Python
17
star
22

niveristand-scan-engine-ethercat-custom-device

Provides NI Scan Engine, EtherCAT and Remote IO support for NI VeriStand
LabVIEW
16
star
23

systemlink-OpenAPI-documents

16
star
24

niveristand-python

Python
16
star
25

meta-nilrt

Yocto layer to implement NI Linux RT distribution.
Shell
16
star
26

vdm-dotnet

NI Vision Development Module for .NET
C#
14
star
27

hoplite

Python
14
star
28

niveristand-custom-device-wizard

LabVIEW project template for VeriStand custom devices
LabVIEW
13
star
29

easyrdma

An easy-to-use, cross-platform, MIT-licensed RDMA library from NI
C
13
star
30

labview-icon-editor

Source for LabVIEW's icon editor
LabVIEW
12
star
31

grpc-teststand-api

Early Access Release of gRPC client and server examples for the TestStand API
C#
12
star
32

monodrive-documentation

monoDrive autonomous vehicle client
HTML
11
star
33

systemlink-server-examples

Jupyter Notebook
11
star
34

nitsm-python

TestStand Semiconductor Module Python API
Python
11
star
35

niveristand-instrument-addon-custom-device

VeriStand Instrument Addon custom device
LabVIEW
11
star
36

data-record-ad

Plug-ins, tooling, and documentation for extending the Data Record AD application.
LabVIEW
10
star
37

rad

NI Replication and Deployment Utility
LabVIEW
10
star
38

systemlink-operations-handbook

Documentation, examples, and example config files for IT professionals to use when managing an NI SystemLink Server installation.
CSS
10
star
39

measurement-plugin-labview

LabVIEW framework to develop measurement plug-ins for NI application software. Contains sample measurement plug-ins for InstrumentStudio and TestStand and a generator with a measurement template to get started on a measurement plug-in.
LabVIEW
10
star
40

aws-toolkit

LabVIEW Cloud Toolkit for AWS
LabVIEW
10
star
41

nisystemlink-clients-python

Python API for interacting with a SystemLink Server, created and supported by NI.
Python
10
star
42

jupyterhub-winlocalprocessspawner

Python
9
star
43

labview-gdrive

LabVIEW wrapper for the .NET Google Drive API
LabVIEW
9
star
44

niveristand-model-generation-support-for-simulink

9
star
45

systemlink-web-interface-template

HTML
9
star
46

jupyterhub-winauthenticator

Python
8
star
47

javascript-styleguide

JavaScript and TypeScript Style Guide
JavaScript
8
star
48

niflexlogger-automation-python

The niflexlogger-automation package contains an API (Application Programming Interface) and examples for using Python to automate NI FlexLogger. The automation API supports modifying the configuration of existing FlexLogger projects and controlling the execution of FlexLogger test sessions. The package is implemented in Python. NI created and supports this package.
Python
8
star
49

grpc-sideband

High bandwidth low latency data movement for gRPC based services.
C++
7
star
50

labview-git-diff-scripts

Scripts for generating diffs of LabVIEW files
PowerShell
7
star
51

labview-gmaps

LabVIEW
7
star
52

niveristand-fpga-addon-custom-device

VeriStand FPGA Addon custom device
LabVIEW
7
star
53

niauth-js

JavaScript
7
star
54

niveristand-custom-device-handbook

VeriStand Custom Device Handbook
7
star
55

imaqdx-dotnet

Collection of .NET wrapper functions for the NI IMAQdx driver.
C#
6
star
56

vscode-azdo-wiki-md-extension

TypeScript
6
star
57

hdlcoder-support-package-for-nifpga-hardware

6
star
58

niveristand-custom-device-testing-tools

Tools for automating testing of NI VeriStand custom devices.
LabVIEW
6
star
59

grpc-json-client-matlab

Make gRPC calls with JSON in MATLAB
MATLAB
6
star
60

ni6674t

NI PXIe-6674T Linux Driver
C
6
star
61

SimpML

Python
6
star
62

design-system

A system for designing and developing National Instruments Software
JavaScript
6
star
63

systemlink-client-docs

Repository for SystemLink Client API documentation and examples
6
star
64

veristand-editor-plugin-examples

C#
5
star
65

vbai-dotnet

Collection of .NET wrapper functions for the Vision Builder AI API.
C#
5
star
66

niveristand-ballard-arinc429-custom-device

Custom device for Ballard ARINC 429 hardware
LabVIEW
5
star
67

reviewboard-userscripts

โœจ Userscripts to enhance the Review Board experience โœจ
JavaScript
5
star
68

niveristand-engine-simulation-toolkit-custom-device

Enables validation of engine control units in VeriStand.
LabVIEW
5
star
69

niveristand-routing-and-faulting-custom-device

Custom device for switching and fault insertion
LabVIEW
5
star
70

automotive-camera-module-reference

Documentation and support collateral for NI's automotive camera modules
5
star
71

systemlink-grafana-plugins

Grafana plugins for visualizing SystemLink data
TypeScript
5
star
72

grpc-json-client

Send and receive gRPC protobuf messages with JSON.
C++
4
star
73

install-systemlink-enterprise

This repository constitues a basic getting-started guide for installing the SystemLink Enterprise application to a Kubernetes environment.
Jupyter Notebook
4
star
74

labview-grpc-query-server

C++
4
star
75

systemlink-labview-examples

LabVIEW
4
star
76

ni.github.io

NI GitHub org home page
HTML
4
star
77

vscode-ni-python-dataplugins

NI DataPlugins extension for Visual Studio Code
TypeScript
4
star
78

efibootmgr

NI's efibootmgr repository
C
3
star
79

hightime

Python
3
star
80

nxg-svn

C#
3
star
81

niflexlogger-systemlink-integration-python

Python
3
star
82

slsc-capability-explorer

LabVIEW
3
star
83

DelayGraph

C#
3
star
84

grub

NI's GRUB repository
C
3
star
85

nilrt-docs

Documentation related to NI Linux Real-Time
3
star
86

VireoSupportForEV3

Support for running Vireo on the LEGO EV3
C++
3
star
87

niveristand-embedded-data-logger-custom-device

VeriStand embedded data logger custom device
LabVIEW
3
star
88

NI-ELVIS-III-Python-Examples

Python Examples for NI ELVIS III
Python
3
star
89

niinstrumentstudio-switchexecutive-hosted-application

https://forums.ni.com/t5/InstrumentStudio/SwitchExecutive-Hosted-Application/gpm-p/3998692
C#
3
star
90

tdms-hvds-json-header-writer

The โ€œTDMS HVDS JSON Header Writerโ€ creates a JSON companion header file for TDMS HVDS (High Volume Data Stream) files as being used by ADAS data loggers. The JSON header file contains the meta data and information about the raw data as being stored in the TDMS files.
Rust
3
star
91

niveristand-slsc-eds-custom-device

SLSC EDS (Electronic Datasheet) Custom Device developed to make Generic Capabilities Files available in VeriStand.
LabVIEW
2
star
92

u-boot

C
2
star
93

meta-virtualization

BitBake
2
star
94

ni-refpolicy

NI's SELinux reference policy.
Python
2
star
95

meta-selinux

BitBake
2
star
96

tdms-parser

Parser for NI TDMS files implemented in Elixir
Elixir
2
star
97

NI-ELVIS-III-C-Examples

NI ELVIS III C examples
C
2
star
98

niveristand-telemetry-custom-device

VeriStand Telemetry custom device
JavaScript
2
star
99

hackathon

2
star
100

niveristand-engine-simulation-toolkit-fpga-ip

APIs for building bitfiles compatible with the Engine Simulation Toolkit VeriStand custom device
LabVIEW
2
star