08-06-2013 05:25 AM
i am doing sensor measurement using ni usb 6008 and i made the configuration to be single ended channel the range should be changed to +10 to -10 but that didn't happened , I also connected the same sensor to labview signal xpress on single ended and it works very well , so i think the problem is in matlab with my code.
% % get connected devices d = daq.getDevices %create session s = daq.createSession('ni') %add analog channel s.addAnalogInputChannel('ID',channel num, 'measurement type') s.addAnalogInputChannel('Dev1',3, 'Voltage')
% set rate of scan 4 scans/second , run for 3 seconds s.Rate=4; s.DurationInSeconds=3;
v= s.Channels(1); set(v) %_____________________________ %% v.TerminalConfig = ' single ended '; v.Coupling = ' DC';
v
%%
%start aquisition and plot
[data,time] = s.startForeground;
plot(time,data) grid on xlabel('Time (sec)') ylabel('voltage in v')
08-06-2013 06:36 AM - edited 08-06-2013 06:39 AM
@26111988 wrote:
i am doing sensor measurement using ni usb 6008 and i made the configuration to be single ended channel the range should be changed to +10 to -10 but that didn't happened , I also connected the same sensor to labview signal xpress on single ended and it works very well , so i think the problem is in matlab with my code.
There is an available toolbox called Data Acquisition Toolbox, and USB-6008 is compatible. Now if you're already aware and using this, probably you may want to ask this question at MATLAB forum.
Edited: Well there are couple of topic/discussions/examples you can find, very specifically to USB 6008 & MATLAB.