LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

updating a value in a while loop

My question is how to update a variable inside a continuosly running while loop, from outside the loop.
Is it possible to run two routines in a VI runnin at the same tyme i.e. a while loop side by side running with another routine in the same VI .
one routine may be of using a while loop(exectuing continuosly, never ending) while other routine may be of getting a value from the user at runtime and feeding the value into the while loop.
 
0 Kudos
Message 1 of 4
(3,915 Views)

Sharjil,

For loops running in parallel, try looking at the templates of producer/consumer or master/slave loops.  Try File>>New... and then select VI>>From Template>>Fameworks>>Design Patterns and look for what best fits your application.

For feeding live data into running loops, you can try references.  For example, if you have a numeric somewhere outside and you want to use live data from that numeric in the loop, right-click the numeric, Create>>Reference, and place it in the loop.  Then go to Programming>>Application Controls in the Functions palate and select Property Node.  Wire the reference to the reference in, right-click the drop-down to make it read or write as appropriate, and then left-click and select what you want.  It sounds like you want the value of the referenced numeric.  Then use the node output.  An example VI is attached.  While the loop is running the numeric updates from outside the loop.

I hope that helps.

David C
Applications Engineering
0 Kudos
Message 2 of 4
(3,910 Views)
I cant open up the given file,because i got Labview 8.0.So can u plz send this file in such a format that i can open it up in Labview 8
 
0 Kudos
Message 3 of 4
(3,891 Views)
Sharjil, try this version.
David C
Applications Engineering
0 Kudos
Message 4 of 4
(3,832 Views)