LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

loop external control

Solved!
Go to solution

hello

is there an efficient way to control loop externaly?

if i try to control a while loop and my stop button is outside the loop it doesnt work.

if i use local variable inside the while loop it does work but the loop execution is not fluent.

 

is there a good way to control the loop from the outside?

0 Kudos
Message 1 of 6
(3,274 Views)
Whatever you use to stop the loop has to be inside.  You don't need a local variable, you can just put the control inside the loop.  Not sure what you mean by fluent.
0 Kudos
Message 2 of 6
(3,269 Views)
You can use an event to stop all runnin gloops in a program. Read up on events it sounds like a good way to go for you.
Tim
GHSP
0 Kudos
Message 3 of 6
(3,257 Views)

hi veteran

the stop inside the loop should have effect on other things outside the loop.

if i connect that stop button/local variable to events outside the loop then the data i read into the array is not in millisecondes resolution since the program also checks the effect of the stop on the outside action.

 

does event solve thise problem?

0 Kudos
Message 4 of 6
(3,232 Views)

jackedi,

 

Can you explain what you are trying to do. Maybe you can do do everything inside a loop and case structure combo.

0 Kudos
Message 5 of 6
(3,230 Views)
Solution
Accepted by topic author jackedi
You can send an event to many different loops. You will have to register them to each loop. Once you figure out how to use events they are a very useful tool. There are examples here in the forum. If you need help finding them let us know and someone will help you find refrerences.
Tim
GHSP
0 Kudos
Message 6 of 6
(3,213 Views)