01-27-2012 06:35 AM
Hi
I have a feedback node sat in a For Loop, the number of iterations is determined by an input array. The same input array is wired to the initializer terminal of the Feedback node. The Feedback node delay is set to 3 and yet the output of the node only contains the first value of the array for the first 3 iterations. It's easier to show than describe.
So I would expect the output Array to contain the values 3,1,0,0,1,2 yet it actually contains 3,3,3,0,1,2
If I wire the scalar value 99 to the initializer then I get the expected 99,99,99,0,1,2
What am I missing ?
This is LabVIEW 2011 for MAC OS X
Solved! Go to Solution.
01-27-2012 06:53 AM
Hi Chris,
This is how I see it, the initialise will set the initial contents the first time the feedback node is run, the delay will then output that initial data for however many times it's set to (3 in your example)
I have to admit I haven't had a play with the extras on feedback nodes
Hope this helps, if I've got the wrong end of the stick prod me!
Regards
Steve Watts
SSDC Ltd
Steve
Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop
01-27-2012 07:10 AM
I'd say that swatts hit the bullseye!
01-27-2012 07:11 AM
Hi CRoebuck,
The name Initialize itself signifies that it will be executed only at the first execution. I really wonder how a CLA gets into this simple confusion.
01-27-2012 08:36 AM - edited 01-27-2012 08:37 AM
To expand on Swatts answer a bit more. You are actually only initializing the feedback node with a single element because you have the array auto-indexing at the loop tunnel.
If you fed the entire array into the For Loop and the initializer terminal, it would have worked the way you expected.
01-27-2012 11:03 AM
ha ah , the penny finaly drops. That was the differnce between the original problem code and my poor replication of it.
The auto indexing tunnel, totally failed to spot it. Too busy looking into the feedback node, a feature of which I have little working experience. Thanks to everyone who made +ve contributions towards my enlightenment 😉
01-27-2012 11:10 AM
It's easy when you focus on the output, Wood from the tree's and all that.
01-27-2012 01:37 PM
What Ravens Fan said is hidden in plain sight in the detailed help for Feedback Nodes.
"Note When you set Delay to two or more executions or iterations, you can wire an array to the initializer terminal to initialize each delay element to an arbitrary value."
Lynn
01-28-2012 04:22 PM
11-07-2012 10:35 AM
@Darin.K wrote:
Actually if you move the initializer one loop out not only does it look better, but this sort of thing won't happen.
moving it out 1 loop disables the "globally initialize" on "first call" options that the OP selected. (Of course that might have been an additional unintended bug that moving the initiallizer would prevent as well):smileysurprised: