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() ?) or has it something to do with my NI device?
I'm not a pro in Matlab so I don't quite understand everything 😉
Any tips would be helpful!
Thea