DAQ Stuff

From Yavuz Group
Jump to navigation Jump to search

Installing the DAQ Driver

The driver for the NI USB-6002 OEM was installed by downloading the latest driver version from the internet, not with the MATLAB support package installer. If installed successfully, the blue light on the DAQ should light up whenever it is plugged into the computer, or the computer is turned on with the DAQ plugged in. To double check the DAQ's connection open, NI MAX and check under devices and interfaces on the left (you might have to refresh the list). Also, using daq.getDevices in MATLAB will tell you if it is connected.

DAQ Manuals

6002 OEM Manual (includes pinout for the 6002 OEM)

General 6002 Manual (for OEM and non-OEM version)

Notes

1.) Example code (MATLAB):

   s = daq.createSession('ni');
   ch1 = addAnalogInputChannel(s,'Dev1','ai3' , 'Voltage'); % Adds analog input channel ai3
   ch1.TerminalConfig = 'SingleEnded';                      % Sets grounding configuration (Differential or SingleEnded)
   ACQrate = 50000;                                         % Sample rate.  Maximum rate 50,000/sec total. If there are n channels then each channel samples at 50,000/n
   ACQduration = 10;                                        % Acquisition duration in seconds
   s.Rate = ACQrate;
   s.DurationInSeconds = ACQduration;
   PD_data = s.startForeground();                           % Begins collecting data

2.) There are 4 analog inputs in differential mode and 8 in single ended mode

3.) There are sometimes voltage offset issues due to grounding. Make sure to double check.

4.) DAQ output in MATLAB for a single ai is a one column array