Showing results for 
Search instead for 
Did you mean: 

Output value outside of loop immediately after each iteration

Hello NI Community,


I apologize if this is a basic topic or has been covered, but I did much searching and found no help relating to my specific issue. Please direct me to the proper location if need be. So what I need to do is output the value from within a loop, to outside of a loop in real time; not in an array but a single constant that updates with each iteration.


I need this functionality for my VI which I need it to do the following:

A text file containing numbers is read in using the read in spreadsheet block. A while loop iterates through each value, reading them in, one at a time. As of the moment, the stopping criterion is to continue iterating through until a predefined index is reached (will make more sense from the vi).


So the issue I am having is that  the “element value” indicator on the right of the loop only reports the last value read; I know this is “technically” correct since the tunneling mode is set to last value. The values correctly iterate through within the loop, but I need this to happen outside of the loop. Which is the reason for my original inquiry.


One approach I thought of was somehow reading the text file at each loop to bring in the next value at each iteration; however, I read on other NI Forum threads that this is resource intensive and pointless (I do not know myself I am trusting the advice of experienced LabView users). Another approach I came across  on NI Forums was utilizing parallel loops and indicators. I looked further into this and I tried experimenting with the “Simple Notifier” example in LabView and I am still unclear on what to do.


The critical reason I need this functionality is because this VI will be interfacing with battery charging equipment at the output of the loop (a LabView instrument for control block will replace the “element value” block indicator) which for example will output predetermined current values one at a time from a text file. Please let me know if there is anything else I can clear up. Thank you in advance and sorry for the long post.

Download All
0 Kudos
Message 1 of 2
If you write the 2D array to a for loop, it will auto-index as you have it now and you simply use the index array function. Put the instrument control functions inside the loop.
0 Kudos
Message 2 of 2