Why do I get a "The hardware you are trying to use is already reserved" error when starting an ANALOGINPUT object in Data Acquisition Toolbox 2.11 (R2007b)?

27 views (last 30 days)
I receive the following error when starting a NI-DAQmx interface ANALOGINPUT object after starting an NI-DAQ Traditional interface ANALOGINPUT object corresponding to the same device.
Reproduction Code:
ai=analoginput('nidaq',1) % Use of Trad Nidaq
addchannel(ai,1)
start(ai)
a2=analoginput('nidaq','Dev4') % Use of NiDAQmx
addchannel(a2,1)
start(a2)
??? The hardware you are trying to use is already reserved, either by another object in this MATLAB session, or possibly by another application. To unreserve the device if held by this session of MATLAB or another MATLAB session, delete the object that may have it reserved, or run daqreset. As a last resort, use National Instrument's Measurement & Automation Explorer to reset the device.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
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 Hardware Discovery and Setup in Help Center and File Exchange

Tags

Products


Release

R2007b

Community Treasure Hunt

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

Start Hunting!