Chapter 28. Sequencing runs

The NSCL Run sequencer provides a mechanism for scheduling as series of timed runs. Prior to the start of each run, the sequencer allows custom actions to be taken. While these actions normally set up hardware, there is no actual requirement this be the case. Any parameterizable action can be taken.

For a full description of the sequencer, see its reference manual page.. This chapter gives an overview that describes how to use and configure the sequencer.

28.1. Configuring the sequencer.

The sequencer requires the following configuration work:

Furthermore, each action must provide Tcl code that executes it and, optionally initializes its access to whatever it might control.

The actions are defined in a file named sequencer.conf in the current working directory at the time the sequencer starts. This file describes one action on each line. Each sequencer line contains several whitespace separated fields. In order:

When the sequencer starts it will source in the Tcl script file sequencerActions.tcl from the current working directory. This file contains arbitrary Tcl scripts. It is expected to define all of the action procs described in sequencer.config.

Run plan files can be created graphically in the sequencer table. Simply edit each cell of the table with the appropriate parameter for that run and that action. The File->Save... menu selection allows yoj to save run plans for later (re)use.

Run plan files are plain text files. Each line contains the parameterization of a run. Lines contain whitespace separated fields where each field is a parameter value for a run.

The run sequencer must be integrated with the Readout GUI. This is done by providing (or modifying an existing) ReadoutCallouts. See the Readout GUI reference page for information about how the readout GUI locates its ReadoutCallouts file.

The sequencer is provided as a Tcl package located in the TclLibs directory tree of the NSCL DAQ installation. To load it you will need to have this directory in your Tcl Load path. This can be done either by setting the TCLLIBPATH environment variable, or by having ReadoutCallouts.tcl add the appropriate directory to the auto_path loader list.

The example below takes a hybrid approach. We assume you've set an environment variable DAQROOT to be the top level directory of the NSCL DAQ installation. At this NSCL, this might be /usr/opt/daq/9.0 for example. The example shows additions to the top of the ReadoutCallouts.tcl script that make the sequencer package loadable, and load it:

Example 28-1. Loading the sequencer package


set daqroot $env(DAQROOT)                (1)
set libdir [file join $daqroot TclLibs]  (2)

set auto_path [concat $libdir $auto_path] (3)

package require runSequencer             (4)

	   
(1)
The global env array contains a copy of the environment variables indexed by variable name. This line gets the DAQROOT environement variable.
(2)
The Tcl file join joins filename path elements inserting the appropriate path separator, and quoting if needed. This line constructs the name of the directory in which NSCL DAQ packages are found.
(3)
This line pre-pends the NSCL DAQ Tcl library directory to the list of directories (auto_path) searched by the Tcl. Prepending ensures that if there are any package name collisions, the NSCL DAQ packages will be found first.
(4)
This line actually loads the sequencer package. By the time this line finishes, the sequencer configuration files, and action scripts will have been read, and the sequencer user interface created.