LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

while loop termination...

So I have this long sequence of frames and I have an while loop which runs outside of the sequence. I want to to terminate the while loop after the last frame of the sequence  has completed. I tried to wire a logic true constant from the last frame to the  while loop but it does not  work because the while loop seems to terminate prematurelly.  Could someone sugguest  a way of dealing with it? I can' figure out a solution for some reason.





0 Kudos
Message 1 of 4
(2,825 Views)
Are you referring to the code you posted here?
0 Kudos
Message 2 of 4
(2,824 Views)
yeapSmiley Happy
0 Kudos
Message 3 of 4
(2,822 Views)
Then the answer is, as with the other case, data dependency. If you wire a value out of your sequence frame into the while loop you've established a data dependency for the while loop since the while loop needs to know what the value of that wire is before it can execute, and the value is not set until the sequence frame ends.

Since your while loop houses an event structure, generate an event at the end of your sequence frame to stop this parallel loop. A crude solution: Wire a True value to the "Value (Signaling)" property of the "Stop" control, and change the event case from "Mouse Up" to "Value Change". You should make sure to initialize the "Stop" button to False at the start of your program, and to change the mechanical action to "Switch When Released":
0 Kudos
Message 4 of 4
(2,814 Views)