02-24-2009 03:03 PM
I have a sequence structure in Labview 8.6. At one frame of the sequence I have a while loop. The loop runs for a while and then stops and the program then moves to the next frame of the sequence. Several frames further on down the sequence I have a cluster, the elements of which are outputs on the front panel. The index of the mentioned loop is one of the cluster elements, an numeric output. While the loop is running, I want the index to be displayed on the front panel in the output contained in the cluster. How can I do this?
02-24-2009 03:06 PM
You can connect the "i" to be a (non-indexed) loop output, and then connect that to a build cluster anywhere. Does that answer your question or would you like an example?
02-24-2009 04:35 PM
The easiest way to do this is to use a local variable of your cluster. You'll need one copy set to read; connect that to a bundle by name, bundle in your index value from the loop, and wire the bundle output to a write copy of your local variable. You can create a local variable by right-clicking on the cluster terminal (in the block diagram) and choosing create local variable. You can change the local variable to read or write by right-clicking on it.
However, in general the use of both local variables and sequence structures is discouraged, and the right solution may be to rewrite your code with a while loop containing a case structure in which you update the cluster every time through the loop. This will look like a state machine; you'll also need a shift register in place of the loop iteration counter. If you post your code (ideally the VI, but if not then a screenshot of the block diagram) then we can provide more useful assistance.