LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timestamp When Condition is Initially Met?

My VI currently displays the elapsed time since acquisition started. I want to keep the vi running, but have a second timer that stops when a condition is met- (when acceleration data surpasses a value). 

 

I've tried using while loops where the condition met=true stops the loop and the value can be displayed (see attached image). However, this entire thing needs to be placed inside a second while loop in order to continuously acquire data. When I do this, the VI will run for one second then stop. I dont think it likes the nested while loops.

 

I have also tried a case structure where the running time will be displayed when condition met=true.

 

The problem is, I want to record onscreen, (and hopefully to a text file) only the first time at which the condition is met- not have the time display when the condition is met.

 

The rest of the VI needs to continue running, and I only want the first value from the timer at which the condition is met.

 

Any ideas?

 

Thanks,

 

-Adam 

 

 

0 Kudos
Message 1 of 2
(2,138 Views)
Is your data stream constant? As an example constant sample rate. If this is the case you can keep track of the total numper of sampels recieved. Say i have a constant data stream sampled with 100Hz. If an event occur at sample 566, I can track this event to start time+(566*0.01) sec. This method use almost zero CPU since you only work with a single integer. Use a shift register for this purpose


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 2
(2,109 Views)