Acquire Data and Generate Signals at the Same Time for usb 6008
3 views (last 30 days)
i used this code to aquire and write signals in usb 6008 simultaneously but message error appeared . how to solve that?
% The hardware associated with this session is reserved. If you are using it in another
session use the release function to unreserve the hardware. If you are using it in an
external program exit that program. Then try this operation again.
% % Initialization
%%get connected devices d = daq.getDevices %create session s = daq.createSession('ni')
%add analog channel s.addAnalogInputChannel('ID',channel num, 'measurement type')
s.addAnalogOutputChannel('Dev1', 'ao0', 'Voltage')
% set rate of scan 1000 scans/second , run for 30 seconds
duration = s.DurationInSeconds
v.TerminalConfig = ' Differential';
%v.TerminalConfig = ' SingleEnded';
%aquire data and process
lh = s.addlistener('DataAvailable', @plotData)
h = s.addlistener('DataAvailable', @storedata);
% Analog Output
ao_value = 3.5;
Walter Roberson on 11 Mar 2014
The device is already in use. If you are using it in another MATLAB session, then either use release() in that session or terminate the session. If the device is being used by another program outside of MATLAB, then end that program. If there is nothing you can find that is using the device then reboot your computer and try again.