06-29-2007 08:11 AM
07-02-2007 05:02 PM
07-03-2007 08:13 AM
@NW wrote:
i also have another question,when you master of lv said something about" I am pretty sure that's intentional. PID needs current and previous values to decide how to regulate (not that I am an expert here). Also the loop only runs once per call" how do i correct this problem,
When using a loop with an un-initialized shift register, it is referred to a "Functional Global". The purpose is that the first time you call the function (or VI), it sets the un-initialized shift register to the default value for the data type wired to it. Example, numeric = 0, Boolean = FALSE, etc..
For any subsequent calls to the same function / VI, the value at the input shift register is the one which was written to the shift register during the last call. WHich means it remembers the previous value. The only way to reset it is to remove the VI from memory (usually closing LV), unless there is a state which initializes the shift register or resets it.
You would have to define "correcting the problem" because the implemention was likely done this way on purpose. Describe what you want to do with this function in more details. Also, do a search on Functional Global, I'm sure there are some explanations and examples available..
RayR
07-03-2007 08:27 AM
Here's a couple of links to Functional Global (descriptions, etc):
http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=2736
http://forums.ni.com/ni/board/message?board.id=170&message.id=71178