Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquiring data with pretrigger for length of TTL pulse

My goal is to acquire data for an amount of time corresponding to the time and length of a TTL pulse with a user defined pretrigger window.  I'm successfully able to trigger data acquisition with my TTL pulse on a digital channel but I'm not sure how to end the sampling correctly.

 

This is an image of what the TTL and input data looks like:

 

Picture 1.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Without a way to succesfully end the sampling when the TTL falls, I'm only able to capture this data:

 

Picture 3.png

 

 

I need a way to trigger without setting the right amount of samples.  This is what the data acquisition section of the VI looks like as of now:

 

 

 Picture 3.png

 

 

I'm using the DaqMXbase driver set.  Thanks for your help.

 

0 Kudos
Message 1 of 4
(3,520 Views)

If you know how long the TTL signal is high you could trigger off the falling edge of the TTL signal with a specified number of pretrigger samples.  There is unfortunately nothing like a stop trigger in DAQmx.

 

For more information about reference triggers check out the KnowledgeBase article below

 

http://digital.ni.com/public.nsf/allkb/3DE994179719296D86256CB000544217?OpenDocument

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 2 of 4
(3,493 Views)

Thanks for the reply.

 

I had also tried to set the sample clock to continuous samples and find something to trigger the stop sub-VI but I couldn't get anything to work. 

 

As of now my only way to implement was to set a small, finite amount of samples with a digital start trigger with a relatively large pretrigger sample during the first triggered sampling iteration and afterwards continuously polling the trigger input and writing to an array to generate a longer sample and stop the sampling when the polling returns a low TTL.

0 Kudos
Message 3 of 4
(3,479 Views)

Another option would be to use a counter as the sample clock for your analog input.  We can then setup this counter to gate on the TTL input signal that you are triggering off of.  This will cause the counter to only generate a signal when your TTL line is high, which will only cause the analog input to sample when the TTL line is high.

 

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

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 4 of 4
(3,463 Views)