5.2. Writing DAQ configuration files

The DAQ configuration file is processed at the beginning of each run. The configuration file is processed in a fresh interpreter each time. You therefore cannot maintain any state across runs via your configuration file.

To illustrate module creation and configuration, this let's look at a fragment from a configuration file:

Example 5-1. Creating and configuring devices

ph7xxx create tdc -slot 13 -id 0x7186 -sparse false
ph7xxx config tdc -readhits true -usellt false -usehlt false

The ph7xxx driver supports the Phillips 7xxx series CAMAC 16 channel digitizers. The ph7xxx command is the Tcl command this driver recognizes. The create subcommand creates a new device instance and names it tdc. When you create a module any addition command words following the device name are interpreted as configuration options. In this case, the module is configured to be in slot 13, the driver is configured to emit a literal value (-id) 0x7186 prior to data from the device. The module is also configured to read all channels (-sparse false).

The config subcommand allows you to further configure the options of a device instance. The second line of the example continues specifying the configuration of the device named tdc. The configuration parameters on that line request the driver to read the hit pattern register (-readhits true), to not enable either the lower level threshold or the upler level threshold (-usellt and usehlt).

The reference section 3ccusb provides detailed information that describes each supported device and the configuration options it supports.

Configuration files must also specify at least one stack and, if scaler modules are to be read periodically, a second scaler stack. See the stack(3ccusb) command in the reference material for detailed information about how to create and configure stacks.

To continue with the previous example:

Example 5-2. Configuring an event stack

stack create events
stack config events -modules [list tdc] -type event -delay 108

Stacks are created and configured exactly like any other module. In this configuration file fragment, a stack named events is created. It is configured to manage the tdc module (-modules). It is configured as the event stack (-type) which, by default is triggered by a nim pulse in the IN1 input of the module. The -delay parameter specifies a delay of 108usec between the trigger input and stack execution. This capability is provided to allow the digitizers in the stack time to convert.

Finally here's a configuration file fragment that sets up an LRS 2551 scaler and the scaler stack:

Example 5-3. Setting up a scaler stack

lrs2551 create counters -slot 5
stack create scaler
stack config scaler -type scaler -period 2 -modules [list counters]