Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

What is DAQmxBaseStartTask doing that takes 300 milliseconds?

I am trying to do a simple triggered acquisition in a loop. (This is C code on Mac OS 10.5.8.) Start the task with DAQmxBaseStartTask, collect with DAQmxBaseReadBinaryI16 and stop with DAQmxBaseStopTask.

The trigger occurs every 500 ms and I have 400 ms of data to collect. That leaves 100 ms to start the loop again for the next trigger.

Except that on average, DAQmxBaseStartTask takes 300 ms to complete.

 

 

0 Kudos
Message 1 of 6
(3,484 Views)

Hi mauricev,

 

The DAQmx Base commands are going to be system dependent, however it sounds like you are creating and clearing your task within the loop.  This is not the optimal way to trigger your code.  If possible you should only create your task one time then clear it at the end.  This could be where your time is coming from.  You might take a look at the following Developer Zone example that illustrates a retriggerable AI task. 

 

DAQmx - Retriggerable AI Using Retriggerable Counter

Regards,
Jim Schwartz
0 Kudos
Message 2 of 6
(3,457 Views)
I am trying to use this code, but I'm stuck. The command DAQmxBaseSetTrigAttribute is missing. How do I make the counter retriggerable without it?
0 Kudos
Message 3 of 6
(3,418 Views)

Hi mauricev,

 

I missed that you were using DAQmx Base.  Currently, there is no way to perform a retriggerable task in DAQmx Base - you will have to start and stop the finite task in the loop. 

Regards,
Jim Schwartz
0 Kudos
Message 4 of 6
(3,387 Views)
That it doesn't work is the point of my post. :smileysad: This is a pretty serious bug. Can you please get an ETA on when this will be fixed?
0 Kudos
Message 5 of 6
(3,383 Views)

Hi mauricev,

 

The ability to make counter tasks retriggerable is not a feature of DAQmx base.  To provide feedback or suggest this for future versions of the driver,  please create a product suggestion at the link below under Product Feedback:

 

Contact NI

 

In the meantime, retriggerable tasks are supported for the standard DAQmx driver, so the program from the previous post will work on a Windows system or a Linux system that has DAQmx support (Redhat, Mandriva, Suse).

 

DAQmx for Linux

 

DAQmx for Windows

Regards,
Jim Schwartz
0 Kudos
Message 6 of 6
(3,379 Views)