Skip to main content

NIDAQ-driver

Python library for NI DAQ modules

To use, include NIDAQClient.py in your project.

Example

from NIDAQClient import NIDAQVoltage
from NIDAQClient import NIDAQThermo

# Create an instance of the client for thermocouple reading.
# This thermocouple module is installed in position 2 in the NI DAQ cage:
daq = NIDAQThermo(position=2, thermocouple_type='J')
daq.start()

# Here, use the `read_samples` method whenever you need to read from the channels.
data = daq.read_samples()

# Print the data here in the console
print("Received Thermocouple Data:")
print(data)

daq.stop()
daq.close()



# Now, read a voltage sensor installed in the NI cage in position 4:
daq = NIDAQVoltage(position=4)
daq.start()

# Here, use the `read_samples` method whenever you need to read from the channels.
data = daq.read_samples()

# Print the data here in the console
print("Received Voltage Data:")
print(data)

daq.stop()
daq.close()

The output will look something like this:

Received Thermocouple Data:
[1376.34 1376.34 1376.34 1376.34 1376.34 1376.34 1376.34 1376.34]
Received Voltage Data:
[3.27506 3.27454 3.31136 3.29971 3.32641 3.30917 3.33307 3.3026  3.16697
 3.15747 3.18815 3.15947 3.19679 3.17848 3.19905 3.16965 3.25606 3.25605
 3.29187 3.28341 3.30896 3.29355 3.31831 3.29019 3.16315 3.15645 3.18703
 3.16075 3.19613 3.17977 3.19904 3.1716 ]

Usage

The NI DAQ 'cards' must be addressed by their position in the cage. The cage positions are represented in the ASCII art below:

-----------------------------------------------
|             |       |       |       |       |
|  National   |   P   |   P   |   P   |   P   |
| Instruments |   O   |   O   |   O   |   O   |
|             |   S   |   S   |   S   |   S   |
|   NI cDAQ   |   I   |   I   |   I   |   I   |
|             |   T   |   T   |   T   |   T   |
|             |   I   |   I   |   I   |   I   |
|             |   O   |   O   |   O   |   O   |
|  []  USB    |   N   |   N   |   N   |   N   |
|  []  Power  |       |       |       |       |
|             |   1   |   2   |   3   |   4   |
|             |       |       |       |       |
-----------------------------------------------

For example if a thermocouple card is inserted in position 3, you must initalize the reader as

daq = NIDAQThermo(position=2, thermocouple_type='J')

You can read the samples from the card with the following:

data = daq.read_samples()

This code will return a list of values from the card. Thermocouple cards will return eight values, relating to thermocouple channels 0 through 7. Voltage cards will return thirty-two values, relating to channels 0 through 31. You can pull these values into the rest of your code to save or transmit to other parts of your code.

Metadata

Release files for NIDAQUSBDriver 0.11.0

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

Source distribution (sdist)

Source distribution for NIDAQUSBDriver 0.11.0
File Size Uploaded Provenance
NIDAQUSBDriver-0.11.0.tar.gz 4.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for NIDAQUSBDriver 0.11.0
File Interpreter ABI Platform
NIDAQUSBDriver-0.11.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 kB

Release files / NIDAQUSBDriver-0.11.0.tar.gz

Download URL NIDAQUSBDriver-0.11.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4887547f1853c8b1879783ebd5df3bc65089ae6ad3d0200d25b93e8e60de6744
BLAKE2b-256 checksum
How to use checksums
20f4853c3aa22f122526f0deb106df708ed7f49c0ec81bc27fd288f1837818fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / NIDAQUSBDriver-0.11.0-py3-none-any.whl

Download URL NIDAQUSBDriver-0.11.0-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c27e578291ec0aca4a2229b73d50b2cbb45590f640b8fbf875b3ea24d38b6418
BLAKE2b-256 checksum
How to use checksums
f994fc37732298cfa21825b596293d7582392b7812ea27f58ecbd643100c79ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Security for NIDAQUSBDriver 0.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.11.0 This release

2 release files No provenance

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