11-02-2008 05:40 PM
I am implementing my application using state machines, and I have the following problem.
1. I have an initialized state that will initialize my controls.
2. Next I want the next state to check for user input.(boolean button will be pressed to determine which state is next).
3. In one of the states, I want the user to be able to change the initialized values, and afterwards go back to the user input state, to determine which state is next
I have implemented the initialize state as well as the user input state(use event structure for that state), but I do not know how to let the user be able to change the values of my control , then the user acknowledges the change, and the state goes back to the user input state waiting for the next state.
Thanks for any help
Solved! Go to Solution.
11-02-2008 06:08 PM
11-02-2008 09:32 PM
Thank you Ravens Fan, I did not really understand your message. I have a simplified version of what I am trying to accomplish.
1. I have 3 controls and one indicator
2. When the Vi is run , the controls should initialize to the values in the intialize state. The next state will now be the user input state.
3. When at the user input, the user can either press the "analyze button" and the result will be displayed in the indicator. or the the stop button to stop the simulation, or
4. The user can change the values of the control, after all the controls have been changed to his desired values, he can then press "accept values" and the state goes back to the "user input".
Thank you for any help
11-03-2008 07:37 AM
11-03-2008 10:09 AM
Thanks for the input. I found out that the earlier post by Ravens Fan actually solves the problem. When I change my values, and click the accept values, the initialize state will be called again. The initialize state will accept the control values.
The only thing I did not understand is putting a wait statement on the user input state. I was under the impression that the event case itself is a waiting statement.
Thanks.
11-03-2008 11:09 AM
I didn't realize you had any event structure going on. Yes, the Event structure will create a pause while it waits.
Check you conditions for your next state. You start with Initialize. The initialize state is calling Initialize again. There isn't anything there to cause it to move to the next state. I think that should be calling User Inputs.
In the user inputs state/Accept Parameters event, I would think you want to call initialize, not User inputs again.
I would recommend mapping out what all of your states are on a piece of paper, and what are the possible transitions to other states and what would cause them. Then it will be easier to make your code match what you want it to to.
11-03-2008 12:48 PM