Skip to content

nidaqmx.errors.DaqError: -50405: No transfer is in progress or transfer was aborted #893

@wanghuqiang123

Description

@wanghuqiang123

Bug Report: Occasional -50405 Error with USB-6009 During Continuous Acquisition

Description

I am experiencing the occasional -50405 error ("No transfer is in progress or transfer was aborted") when using the NI USB-6009 DAQ card with the nidaqmx Python library. The error occurs unpredictably during continuous data acquisition.

Steps to Reproduce

  1. Create a task and configure it for continuous sampling.
  2. Call task.start().
  3. Continuously call task.read() in a loop to fetch data. In my case, I'm reading 10 samples every 50ms.
  4. The error -50405 occurs randomly after some time.

Expected Behavior

The task.read() should consistently return data without throwing the -50405 error as long as the device is connected and the task is properly configured.

Actual Behavior

After running successfully for a period (could be minutes or hours), the application crashes with the following error:
nidaqmx.errors.DaqError: -50405: No transfer is in progress or transfer was aborted.
Task Name: _unnamedTask
Status Code: -50405

The only way to recover is to physically disconnect and reconnect the USB-6009 device.

Environment

  • Python Version: 3.11.9
  • nidaqmx Package Version: 1.2.0
  • NI-DAQmx Driver Version: 2024 Release (exact version number not specified)
  • Operating System: Windows 10 64-bit
  • Hardware: NI USB-6009

Additional Information

  • I have double-checked my task configuration parameters (sample rate, number of samples to read, etc.) and they seem correct.
  • The issue is intermittent and not easily reproducible on demand.
  • Restarting the Python script without unplugging the device does not resolve the issue. A physical reconnection is required.

AB#3541490

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions