32.2. The configuration file

The scaler configuration file:

A configuration file is just a Tcl script. A few extra commands have been added that allow that script to define the objects needed by the scaler program:

channel

Associates a meaningful name with a scaler channel index from a specific source id. In addition, this command can define alarm levels, indicate whether the scaler is read incrementally or reset after each read and indicate the number of bits wide the scaler data from that channel are.

page

Defines a scaler display page. The command defines both a page title (long form) and the short form which is used to reference this page in other commands. The short form is also used to label the scaler page's tab in the scaler display tabbed notebook.

display_single

Adds a line to a page that displays a single scaler.

display_ratio

Adds a line to a page that displays a pair of scalers and their ratio of rates/totals.

blankd

Adds a blank line to a scaler page.

stripparam

Enables stripcharting if it is not already enabled, and plots the rate of a scaler on the stripchart.

stripratio

Enables stripcharting if it is not already enabled, and plots the ratio f the rates of two scalers on the strip chart.

stripconfig

Allows aspects of the strip chart to be configured. Specifically the number of seconds of history that are displayed on the time axis.

32.2.1. Sample scaler configuration file.

The scaler definition file below shows all of the features of scaler definition files:

Example 32-1. Scaler Definition files


page page1 {Source 1}                            (1)
page page2 {Source 2}


for {set i 0} {$i < 32} {incr i} {           (2)
    set name [format channel%02d $i]
    channel $name $i.1                          (3)
    display_single page1 $name                  (4)

    set name [format src2%02d $i]
    channel -incremental 0 $name  $i.2         (5)
    display_single page2  $name
}
page ratio ratios
blank         ratio                          (6)
display_ratio ratio channel00 src200         (7)

stripparam channel00                         (8)
stripparam src200
stripratio channel00 src200                  (9)
stripconfig -timeaxis 1200                   (10)

                
(1)
The page command creates a new scaler display page. The first parameter is the tab name and is also used to refer to the page in other display commands. The second parameter is the title and is displayed at the top of the page.
(2)
This structure shows that the scaler definition files are just Tcl scripts. The for command is used to make the definition of several consecutive channels with patterned names easy.
(3)
The channel command defines a scaler channel. The first parameter is the name associated with that channel. The second parameter identifies which channel. The channel identifier is of the form index.source where

On each pass through the loop, this command will create a new channel definition for data source 1.

(4)
Defines a line on page2 of the scaler display that displays the single scaler defined in the previous line.
(5)
Creates a channel definition for data source 2 on each pass through the loop. These channels come from a data source whose scalers are not read incrementally (-incremental 0).
(6)
Adds a blank line to the ratio page.
(7)
Adds a line to the ratio page that displays both channel00 src200. In addition the ratios of the scaler rates and totals for these two scalers are displayed with channel00 as the numerator.
(8)
Creates the strip chart display by defining a trace of the rate in the channel00 scaler channel.
(9)
Creates a strip chart trace that displays the ratio of rates of channel00 (the numerator) and src200.
(10)
Configures the strip chart time axis to display the most recent 1200 seconds of trace information.