MDIF Epics Module

An Asyn and Stream Device based driver for the Multi-Detector Interface used at some instrument within SINQ.

How to Use

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

Required Variables

Environment Variable Purpose
INSTR Prefix of all device specific PVs
NAME First field in all PVs after Prefix
MDIF_IP Network IP of device
MDIF_PORT Network Port of device

All PVs take the form

$(INSTR)$(NAME):*

Available device startup scripts

  • scripts/mdif.cmd

For example

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

runScript "$(mdif_DIR)mdif.cmd" "NAME=MDIF, MDIF_IP=focus-ts, MDIF_PORT=3016"

PVs of Interest

PV Description
$(INSTR)$(NAME):MsgTxt Contains unexpected response to executed command
$(INSTR)$(NAME):DELAY Used to write a new delay value to the MDIF
$(INSTR)$(NAME):DELAY_RBV Read back the delay value configured in the MDIF

Simulation

Simulation of the Hardware can be toggled on as follows:

epicsEnvSet("SET_SIM_MODE","") # run MDIF simulation instead of connecting to actual system
runScript "$(mdif_DIR)mdif.cmd" "NAME=MDIF, MDIF_IP=localhost, MDIF_PORT=3016"

In such a case, the provided MDIF_IP is ignored, and a python program simulating the hardware is started in the background, listening at the specified MDIF_PORT.

See sim/mdif_sim.py.

Description
Interface to Multi-Detector Interface
Readme 33 KiB
Languages
Python 55.8%
Batchfile 26.2%
Makefile 11.6%
Shell 6.4%