11-07-2008 08:51 AM
This may be a question that has a painfully simple answer, but I can't seem to make heads or tails out if it. What is the value of writing a VI that contains a while loop that uses the Continue if True terminal and then wiring a False constant to it. I have seen this in several places in both NI example code and in some of their function VI's, most recently where I am using the PID functions. If the loop is guaranteed to iterate only once, then why use the loop structure at all? My feeling is that it is use for VI memory allocation or creating references to a VI that is expected to run more than once in the calling VI, but that is as far as I can guess about the value of this type of programming architecture.
Thanks
Eric
Solved! Go to Solution.
11-07-2008 08:55 AM
Because the values stored in unitialized shift register.
For example look here: Basic Functional Global Variable Example
Andrey.
11-07-2008 08:55 AM
Eric,
this is a special architecture for VIs to contain data. This architecture has several names:
Functional Global Variable
Lab-2-style Variable
Action Engine
You can find lots of information on this if looking around on ni.com and even in this forum.
hope this helps,
Norbert
11-07-2008 09:25 AM
11-07-2008 11:22 AM
11-07-2008 11:31 AM
> I would never wire a false constant to Continue if True.
> I always wire a true constant to Stop if True!
It depends from the optimistic or pessimistic principle...
"...To the optimist, the glass is half full.
To the pessimist, the glass is half empty.
To the architect, the glass is not big enough..."
🙂
Andrey.