09-24-2009 10:04 AM
I want to acess the value of a variable outside a loop even befor the loop is over So i am trying to creat a local variable and use it to transfer data outside the loop to do processing simulataneously online.
However i am only able to update one indicator outside the loop with the updated variable name..but if i draw a wire from there to do some processing the value in the wire is not updated...
I have tried two versions and updated the same..only one numeric indicator gets updated..numeric2 is always not updated..why?
how can it be solved?
Solved! Go to Solution.
09-24-2009 10:05 AM
09-24-2009 10:10 AM
Of course Numeric 2 is not updated continuously. It's only executed once since it's not in any kind of a loop.
You should take the free LabVIEW tutorials.
09-24-2009 10:29 AM
I understand that numeric2 is not in any loop .
BUt even if i put two loops and try to pass the value from inner loop to outer loop immedieately the data does not seem to be flowing..even though i have made it as a local variable.
please see the attached vi.
09-24-2009 10:35 AM
Hi siva,
did you read Dennis' message? Have you looked through the free online courses?
When you would have done so, then you would be testing your vi in "highlight" mode. And then you would have seen, that the local is only read once (probably before the inner loop starts). Then it will be read again after the inner loop has been finished...
09-24-2009 10:40 AM
During iteration of the inner loop the outer loop will not update. See example for a quick fix LV 8.6.1. Try not to use local variables unless absoulutely necessary.
09-24-2009 10:46 AM
thanks for the update..But is ther eany other alternative to local variables.?
I did try to acess the free tutorials but i see only getting started stuff and basic tutorials..
09-24-2009 10:53 AM
siva0182 wrote:thanks for the update..But is ther eany other alternative to local variables.?
I did try to acess the free tutorials but i see only getting started stuff and basic tutorials..
I wrote this Nugget on Action Engines to answer just that question.
Have fun,
Ben
09-24-2009 11:00 AM
I usually only use to initialize a control on startup not to pass data. We usually pass data through a queue which adds a level of complexity, but gives you control of your data. The problem with locals is if you use multiple locals in multiple places all linked to the same indicator you lose control of data timing. Even worse if you write to it in multiple places. If your just using it in one place in a simple application where update timing and such aren't critical then it should be fine.
09-24-2009 11:00 AM - edited 09-24-2009 11:01 AM