Skip to main content

Python Interface for the DATAQ DI-2008 DAQ

Project description

DI2008-Python

About

Interface for the DI-2008 in Python. Version 1.2.0

Python 3.10+

Modified from original interface in Python by DATAQ Instruments under MIT License

Maintainer: Clark Hensley ch3136@msstate.edu

Getting Started

Install via pip from PyPI:

pip install di2008-python

See Available DI-2008s:

from di2008_python import print_all_daq_metadata
print_all_daq_metadata()

Instantiate DI2008 Object with Dictionary of Parameters:

from di2008_python import DI2008, DI2008GlobalAnalogLayout, DI2008GlobalScanRateSettings, DI2008AllAnalogChannels, DI2008FilterModes, DI2008GlobalSerialNums, DI2008AnalogChannels, DI2008AnalogLayout, DI2008TCType, DI2008ScanRateSettings

# Enable the DI-2008 with a K-Type thermocopule in Analog Channel 1, an N-Type Thermocouple in Analog Channel 3, and the Digital Channel active
di2008 = DI2008({
        # Global Settings
        DI2008GlobalAnalogLayout: (DI2008Layout.TC, DI2008TCType.K)
        DI2008GlobalScanRateSettings.SRATE: 4,
        DI2008GlobalScanRateSettings.DEC: 1,
        DI2008GlobalScanRateSettings.FILTER: {
            DI2008AllAnalogChannels: DI2008FilterModes.AVERAGE,
            },
        # Serial Numbers of DAQs to apply
        DI2008GlobalSerialNums: [<DI-2008 Serial Num>, <DI-2008 Serial Num>, ...],
        # Overwriting settings for a given DI-2008
        <DI-2008 Serial Num>: {
            DI2008AnalogChannels.CH1: (DI2008AnalogLayout.TC, DI2008TCType.N),
            DI2008ScanRateSettings.FILTER: {
                DI2008AnalogChannels.CH1: DI2008FilterModes.LAST_POINT,
                }
            }

This interface uses named enumerations to ensure that what settings are being used is clear and concise

Currently, this package supports configuring and using up to 16 DI-2008s via ChannelStretch synchronization, and using any configuration of the Analog Channels. As of version 1.2.2, the digital channels, as well as the Event, Record, Rate, and Count channels are not yet supported.

Note About Bandwidth: Per the DI-2008 Protocol, if a single analog channel is enabled, the maximum sample rate of the DI-2008 is 2000 Hz, and if two or more analog channels are enabled, the maximum sample rate of the DI-2008 is 200 Hz. However, in this current implementation, that rate must be again divided by the number of enabled channels. Thus, 2 channels have a maximum sample rate of 100 Hz, and all 8 enabled channels can be sampled at, at most, 25 Hz. This is a known issue and work to address it is ongoing.

Current Features:

  • Thermocouples
  • ADC Reading
  • Changing Scan Rate, Decimation, and Filtering Mode
  • Automatic ChannelStretch Synchronized Initialization
  • Enforce cleanup on stopping
  • Changing Packet Size
  • Interface with the info operator

Planned Features:

  • Reading configuration from .json/.toml files as well as raw Python dictionaries
  • Digital Channels
  • Specify Digital Input as well as Output
  • CJCDelta
  • Rate Measurement
  • LED Color

Further information about the DI-2008 can be found on DATAQ's website and via the DI-2008 Protocol.

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

di2008_python-1.2.2.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

di2008_python-1.2.2-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file di2008_python-1.2.2.tar.gz.

File metadata

  • Download URL: di2008_python-1.2.2.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.12

File hashes

Hashes for di2008_python-1.2.2.tar.gz
Algorithm Hash digest
SHA256 5a30f295272def0a2df83dbbe958f4d43efbf1e9d1b1604b48a27a74b00f0dcb
MD5 1d7d0fe17781142462a5e820a6a94d5a
BLAKE2b-256 1a5b9d46ec266d1754e83c8873fc35c425c6fab4ac274ce51b8a19b0e35d17ff

See more details on using hashes here.

File details

Details for the file di2008_python-1.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for di2008_python-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e43368e0f7bc7a1831fe6ae8a962b4ed7f1ade87fda643f3786c7de982a519fe
MD5 d14fc53ecf2698eeb837dd03e4cf13a8
BLAKE2b-256 8d378a671e649d9d143e25d8f79599d449adfdec67cf226cd582f54c04fcbee2

See more details on using hashes here.

Supported by

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