Error "daqcli:da​q:hardware​ResourceRe​served" when trying to do measurements

6 vues (au cours des 30 derniers jours)
Thea
Thea le 6 Mai 2025
Hello,
I have the task to transition a Matlab project from the session based interface to the newer Data Acquisition interface. The old version works and can be used to take potential measurements. The device that is used is a NI PCI-6259 and I am running Matlab Version R2024b.
Most part of the code is working with the new interface but when I try to perform the measurements I get this error message after the first data point: "Error using: daqcli:daq:hardwareResourceReserved Hardware is reserved, possibly by an external applicator or another DataAcquisition object. To unreserve the hardware, exit the external application or stop the other DataAcquisition."
The error occurs in:
start(obj.fsession, "Continuous");
I also checked the 'Running' property of "fsession" and its always '0' before calling the function. There is a function, which is called after one measurement to stop 'fsession':
function stopmeasure(obj)
% Stops the background sampling.
try
% obj.fsession.stop;
stop(obj.fsession);
% release(obj.fsession);
catch err
showErrorInBox(err);
end
end
The commented parts are from the old session based version. When I checked correctly there is no alternative for the release-function in the new daq interface, right?
How can I get this error when the 'Running' property of my daq object is 0? Did I miss something in my stopmeasure function (instead of release() ?) ?
I'm not a pro in Matlab so I don't quite understand everything ;)
Any tips would be helpful!
Thea

Réponse acceptée

Aabha
Aabha le 8 Mai 2025
Hi @Thea,
Since this is a hardware related problem, it is hard to pinpoint the exact reason you might be facing this issue. But here are a few different ways you can try to troubleshoot.
The issue you are facing is likely due to the hardware resources not being properly released between measurements. While there is no direct equivalent to the ‘release’ function in the new interface, hardware resources associated with a session are automatically released when you delete the session object or assign a different value to the variable containing the session object in the new interface. You can ensure that the previous hardware resources are released, by reinitializing the 'DAQ object' when creating a new measurement.
Additionally, the 'Running' property of the session being equal to ‘0 doesn't necessarily mean the hardware resources are fully released, it just indicates that the acquisition isn't active.
Please refer to the following MathWorks documentation link for more information about the ‘DataAcquisitionobject that is used as an interface to the data acquisition device:
I hope this helps.

Plus de réponses (0)

Catégories

En savoir plus sur Data Acquisition Toolbox Supported Hardware dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by