04-27-2016 10:00 PM
I am wiring an array into a while loop and changing values within the array as the loop continues, but periodicaly the array within the loop will semingly reload the initial array. This is throughing a lot of my programing off because the end of the while loop is triggered by all of the values within the array I am altering equaling zero. Does any one have ideas on how I can prevent the code from sending the array into the while loop after the first time it is loaded?
I have uploaded som pictures that I hope will make it a little more clear what I am talking about. It currently works using a shift register to wire two values back to the array that was initialy imported in, the two values are then used to replace a value currently in the array.
Thanks for the help!
04-27-2016 11:14 PM
You need the array itself to have a shift register.
04-27-2016 11:54 PM
That makes a lot of sense, Thanks! Can I just shift register it to itself?
04-28-2016 12:52 AM
04-28-2016 10:48 AM
@meismine wrote:but periodicaly the array within the loop will semingly reload the initial array.
There i no "seemingly" any changes to the array within the loop are lost when the next iteration starts. So yes, the array belings inside a shift register.
OTOH, the other two shift registers seem a bit unusual, don't you want to modify the array once you have current values, i.e. as the last operation inside the loop. Now you don't even need these two shift register.
Sorry, attaching puzzle pictures of code is not very useful to us and we might miss some subtleties. Next time just attach the actual VI! Thanks.
04-28-2016 11:33 AM
Absolutly, I wasnt entirely sure what the protocol on this sort of thing was. If you would like to see it here is the updated vi and its sub vi.
I made the changes that you recomended but I think that the replace array function will still be nessesary. Would removing the shift register for bringing the two values around have any benefit aside from cleaning the code up?
04-28-2016 05:54 PM
04-28-2016 08:11 PM
Koolio, I will make the change. Thanks for your advice!