nidaqmx-python icon indicating copy to clipboard operation
nidaqmx-python copied to clipboard

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

Open wanghuqiang123 opened this issue 1 month ago • 1 comments

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<X> 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

wanghuqiang123 avatar Nov 21 '25 08:11 wanghuqiang123