ni / ni/nidaqmx-python

Event Callbacks Contain Unusable Parameters

Open
#143 5 comments 0 reactions 1 assignee View on GitHub

@DeborahOoi96 is already working on this.

Since Jan 19, 2024.

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

Description

Original discussion on NI's forms.

DAQmx's event callback signatures include a Task ID and callbackData parameters even though there currently isn't a way to get a task object from a Task ID or be able to pass in user provided callbackData (register_every_n_samples_acquired_into_buffer_event passes None as the data.)

Having to specify these to parameters in the signature even though they are not usable is confusing the users.

These are 2 ideas on how to improve this.

  • Provide a way to pass in user provided data and get a task object from a Task ID.
  • Make the callback signature that users provide not have to specify those and wrap their callback in an internal one to the event register functions.
    • Might also be able to pass reference to task object that referenced it by passing self from internal_callback wrapper.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.