Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

ni daq 6008 with matlab

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')
   
0 Kudos
Message 1 of 2
(3,354 Views)

@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.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 2 of 2
(3,348 Views)