Counterbox Epics Module

A Stream and Asyn based driver for Counterboxes as SINQ.

This supports the older 4 and 8 channel EL737 models and the new 10CH 2nd generation systems.

How to Use

Unless a custom database is needed, a device can be configure simply by setting the required environment variables when calling the correct counterbox script.

Required Variables

Environment Variable Purpose
PREFIX Prefix of all device specific PVs
NAME First field in all PVs after Prefix
ASYN_PORT Unique name for referencing Asyn device
CNTBOX_HOST Network IP and Port of device

All PVs take the form

$(PREFIX):$(NAME):*

Available device startup scripts

  • scripts/counterbox_4ch.cmd
  • scripts/counterbox_8ch.cmd
  • scripts/counterbox_v2.cmd

A device can be configured using one of the startup scripts as follows

epicsEnvSet("PREFIX", "SQ:INSTRUMENT") # can also be set in runScript call

runScript "$(counterbox_DIR)counterbox_v2.cmd" "NAME=COUNTERBOX, ASYN_PORT=CBOXV2, CNTBOX_HOST=TestInst-DAQ1:2000"

PVs of Interest

PV Description
$(PREFIX):$(NAME):MsgTxt Contains unexpected response to executed command
$(PREFIX):$(NAME):STATUS 0: Idle, 1: Counting, 2: Low rate, 3: Paused, 4: Error
$(PREFIX):$(NAME):MONITOR-CHANNEL Channel that PRESET-COUNT monitors (has RBV, only v2 can be changed)
$(PREFIX):$(NAME):PRESET-COUNT Run count until specified pv value reached
$(PREFIX):$(NAME):PRESET-TIME Run count until specified pv value in seconds reached
$(PREFIX):$(NAME):THRESHOLD Minimum rate for counting to preceed. (has RBV)
$(PREFIX):$(NAME):THRESHOLD-MONITOR Channel monitored for minimum rate (has RBV)
$(PREFIX):$(NAME):ELAPSED-TIME Time Counterbox has been measuring for
$(PREFIX):$(NAME):M_ Current count on channel. (1-10 depending on box)
$(PREFIX):$(NAME):CHANNELS Number of available channels (4, 8 or 10)
Description
Epics Interface to the Neutron Detector Boxes used at SINQ
Readme 93 KiB
Languages
Python 60.1%
Batchfile 25.6%
C++ 9.5%
Makefile 3.9%
Shell 0.9%