Sub-system Control Class Requirements

Each sub-system, XXX, interfaces to experiment control by means of a python module named XXX_ctrl. This document defines the requirements that those modules must fulfill. Most modules follow the 'standard' set of requirments set out here. Exceptions to the 'standard' set, e.g. the start method of the daq_ctrl module has parameters, are documented at the end of this document.

The Sub-system State Machine

Experiment control uses the following state machine to control each sub-system.

The Sub-System state machine, as seen by experiment control.

This requires the XXX_ctrl module to support four methods related to the state machine:

  • getState : This returns the element of the ec_states enumeration for the sub-systems current state.
  • start : Upon return from this method the sub-system state, as determined by the getState method, must be in either the STARTING, STARTED or ERROR state. If the sub-system in not in the STOPPED state when this method is invoked, it must raise the ec_state.ILLEGAL_TRANSITION exception along with its current state. The integer return value of this method is the amount of time, in seconds, that the sub-system may be in the STARTING state after which it is considered to have failed to transition into the STARTED state.
  • stop : Upon return from this method the sub-system state, as determined by the getState method, must be in either the STOPPING, STOPPED or ERROR state. If the sub-system in not in the STARTED state when this method is invoked, it must raise the ec_state.ILLEGAL_TRANSITION exception along with its current state. The integer return value of this method is the amount of time, in seconds, that the sub-system may be in the STOPPING state after which it is considered to have failed to transition into the STOPPED state.
  • recover : Upon return from this method the sub-system state, as determined by the getState method, must be in either the RECOVERING, STOPPED or ERROR state. If the sub-system in not in the ERROR state when this method is invoked, it must raise the ec_state.ILLEGAL_TRANSITION exception along with its current state. The integer return value of this method is the amount of time, in seconds, that the sub-system may be in the RECOVERING state after which it is considered to have failed to transition into the STOPPED state.

If a transition returns with a sub-system in a 'present participle' state, i.e. STARTING, STOPPING or RECOVERING, experiment control will only continue to allow the sub-system to remain in that state for a definable time, after which the sub-system is considered to be in an incorrect state.

High Level Montoring

The getState method is used by experiment control to fulfill part of its high level monitoring responsibilties, there rest of those responsibilities are fulfilled by the getSummary method. This method returns an XML snippet that contains all of the summary data appropriate to that sub-system.

Each sub-system will have its own element which matches the XXX of the sub-system. Thus the currently supported elements are the following.

  • <daq/>
  • <twr/>
  • <sn/>
  • <pnf/>
  • <spade/>
  • <cluster/>
Note:
The XML schema for the complete detector-summary.xml file, of which the returned snippet must be part of, has yet to be defined.

Exceptions to the 'standard requirments

The daq_ctrl module's start method take as its parameters the run number and DAQ configuration key.

The daq_ctrl module must support an additional flasher method, whose signature has yet to be defined.