Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you repeatedly acquire a set number of samples started from a digital trigger using a 6251 DAQ card.

I am using Visual Studio 2005 C++ an the PCIe-6251 card with the BNC-2090 breakout box.
 
I need to capture about 500 microseconds of data at a rate of 40 - 100 Hz.  The data capture is started by an digital trigger.
 
I am following the examples provided in ..\Analog In\MeasureVoltage\AcqVoltageSamples_IntClk.  However this example provides a single data capture per task.  If I need to repeatedly capture data every trigger at 40 Hz I have to start up a new task every 25 milliseconds.  The overhead involved in starting up a task takes about 8 milliseconds thus preventing me from running at 100Hz.  I have found out that I can only run at about 60 Hz or I cannot start up a new task fast enough.  I could statically allocat an array of tasks and cycle through this array as I capture but I would rather have one task that can repeat itself for every trigger.  Is it possible to start up only one task and have that task repeat itself for every trigger.
 
Thanks in advance
0 Kudos
Message 1 of 2
(5,069 Views)
Hello,

The most straightforward way to decrease your task setup time would be to use the DAQmx_Val_Task_Commit  command for your task.  You can find examples of how to call this command in the DAQmx C Reference help.  This places the task in a commited state, which keeps the hardware programmed as much as possible to execute that single task.  The other option we can look at is using a trigger as your sample clock,  then we can use a retriggerable trigger for you counter and you would get a hardware timed retriggerable effect.  There is a C++ example of this application in the developer zone at ni.com.  If the commit command task is not giving you the necessary performance or you are having difficulty please consider this option. 

http://zone.ni.com/devzone/cda/tut/p/id/5382

Please let me know if you need further help with this issue,

Michael D
Applications Engineering
National Instruments
0 Kudos
Message 2 of 2
(5,056 Views)