Dear community,
yes, I know, there are already some suggestions of how to access variables from outside while-loops, however, none of these have worked for me so far. So: Let's say I change a variable inside a while loops each iteration (e.g. increment it by 1, or get a random number). I need this number outside the loop as well, but not only the last one, but the immediate value after each iteration. So, what I tried already was:
- using a global variable (even though this is not the best choice) - somehow didn't work! The global variable was also updated only when the while-loop finished (I guess because it is itself a VI which is access from within the loop, and then only released when the loop finishes).
- using a functional global: similar, also didn't work.
- using references. Now, this kind of works halfway. If I make an indicator (or control, doesn't matter) (say, A) outside a loop and follow the instructions of creating a reference to a variable inside the while-loop (vie ctrl reference, property node etc.), then I can see the value in A, but i cannot read or access this data/pass it on to something else.
- using queues. But then I discovered that they only work with two (or more) while-loops which run in parallel, not just outside the one while-loop I have.
There is no simple possibility to remove these loops. Also, it is not a matter of using two parallel loops - really just accessing the data from outside the loop.
Do you have any suggestions of what I can also still try?