LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with DAQmx Synchronization, Start/Reference Trigger, seeing live data while waiting on trigger.

Hi!  I am attempting to use a start trigger to start data acquisition and update the front panel with live data while waiting on a reference trigger. Once the reference trigger hits, write X seconds of post reference trigger data to file.  I used the following knowledge base link as a model for my example:

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019MiHSAU&l=en-US

 

The goal is to see live data while waiting for the reference trigger, once the reference trigger goes low, collect X seconds of data.

 

Hardware: 

cDAQ-9132

Slot 1 - NI9202

Slot 2 - NI9212

Slot 3 - NI9401

 

LabVIEW 2015

 

My question is how to handle the flow of data?  Before there was a request for live data while waiting on the trigger, I'd use a start trigger outside the main loop, when the trigger hit, proceed in the loop, read data, and populate the waveform chart, repeat until the end of duration. Upon the end of duration of data collection, exit the loop, then use the history of the waveform chart to extract the data and write to file.  There does not seem to be a way to programmatically know that the reference trigger went low.  My waveform chart will be filled with all the data.  I guess I am having trouble with seeing what advantage the reference trigger is giving me. I'd like to use the reference trigger to signal populating the waveform chart.  But what's the difference between that approach and just programmatically searching the trigger channel waveform array manually?

 

Prior to attempting to use a reference trigger, after the start trigger, I'd proceed into the main loop, then I'd just search the waveform from the trigger channel for it to go low.  Once it went low and I had the index, I'd just trim all the waveforms from that scan, start the duration clock, and begin populating the waveform chart. You can see what I was doing in the "Parse" sub VI.  This approach seems to throw off the timing of events in the data file. For instance after the trigger we know 5 seconds in a valve closes, this approach increases that time by a few seconds in the file.  Everything worked perfect just using a start trigger and not seeing live data while waiting for it.  Any suggestions would be greatly appreciated, I've tried several things and I can't seem to solve this one.

 

I've attached a sample VI.

 

Thanks,

 

ChronicTiger

 

 

 

Download All
0 Kudos
Message 1 of 1
(332 Views)