Quote:
Originally Posted by Jon236
Greg,
I'm curious....why does the PID.vi itself use a regular while loop, rather than a timed loop?
|
In this case, the While loop is actually not used to loop the PID function (if it were, the PID function would never get new inputs). It is instead simply for its shift registers. Note that the loop is set to end on the first iteration, and none of the shift registers are initialized (meaning they retain their values between calls).
It is also a reentrant VI, storing the shift register data separately for each instance.
The other way to accomplish this is to use feedback nodes (found in the structures palette). However, shift registers often create cleaner and more readable code, and so are more commonly used.