LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get a For loop to display the results of each iteration?

Solved!
Go to solution

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.

0 Kudos
Message 1 of 14
(5,918 Views)

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.

Message 2 of 14
(5,900 Views)

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.

 

- tbob

Inventor of the WORM Global
Message 3 of 14
(5,875 Views)

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.

 

17587iC19EE8F5A3AF1D26

 

 

In this example you jus thave to add references to the array in the order that you want them updated.

17589iBE1B298DC909B89C

Tim
GHSP
Message 4 of 14
(5,874 Views)

I recommend against the 2nd method.  Property nodes are awfully slow.

 

- tbob

Inventor of the WORM Global
Message 5 of 14
(5,862 Views)

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.

Tim
GHSP
Message 6 of 14
(5,847 Views)

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.

 

- tbob

Inventor of the WORM Global
Message 7 of 14
(5,844 Views)

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.

0 Kudos
Message 8 of 14
(5,830 Views)

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.

0 Kudos
Message 9 of 14
(5,818 Views)

bump

0 Kudos
Message 10 of 14
(5,792 Views)