12-01-2014 04:34 AM
Hello,
I need output data (several array string) from FOR-loop to 2D array. I use Replace array subset inside the loop (after array initialize). Output works (I see each step right string in its right place), But each next loop clear all previous strings to 0 0 0 . Finally stay only the last string in result array (see fig). Output to file works perfectly.
Similarly, no result outside of loop.
WHY?
I'm beginner...
Solved! Go to Solution.
12-01-2014 05:38 AM
You use the same starting array each time, not the last updated. Initialize the array outside the loop and set the crossover to the loop as shift register. Then, as now, use the replace array and feed the output to the right side shift register.
/Y
12-01-2014 06:47 AM
Thank you.
Now out_array 4 is right.
But outside Out_array 2 and Out_array are empty (grey zero fields).
When I change tunnel mode for Out_array to Indexing - "different dimentions" error appear.
How to use out_array 4 - data outside the loop?
12-01-2014 06:55 AM
Hi zazra,
But outside Out_array 2 and Out_array are empty (grey zero fields).
THINK DATAFLOW!
Those two array indicators stay empty UNTIL the FOR loop finishes!
How to use out_array 4 - data outside the loop?
Either finish the FOR loop - or use a local variable (as easiest, but not the only solution)…
12-01-2014 07:01 AM
That sounds impossible. Can you post the VI?
/Y
12-01-2014 07:03 AM
Those two array indicators stay empty UNTIL the FOR loop finishes!
Its are grey with finished loop.
12-01-2014 07:15 AM - edited 12-01-2014 07:43 AM
deleted
12-01-2014 07:42 AM
Here permutations.vi
12-01-2014 07:57 AM
It's because you're programmatically aborting execution of your VI instead of stopping the For loop properly. Make your For loop conditional (right click on it and select Conditional Terminal) and wire that to where your current Stop is.
12-01-2014 08:02 AM
Awesome, it is. Thank you!