Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 6221 DAQ real time capabilities

Is it possible to use the NI DAQ cards (i.e M series cards) to output analog voltages in real time. Is it possible to use the counter/timers on the DAQ to achieve this. Similarly, is it possible to use Real Time Subsystems like RTX and HyperKernel to allow for realtime output as well as data acquisition.
0 Kudos
Message 1 of 5
(4,003 Views)
Hello arule,
M Series devices support hardware timed analog output (the boards that have AO, not all M Series do).  Hardware timed operations are, of course, independent of software latencies, so that is real-time.  No need to use a counter.  Also, there is a driver for the RTX, NI-DAQmx Base 2.0, that supports M Series boards, which can be found here.
-Alan A.

Message Edited by Alan A. on 11-30-2005 07:15 AM

0 Kudos
Message 2 of 5
(3,989 Views)
Thanks Alan for the information.
 
Arule
0 Kudos
Message 3 of 5
(3,969 Views)

Hello,

i ve got a similar issue with a USB-6251 (BNC): The device is connected via USB with a PC running a MATLAB script.

I have a problem with the command startBackground(s). When I try to execute this command It takes a lag of about 240 ms until it is done, i.e. until the signal leaves the NIDAQ. I find the same latency by measuring the command itself using GetSecs() inside my script in Matlab. 

Part of my code:

 

daqreset;                                 % In case there was still an open session, reset the NiDAQ

s = daq.createSession('ni');              % open session

addAnalogOutputChannel(s,deviceID,[0 1], 'Voltage'); % Opens two output channels. Note: first channel is designated "0"

set(s, 'Rate', fs);

queueOutputData(s,[0 5;0 0]);      %For demonstration purpose i only take two samples and use them as a trigger signal which i am able to record using an      

                                                      %EEG Ampflifier + Recorder

prepare(s);

outp(addressOut,2);                     %Direct Trigger signal via parallel port (LTP) with a lag of 2-3 ms. I use this as a reference to determine the lag in my record file

t3=GetSecs();

startBackground(s);

t3=GetSecs()-t3;

outp(addressOut,0);

s.stop();

 

My aim is to generate a sinusoidal signal using a NI- USB 6251 from National Instruments and the Data Acquisition Toolbox.

This signal has to be in phase with another signal that i measure in real time.

The time lag occurs once when initially start my script and is decreased for subsequent execution of startBackground(s). If I reset MATLAB workspace and DAQ connection, i.e. Control+C, clc, clear all and daqreset, the initial time lag of about 240 ms reappears. And again, subsequent executions are again processed faster ( time lag of about 35-55 ms). The short lags are still problematic because they vary in a large range, such that i cannot cope with it e.g. by involving it in my calculations of my desired signal.

I added the command prepare(s) which is proposed in the online description of DAQ. This reduces the initial lag to about 160 ms but has no influence on subsequent executions of startBackground(s).

 

In summary, i found a non-systematic, wide varying either about 240 ms  or 35-55 ms time lag of the function startBackground(s), maybe it is a more general problem related to the Data Acquisition Toolbox. I tested it in both 32- and 64- bit version of MATLAB. In comparison a direct signal transmission using parallel port takes 2-3 ms until it is detected by my EEG recorder.

 

Have you got any idea?

 

0 Kudos
Message 4 of 5
(3,446 Views)

Hi tion_rum,

since you created a new thread, let's keep all the communication there.

 

Link: http://forums.ni.com/t5/Multifunction-DAQ/MATLAB-DAQ-Analog-Output-using-USB-6251-BNC-startBackgroun...

0 Kudos
Message 5 of 5
(3,429 Views)