Program your own Finite State Machine using a SPLat Controller for only $29.00.
The EC1 "EasyOne", a 32-bit fully featured SPLat Controller with USB and true multi-tasking is a easy way to learn and a cheap way to build your project.
VB.NET - State transition handling
The sub listed below performs the switching from one state to another. It is called with the destination state number as an argument. It updates the global state number and the diagnostic state indicator. Then it does a Select Case on the new state number and performs the entry actions.
Private Sub SetState(ByVal NewState As Integer) 'Switch to a nominated state, doing all the entry action stuff State = NewState 'Update the global state number Label2.Text = "State = " & State 'Diagnostic display Select Case State 'Actions depend on the state we are entering ... Case 0 HeaterOut(False) AlarmOut(False) Case 1 HeaterOut(True) StartTiming(60) Case 2 HeaterOut(False) AlarmOut(True) End Select End Sub