03-21-2012 08:22 AM
I never expected a difference between Array1 and Array2 in the attached vi.
In the feed back version, if the incoming array is all false, Feedback indicator is not initialized to empty, and Array2 contains stale data.
03-21-2012 08:28 AM
You never clear "Feedback" before starting.
Mike...
03-21-2012 08:29 AM
Can you explain what you are asking about in a bit more detail?
Show what you are getting and what you expect the results to be.
The VI you attached is missing a tunnel assignment, and doesn't match the VI image you have posted.
03-21-2012 08:36 AM
Dang it, sorry about the attached. I was trying to be nice by back versioning the source code, but I went beyond the feedback node feature.
I don't really have a question, I just expected the initializer to intialize Feedback (and Array2) to empty, regardless of if the true case ever executed.
My bad, and a heads up to others.
03-21-2012 09:04 AM - edited 03-21-2012 09:04 AM
@beavercreek wrote:
Dang it, sorry about the attached. I was trying to be nice by back versioning the source code, but I went beyond the feedback node feature.
I don't really have a question, I just expected the initializer to intialize Feedback (and Array2) to empty, regardless of if the true case ever executed.
My bad, and a heads up to others.
I don't know why you'd expect an initializer to initialize something back to empty after code has executed. The initializer only operates on the feedback terminal when it executes. Once you get into your For Loop, the initializer terminal never comes into play again.
One problem with your code is that your terminal is at the output of the feedback node rather than the output of the build array. So the data going into the feedback array indicator is always from the last iteration where the boolean was true, not the current iteration.
If you want to get the data in the array indicator after the for loop is done, then I would use the variation with the shift register, and not use the feedback node. Or if you use the feedback node, use the initializer terminal on it, then it isn't necessary to have the case structure and you can wire the data directly out to an indicator outside the for loop.
03-21-2012 09:24 AM
>One problem with your code is that your terminal is at the output of the feedback node rather than the output of the build array.
Oops, see first post png, was playing around trying to get the behavior I expected.
How did you get that question mark thing on your feedback indicator and what is it? (you have the boolean wired to it)
03-21-2012 11:07 AM
Right click on the feedback node and pick "Show Enable Terminal."