06-28-2010 01:22 PM
I have a process inside a for loop, and I want to display the results of 1, 2, 3, and 4 iterations all at the same time. Is there a way to do this without creating 4 separate For loops with a different constant wired to each N?
Thanks for the help.
Solved! Go to Solution.
06-28-2010 02:06 PM
I'm quite new to LabVIEW so I'm not sure if this will work for you but I'd first try auto-indexing on the right edge of the for loop and adding a wire from the one that is already running from the "Decimate Array" to the shift register, and an indicator outside the loop. I haven't tried this with data that is already in an array but I believe that the output would be a 2-D array. It would display all the data at once after the loop completes.
Like I said no promises that it will work and if someone more experienced replies you might want to listen to them instead!
Hope it works out for you though.
06-28-2010 02:29 PM
Yes this will work. A better way of saying it, add a wire from the Decimate Array output to the loop edge, just under the shift register. Indexing should be enabled by default. Right click on the indexed output and select Create Indicator.
06-28-2010 02:29 PM
Thereare many ways to do this. In the example below use the increment to increment through the different cases. add a case for ever indicator that you what to use. The next way would be make an array of the references of the controls and send them through the loop.
In this example you jus thave to add references to the array in the order that you want them updated.
06-28-2010 02:44 PM
I recommend against the 2nd method. Property nodes are awfully slow.
06-28-2010 03:11 PM
It really depends on what you are trying to do. The second method is much easier to expand and take care of but it will be slower. If you are only going to run four iterations then it is not a problem unless you are dropping it into a loop that is constantly processing data. If you are post processing data and you do not care about milisecond timming then you should be ok with the second method.
The first method is harder to take care of but it should be the fastest way for you to get where you were asking to go.
06-28-2010 03:15 PM
Actually, wiring the output to the loop border with indexing enabled is the easiest method and is expandable without doing a thing. The array just gets larger automatically. To have separate displays, just index the array.
06-28-2010 03:34 PM
what comes to mind for me is pull down the shift register on the left side to expose as many prior iterations as you need.
06-28-2010 04:10 PM
Well, the problem also happends to be that my For loop is inside a while loop.
When I pull the 2D array out of the for Loop, because of my decimation being in the iteration, the first row has 500 entries, next has 250, 125, etc.
I decided to index the arrays to 4 1D arrays and use the split array function with index 2^(N) to separate out my data and rebuild it.
(My while loop is taking in data 1k entries at a time)
Unfortunatly I have created a lot of clutter, Is there a simpler way to do this process? please take a look at the screencap.
06-28-2010 05:32 PM
bump