Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the fastest way to check if trigger occurred

Solved!
Go to solution

What is the fastest way to check if trigger occurred. Right now the only way I can think of is to poll the number of samples acquired on the AI channel (that is triggered). Is there any faster way? Is there some property node (that I cannot find) that returns TRUE/FALSE?

Thanks

LV 2011, Win7
0 Kudos
Message 1 of 3
(2,708 Views)
Solution
Accepted by topic author ceties

Can you elaborate a little more? What sort of trigger (I'm assuming a start trigger)? What hardware? What do you mean by 'faster'?

 

There is no property for 'has a start trigger occurred'. If you want to find if a start trigger occurred, you can infer it from the sample count. There are several approaches you could take:

* DAQmx Read will block until either a timeout is hit or until the number of samples you've requested are read. You could do a DAQmx Read with an infinite timeout (-1), reading a single sample.

* Similarly, you could poll on the DAQmx Read properties TotalSampPerChanAcquired or AvailSampPerChan; once they are no longer 0, then that means that NI-DAQmx has begun buffering data internally, which means that the hardware has received the trigger.

* If you're using a digital edge start trigger, and depending on your hardware, then you may be able to use Change Detection in a separate task, but I'm not sure if that would be significantly faster then the other two approaches.

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
0 Kudos
Message 2 of 3
(2,701 Views)

Hi and thanks a lot! Polling of the TotalSampPerChanAcquired property node is exactly what I do now and I will test soon if it is fast enough. The story behind my question is here but I wanted to spare you since I do not think it is that important. 

LV 2011, Win7
0 Kudos
Message 3 of 3
(2,693 Views)