Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Read pulse width indefinite timeout - Why?

I am building a VI that needs to wait for a single pulse, and then measure the width of that pulse.  The pulse could be as quick as 180 ms or as long as 30 seconds.  This sounds trivial, but DAQmx Read appears to be limited by the timeout time.  For example, if I set the timeout to 0.5 seconds, and send it a pulse of about 500 ms, it times out and outputs a pulse width of 0.  I don't want to set my timeout to over 30 seconds to capture a 30 second pulse as this is not the only counter function my VI needs to perform.  In the help documentation, DAQmx can be set to -1 for an indefinite timeout period.  That sounds like a good catch-all, but how do I cancel out without reading a pulse?  Does anybody know how to force DAQmx Read to cancel?

 

Any help would be appreciated.

0 Kudos
Message 1 of 2
(5,751 Views)

I found an example that let's you interrupt the DAQmx Read:

 

Community: Interruptible DAQmx Read

 

The example is for an AI task, but could probably be altered to do Counter tasks.

 

Tim W.

Applications Engineering

National Instruments

http://www.ni.com/support 

0 Kudos
Message 2 of 2
(5,745 Views)