LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I'm creating an array using a for loop, how do I get the values outside the loop while it is running? thanks

I'm creating a set of values using a for loop and a shift register inside the loop. I want access to these values outside the loop as they are being created inside. When I connect a wire from the shift register to a display outside, it doesn't work. How do I do this? Thank you.
0 Kudos
Message 1 of 4
(3,031 Views)
You must create an indicator inside the for loop that is wired to the same wire going to the shift register. Once that indicator is created, right click on it on the block diagram and Create>>Local Variable. Place that local variable anywhere to access the current value of the indicator. NOTE: You can set a Local Variable to "Read" or "Write". Set this by right clicking on the Local Variable. For your case, you should set it to read.

Hope that helps
0 Kudos
Message 2 of 4
(3,031 Views)
I tried to create the local variable that was wired to numeric indicator inside the loop. If I try to connect this to the analog output outside the loop, the loop just starts blinking and nothing happens, am I doing something wrong? Thanks again.
0 Kudos
Message 3 of 4
(3,031 Views)
Well..

One way you can do this is to wire an indicator inside the loop, and then use a local variable (set to READ) outside the loop. However, this can be pretty lame from a speed point of view, if your array is being created on the fly.

It might be worth a try though. Otherwise, you might want to disable indexing and see if that works for you
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 4 of 4
(3,031 Views)