LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display Current Sequence Frame?

I'm trying to output the current/active sequence frame to a front
panel indicator. Is there a direct way to hook into the sequence
structure indicator, or will I have to stich a increment function
throughout all the frames with multiple sequence locals. It would be
nice to be able to programatically access the sequence structure's
total frame count and current frame for use as a program progress
indicator.
0 Kudos
Message 1 of 3
(3,095 Views)
You could replace the Sequence structure with a Case inside a While loop. Wire the iteration of the While loop to the Case selector and to the terminal for the front panel indicator. Each case represents one frame in the Sequence. Each case will have a boolean constant wired to the Continue terminal of the While loop: in each case but the last, the constant will be True; in the last case it will be False.
Sorry this isn't the simple answer you were looking for. This approach also works well if you have a sequence which you normally execute end-to-end, but, for some conditions, you may want to end the sequence early. Then just replace the boolean constant with a boolean expression within each case that determines whether or not to continue based on the events i
n that case.
Message 2 of 3
(3,095 Views)
Take Al's advice. Even with sequence locals, you'd have to add a local variable inside each frame of the sequence to display which frame you're currently in. Once you've done a case statement inside a while loop, you can then take the next step and implement a real state machine. A state machine can perform just like a sequence structure - execute a number of steps in a fixed order, but also gives you a lot of options like changing the execution order on the fly, spectial error handling, early termination, etc.
Message 3 of 3
(3,095 Views)