NGIS II SIM Specification
The concepts for this section were discussed at the 18-Jan-98 working group meeting. It has not been reviewed in detail by the group, but is included here to reflect the working group’s latest efforts.
This section describes the state transitions of an NGIS SIM. The transitions are caused by external actions and internal events. External events are application program invocation of API methods and sync bus events. Internal events are periodic SIM timers, input channel thresholds, and internal SIM actions, e.g. resulting in state transition from EXECUTING to DONE or from EXECUTING to ERROR.
Figure D-1 illustrates the sequence of states and state transitions that a typical NGIS controller would encounter. Upon startup the controller is in the POWERUP state. This state assumed that the SIM hardware also has power.
The SMLoad method causes a state transition from the POWERUP state to the LOADED state. The action associated with this state transition would is to load the SIM executive from disk into the SIM RAM. This state transition may be optional if the SIM supports a ROM kernel, however, all SIMs must support this state transition even if no kernel loading from disk is necessary.
In the LOADED state the Controller Executive can invoke the SMStrap method to establish hardware communications with the SIM. The method SMRestart causes the state transition from the LOADED state to the READY state. The action associated with this state transition is for the SIM Manager to reset all the internal variables and clear the SIM Task. The SIM Manager can be commanded to import operating parameters from a disk file using the SMConfig method.
SMCreateTask causes the state transition from the LOADED to the CONFIGURING state. The action associated with this state transition is to create a new SIM Task that the controller can then configure. Four classes of methods can configure the SIM Task.
The SMStartSimTask method causes the transition to the RUNNING state, in which the SIM is actively monitoring to respond to external triggers, and to generate sync bus and output events. Monitor methods can be invoked while the SIM is RUNNING. The FIFO is accessed first by using SMStopSIMTask, and then DRRetrieveData. SMStartSimTask clears the FIFO and puts the SIM back into RUNNING. SMRestart causes the same state transition but preserves the FIFO.
All SIM parameters and configuring information persists until the SIM Task is deleted, using SMDeleteTask.

Figure D-1. SIM State Diagram