Why do I get a "NIDAQmx error: Device not available for routing" error when I output samples to an ANALOGOUTPUT object in Data Acquisition Toolbox 2.11 (R2007b) ?

9 views (last 30 days)
I receive the following error when I use PUTSAMPLE to output samples to a NI-DAQmx interface ANALOGOUTPUT object after accessing a NI-DAQ Traditional interface ANALOGOUTPUT object corresponding to the same device.
Reproduction Code:
ao=analogoutput('nidaq',1) % Use of Trad Nidaq
addchannel(ao,1)
putsample(ao,0)
ao2=analogoutput('nidaq','Dev4') % Use of NiDAQmx
addchannel(ao2,1)
putsample(ao2,0)
ERROR: ??? NIDAQmx error : Device not available for routing. It is possible that the device needs to be reset or that the device is being reset. If you are resetting the device, wait for the reset to complete. For example, if you have used the device through Traditional NI-DAQ, you must reset the device before the requested route can be made. For SCXI devices, you must reset the communicator DAQ device. Call the Traditional NI-DAQ Device Reset VI or the Init_DA_Brds function. To reset all devices in Traditional NI-DAQ, right-click the Traditional NI-DAQ Devices folder in MAX and select Reset Driver for Traditional NI-DAQ. Task Name: MWDAT0018 Status Code: -89130

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 7 Apr 2021
Edited: MathWorks Support Team on 7 Apr 2021
Once you access a device from the Traditional NI-DAQ interface, it is reserved by Traditional NI-DAQ, and cannot be used by the NI-DAQmx interface.When the NI-DAQmx interface attempts to start the device, it is unable to reserve it, causing the error.
Use National Instrument's Measurement and Automation Explorer to reset the Traditional NI-DAQ device. Doing so will make it available under NI-DAQmx, as mentioned in the error message.
For more information, please see the following related Bug Report which discusses the same source of error:

More Answers (0)

Categories

Find more on Data Acquisition Toolbox Supported Hardware in Help Center and File Exchange

Products


Release

R2007b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!