rdo_control

Name

rdo_control -- Control a Readout via ReadoutREST

Synopsis

$DAQBIN/rdo_control rdo_host rdo_user subcommand [parameter...]

DESCRIPTION

Performs an operation defined by subcommand on the REST interface of a readout program running in rdo_host, run by rdo_user. Note that in general, rdo_user is going to be the same as the user that started the DAQ manager if this readout program was started by that manager.

Some set of subcommands require additional parameters as shown in the SYNOPSIS. These parameters will be described below.

The subcommands currently supported are:

begin

Begin data taking. This requires no additional parameters. Note that for this to succeed, the Readout must be in a state where it's legal to begin a run.

end

Ends data taking. This requires no additional parameters. For this to succeeed, the Readout must be in a state where it is legal to end a run.

init

Initializes the hardware controlled by the Readout. This requires no additional parameters.

Note that some NSCLDAQ Readout programs do not support this. If that is the case, they return a success status from the REST request and just don't act on the request. This operation requires no additional command parameters.

shutdown

Calls on the program to exit. In practice, Readout should first return a success or failure status before exiting or scheduling an exit for a later time soon in the future. This operation requires no additional command parameters.

incRun

Adds 1 to the current run number. Note that the run number is only looked at at the beginning of the run. This operation requires no additional command parameters.

setRun n

Sets the run number to the specified value. An additional parameter that must be a counting number is required on the command line.

setTitle word1...

Sets the title to a specific value. The command accepts an arbitrary number of additional command words. These are space separated and become the title. Quotation marks can be used to apply additional or different spacing.

getRun

This operation requires no additional command parameters. It outputs the current run number to stdout.

getTitle

This operation requires no additional command parameters. It outputs the current title to stdout. Note that the result is not quoted. e.g. This is a title rather than "This is a title".

getStatistics

Outputs the Readout's trigger statistics in a human readable table.

EXAMPLES

Example 1. Using rdo_control To Begin A Run


$DAQBIN/rdo_control localhost fox begin
        

In this case the Readout program is in the host the user fox is typing this command in.

Example 2. Using rdo_control To Set A Title


$DAQBIN/rdo_control localhost fox setTitle This is my new title
$DAQBIN/rdo_control localhost fox setTItle "This title    has   " extra spaces
        

The example shows that titles with simple spaceing, that won't invoke shell substitutions, can just be provided as a bunch of words on the command line. If special spacing is required, or shell substitution needs to be ignored, one or more title words can be quoted.

Example 3. Using rdo_control To Get Trigger Statistics


$DAQBIN/rdo_control locahost fox getStatistics

           Triggers Accepted Triggers Bytes
perRun     0.0      0.0               0.0
cumulative 0.0      0.0               0.0
  

        

Note that the trigger statistics are given in a human readable table. To get computer readable statistics, a direct REST request can be made by your program and the resulting JSON processed.

TO DO

It is the use of the default REST service name in this and other programs that restrict us to a single Readout program per host/user pair. This restriction should be removed at some point by allowing users to specify the REST service used by programs and using that to select the actual service name.

It shoulid be possible to also have a utility that accepts as parameters the manager host, manager user and Readout program name to specify the Readout to use. This is more consistent with the other rdo_* and will work in the event a Readout is migrated to a different host due to e.g. hardware failure.