LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining the state of a switch

Hello,

I've got 3 nested loops: While-Case-While
If the user hits a front button, the case statement returns true and the inner while loop gets executed.
Now, what should I do to exit the inner while loop in case the user hits the same button again?
In other words, can I somehow "check" the same button in different loops?

Programm is attached, the loop in question is the very first one on the left!

Cheers,

Georg
0 Kudos
Message 1 of 5
(2,585 Views)
Im not sure I completely understand your question and I cannot load your VI without the sub VI however you could always use a property node to monitor the value of the button or a local variable to pass the value of that button within that VI. (or if need be a global if it is between different VIs)

Hope this helps.
Dave
0 Kudos
Message 2 of 5
(2,585 Views)
Well, the program uses a serial communication, so it wouldn't work even with the Subvi.
Anyway, will a pressing of the button be noticed by the program if I use a property node, even if the actual execution of the vi takes place in another part of the while loop?
0 Kudos
Message 3 of 5
(2,585 Views)
The pressing of the button will be noticed by the "value" of the property node as long as it is in the same loop. For instance I have a VI I just finished to control a laser and while I use event structures I have property nodes outside that structure but within the same while loop. They just cant be in a different loop or they wont be recognized since that loop is not being handled at that time.
0 Kudos
Message 4 of 5
(2,585 Views)
Thanks for your answer, So will the pressing be noticed, even if another while loop within the while loop is being executed? No I reckon.
0 Kudos
Message 5 of 5
(2,585 Views)