11-20-2005 01:34 PM
11-20-2005 07:57 PM
Local variables are just read/write access points to front-panel controls/indicators, nothing more.
If you are expecting them to reset themselves on their own, you are misusing them.
If the user flips a front panel switch (or changes a numeric control), any local variables you have (as well as the terminal) will reflect the new value. If the user leaves them in that state, and if you don't write something different to the local variable, then they will retain that state forever.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
11-21-2005 11:16 AM
11-21-2005 11:33 AM
When you start the outer (FOR) loop, what is the value of LOOP 1 OFF?
Answer: you don't know. It's PROBABLY going to be wrong, because the first loop waits until AFTER the TOLERANCE function to WRITE it, but the top loop can READ it right away.
If all you're doing in the middle loop is a comparison, why have a separate loop at all?
Why not just compare the value after you read it?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
11-21-2005 11:36 AM - edited 11-21-2005 11:36 AM
You generate a classic race condition.
There is no way to tell if "output" in loop two is read before or after it is written in loop one. Most likely it is read before, reading a stale value from the previous iteration. Similar problem existsfor the boolean locals!
Since all loops run at the same speed, put all code in one loop and wire the "output" directly to the comparison that is currently in loop 2. No local variables needed.
Message Edited by altenbach on 11-21-2005 09:38 AM