Code covered by the BSD License  

Highlights from
Single shot NI-USB6008 DAQ

Single shot NI-USB6008 DAQ

by

 

Single shot NI-USB6008 Data Acquisition

single_shot_acquisition
function single_shot_acquisition

boardId = find_ni_usb_6008;
ai = analoginput('nidaq', boardId); 

addchannel(ai,0); % add analog input channel 0
set(ai, 'InputType', 'SingleEnded'); 
set(ai, 'SampleRate', 1000); % in Hertz
set(ai, 'SamplesPerTrigger', 1000);  
% the above line tells MATLAB to keep collecting
% data until explicitly stopped

start(ai); 
pause(10); % collect 10 sec worth of data
stop(ai);

data = getdata(ai);
meanvalue = mean(data); 
fprintf('Mean value = %f volts\n', meanvalue);

delete(ai);

Contact us