You probably need to clarify the problem a bit better. Your VI is designed with an uninitialized shift register, but you don't have any connectors hooked up, so it seems to be the toplevel program. This means that your counter will start at a high value for subsequent runs of the same program.
What should happen after the processing has occured? Should it again happen after a desired number of steps or never again?
I think what you need is a second shift register to keep the last action index (and have both initialized to zero). Place the action case into the X case, because it can only happen if another x is encountered, right?
If an action occurs, place the index into the action index. If no action occurs, don't. 🙂
Here's a quick draft. You probably need to tweak it for the exact requirements. (I added a chart to record the various events)
You should also make sure to use a "larger or equal" comparison. If you do an "equal" comparison and you would switch the steps from 4 to 1 in a case where the comparison is already e.g. 3, the "equal" will never happen again, ever!
(Since I don't have your VISA, I substituted some code that generates x with about 25% probability. I also placed a beep in the action case)
Message Edited by altenbach on 06-30-2007 10:48 AM