Skip to content

Event Callbacks Contain Unusable Parameters #143

@maxxboehme

Description

@maxxboehme

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions