LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

use reference trigger DAQmx TDMS logging

I've written a VI that streams data to a TDMS file when the user specifies using the DAQmx Read Logging.Pause property.  Now I would like to add the capability to stream the data to the file using a hardware reference trigger.  I want to use a reference trigger because I need the data pre and post trigger. 

 

The task has 34 channels sampling at 10000 Hz.  One of the channels is the source for the digital reference trigger.  The trigger is rising edge step function.

 

I'm getting error -200284 when I call the DAQmx Read function for any timeout value not equal to -1.  If I set timeout to -1 I never see the trigger. I know the source gets the trigger because I can see it in MAX and in the data file produced in the original configuration.  How am I incorrectly implementing the trigger? 

Download All
0 Kudos
Message 1 of 5
(2,434 Views)

Hey,

 

It sounds like it may just be that your read vi is timing out before the trigger occurs. That error message basically just means that your read vi timed out before it got the samples to read. You might want to try putting the read vi outside the loop before you start the task, and just have a "DAQmx Is Task Done.vi" inside the loop waiting for the read.

Britton C.
Senior Software Engineer
National Instruments
0 Kudos
Message 2 of 5
(2,389 Views)

When logging and reading there a a few caveats about buffer sizes and samples per channel that you must pay attention to!  

Read This section of the DAQmx Help file

Capture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 5
(2,381 Views)

is this what you mean?

0 Kudos
Message 4 of 5
(2,376 Views)

That would be one way to avoid the "log and read" caveats and should perform quite well.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 5
(2,365 Views)