horatius Posted May 8, 2008 Report Share Posted May 8, 2008 I have a SUB VI containing a loop with a feedback node that is resetted to a given initial value. If I call this Sub VI repeatedly the feedback node is not resetted to the initial value after the first call of the Sub VI. Instead the value of the last call of the Sub VI is retained and used as new initial value. How do I have to change the prg that for each call of the Sub VI the feedback node is set to the given initial value? Quote Link to comment
Ton Plomp Posted May 8, 2008 Report Share Posted May 8, 2008 QUOTE (horatius @ May 7 2008, 08:37 AM) How do I have to change the prg that for each call of the Sub VI the feedback node is set to the given initial value? Could you add a screenshot of your code? Ton Quote Link to comment
Jeffrey Habets Posted May 8, 2008 Report Share Posted May 8, 2008 QUOTE (horatius @ May 7 2008, 08:37 AM) How do I have to change the prg that for each call of the Sub VI the feedback node is set to the given initial value? You probably have the initialize terminal of the feedback node within the loop, this is a global init and will happen only once.. Something like this: To initialize with every call off the sub-vi, place the initializer on the border of the loop. Like this: Quote Link to comment
horatius Posted May 16, 2008 Author Report Share Posted May 16, 2008 thanks however I can test it only in a few weeks why is this issue not mentioned in labview help? Quote Link to comment
Jeffrey Habets Posted May 16, 2008 Report Share Posted May 16, 2008 QUOTE (horatius @ May 15 2008, 07:51 AM) thankshowever I can test it only in a few weeks why is this issue not mentioned in labview help? It is: QUOTE (LabVIEW help) Globally Initializing the Feedback Node If you do not move the initializer terminal to the left edge of a loop, the Feedback Node globally initializes. You can use a Feedback Node that globally initializes anywhere on the block diagram. If a Feedback Node globally initializes and you set an initial value, the Feedback Node initializes to that value on the first call of the VI in an execution. If you do not wire an input value to the initializer terminal, the initial input of the Feedback Node for the first execution is the default value for the data type. Each time the VI runs after the first execution, the initial value is the last value from the previous execution. The following block diagrams show the differences in value from execution to execution for a Feedback Node with a wired initializer terminal and a Feedback Node with an unwired initializer terminal. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.