ni / ni/nidaqmx-python

Raw reads should use `RawDataWidthInBits` on DAQmx versions that support it

Open
#811 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
592
Forks
199
Avg merge
1d 16h
Merged PRs (30d)
10

Description

Problem to Solve

Raw read methods like InStream.read and InStream.read_into do a lot of work to calculate the raw sample size, but this code is incomplete and does not account for these cases:

  • DIO and CI channels
  • Compressed AI data
  • Reading before the task is verified

Proposed Solution

NI-DAQmx 24.5 or 24.8 added support for a new internal attribute, RawDataWidthInBits, which indicates the raw data size in bits. I think the corresponding C API function name is DAQmxGetRawDataWidthInBits. If this function is available, nidaqmx-python should use it instead of calculating based on AI channel attributes.

AB#3240024

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the InStream.read and InStream.read_into entry points and trace how raw sample size is currently calculated. Check the availability and behavior of DAQmxGetRawDataWidthInBits/RawDataWidthInBits across supported NI-DAQmx versions, including DIO, CI, compressed AI data, and reads before task verification. Done means supported versions use the attribute while incompatible versions remain functional.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.