sclclient

Name

sclclient -- Maintain scaler state in a tclserver

Synopsis

sclclient [options]

DESCRIPTION

sclclient accepts scaler buffers from a DAQ systems (spdaq system at the NSCL), processes them and sends processed information to a tclserver program. Given an appropriate setup script to describe a visual presentation of the scalers, sclclient and tclserver together create a scaler display subsystem.

Command options (see OPTIONS below), describe how the program starts up. sclclient interacts with tclserver by sending it a set of tcl commands to maintain some global variables (see VARIABLES below). In addition, at key points, procedures are called that are assume to be loaded into the tclserver program by its setup scripts (see PROCEDURES below).

OPTIONS

The sclclient program accepts both short (single dash single letter) and long (double dash and english word) options. The list below only describes the long options. For a table of the corresponding short options run sclclient --help.

--help

Provides a short help page that describes the options their associated values and functionality.

--host=hostname

Provides the name of the host in which the Tcl server this program connects to is running. If not provided this defaults to localhost

--port=port

Provides the port on which the Tcl server is listening for connections. This should either be an integer port number or the special text string managed. By default, this is managed.

If the port is managed the client software will use the port manager running in the target host to locate an application named ScalerDisplay being run under the same username that sclclient is running.

--source=ringurl

ringurl is the URL to the ringbuffer from which the application will take data. If omitted, the source will be tcp://localhost/username where username is the name of the user running the program.

--version

Prints out program version information to stdout.

VARIABLES

sclclient maintains several variables and arrays in the TCL server to which it is connected. Scaler displays are therefore constructed by displaying the values of these variables and arrays as well as by providing procedures called by sclclient (see PROCEDURES below).

The variables sclcient maintains are:

Scaler_Totals

This is a TCL array indexed by scaler channel number (channels start at 0. Each element of the array is the total number of counts in that channel either since the scaler program started up or the run began, whichever happened latest.

Scaler_Increments

This is a TCL array indexed by channel number. The value of each element is the number of counts in that channel since the latest of the beginning of the run, starting sclclient, and the previous scaler buffer.

ScalerDeltaTime

This variable maintains the number of seconds in the most recently received set of scaler increments in seconds. If no scaler increments have been received, this variable is 0. ScalerDeltaTime can be used to calculate scaler rates.

ElapsedRunTime

This variable contains the number of seconds since the start of run, or when the scaler client program started, whichever is latest.

RunNumber

This variable contains he number of the current run. If not yet known, it has the value >Unknown%lt; instead.

RunState

This variable has the known run state. It is any of HALTED, ACTIVE, or PAUSED, or lastly >Unknown< if the run state is not yet known.

RunTitle

Contains the title of the current run if known or the text ">Unknown<" if not.

PROCEDURES

In addition to maintaining the global variables described in VARIABLES above, sclclient calls procedures at well defined points in time. These procedures must be defined in the tclserver, even if only as empty procedures.

Procedures are not passed any parameters. The procedures sclclient requires are:

Update

Called whenever variables have been updated. The tclserver code here will usually refresh the display picture.

BeginRun

Called when a begin run is detected.

EndRun

Called when an end run is detected.

PauseRun

Called when a pause run is detected.

ResumeRun

Called when a resume run is detected.

RunInProgress

Called when the first data to come in is not a begin run. This indicates that sclclient started while a run is in progress.

EXAMPLES

The sample below starts out sclclient taking data from spdaq22 and feeding it to a tclserver on u6pc2

Example 1. Starting sclclient


/usr/opt/daq/bin/sclclient --source= tcp://spdaq22/`whoami` --host=u6pc2 --port=2700
            

SEE ALSO

ScalerDisplay(1tcl), tclserver(1)