ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While Loop Termination

I am writing a program that has a while loop embedded in another while loop.  What I want to do is use a digital trigger to break the inner while loop.  I have no idea how to do it. 
 
I am attaching a copy of the program.  If anyone has any suggestions, I would really appreciate it.
 
Thanks
0 Kudos
Message 1 of 4
(3,145 Views)
Hello soykmw,

what do mean by 'digital trigger'? Is it some kind of hardware or just a button on the frontpanel?

But you can always wire some more boolean outputs to the OR functions in the inner while loop to stop the loop... And btw.: I would use the Compound Arithmetic, when there are more than two inputs for the same operation!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(3,138 Views)
Sorry I wasn't very clear in my original message...what I want to be able to do is to use the rising edge of the external TTL that pauses the waveform output to break the inner while loop.  Basically, what I need to happen is every time the waveform is turned off (by the external TTL), I want the inner loop broken so that the waveform always starts at phase = 0 the next time the program is externally triggered, which does not happen the way the program works now because the inner while loop doesn't get broken between external trigger events.
0 Kudos
Message 3 of 4
(3,125 Views)
Hello soykmw,

to detect rising/falling edges of TTL signals (= boolean signals) you can use the 'Implies' operation (or even better: Compound Arithmetic) from the boolean palette together with a shift register (for recalling the last iteration's value) in the while loop. Well, that's a basic boolean operation 🙂


Message Edited by GerdW on 03-31-200608:12 AM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(3,098 Views)