Howdy all,
Here's the scenario(I've included a sample VI that reproduces the scenario described, so you can download and read that if you prefer): A tab control is being used to structure the user interface so that the user only addresses the controls that are immediately relevant (like breaking down a complex process into multiple stages, like a wizard). The tab control is transparent and the visible tab is programmatically changed (local variable or property node) after the user is finished with each screen (for example, they might press the "Next" button).
The tab switches are implemented in a state machine of sorts: There is a while loop with a case structure inside. Each case of the case structure handles a different state of the machine (and displays a different tab of the tab control). The main while loop has a shift register that holds an enumerated constant that indicates the current state of the machine, and thus the visible tab. At each iteration of the main loop, this shift register is read, and the tab that corresponds to it's state is loaded(using property node or local variable to set the tab value).
Each state of the machine has it's own event handler inside it's own while loop. When the state change action is detected, it terminates the event handler while loop and passes a new value to the State shift register(in the main while loop) to indicate the next state.
If there is no processing after the state change event has been handled, the states will switch no problem. However, if there is any delay whatsoever (like there would be if there is any type of processing that happens between states), double clicking the state change event button will switch the tab, but then freeze the VI completely and nothing short of aborting the VI will bring it back to life.
The Zip file attached contains two VIs, one that demonstrates the problem, and my current (though not ideal) solution - If the visible tab is changed in the event that handles the state change, rather than the next iteration of the loop, the program won't freeze.
I was hoping someone could give me some input - what is the cause of this bug? Has anyone seen this problem before? It seemed to me like this was a perfectly valid implementation of a state machine... am I doing something that is taboo and everyone knows you shouldn't do? Thoughts, ideas and comments are welcome.