.T1 {color:blue; font-weight:bold;} .T2 {color:black;} .T3 {color:green;} .T4 {color:red;} HEAD; require_once( '../header.php' ); ?>
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