SPC: add example for st.cmd and nicos setup
All checks were successful
Example Action / Lint (push) Successful in 2s
Example Action / BuildAndTest (push) Successful in 38s

This commit is contained in:
2026-02-06 11:05:51 +01:00
parent 38e774cf84
commit 00b9093b37

View File

@@ -310,6 +310,71 @@ compatible with the sinqdaq device in Nicos, albeit with only one channel.
You can start a proton current DAQ based on a simulation with the following
command on any PC having the SINQ epics environment installed.
```
iocsh -r sinqDAQ,0.4.0 -c 'epicsEnvSet(SET_SIM_MODE,"" )' -c 'epicsEnvSet(INSTR,SQ:TEST:)' -c 'epicsEnvSet(NAME, SPC)' -c 'runScript($(sinqDAQ_DIR)daq_soft_proton.cmd'
iocsh -r sinqDAQ,0.4.0 -c 'epicsEnvSet(SET_SIM_MODE,"" )' -c 'epicsEnvSet(INSTR,SQ:TEST:)' -c 'epicsEnvSet(NAME, SPC)' -c 'runScript $(sinqDAQ_DIR)daq_soft_proton.cmd'
```
### Example st.cmd declaration
To include it in an existing st.cmd, add the following lines:
```
require sinqDAQ, 0.4.0
# This is the proton current PV from HIPA, however it's not available in the shutdown
epicsEnvSet(REMOTE_RATE_PV,"MHC6:IST:2")
# During shutdown you can specify this empty env var to have a simulated proton current.
epicsEnvSet(SET_SIM_MODE,"" ) # During operation remove this.
runScript $(sinqDAQ_DIR)daq_soft_proton.cmd "INSTR=SQ:TEST:, NAME=SPC"
```
### Example NICOS setup file declaration
```
description = 'Setup for software based proton counter'
pvprefix = 'SQ:TEST:SPC'
channels = ['protoncount']
devices = dict(
elapsedtime = device(
'nicos_sinq.devices.epics.sinqdaq.DAQTime',
daqpvprefix = pvprefix,
),
protoncount = device(
'nicos_sinq.devices.epics.sinqdaq.DAQChannel',
description = 'Proton counter channel',
daqpvprefix = pvprefix,
channel = 1,
type = 'monitor',
),
preset = device(
'nicos_sinq.devices.epics.sinqdaq.DAQPreset',
description = 'Time/Count Preset',
daqpvprefix = pvprefix,
channels = channels,
time_channel = ['elapsedtime'],
),
ThresholdChannel = device(
'nicos_sinq.devices.epics.sinqdaq.DAQMinThresholdChannel',
daqpvprefix = pvprefix,
channels = channels,
),
Threshold = device(
'nicos_sinq.devices.epics.sinqdaq.DAQMinThreshold',
daqpvprefix = pvprefix,
min_rate_channel = 'ThresholdChannel',
),
spcdet = device(
'nicos_sinq.devices.epics.sinqdaq.SinqDetector',
description = 'Detector device that estimates proton counts in software',
timers = ['elapsedtime'],
counters = [],
monitors = ['preset'] + channels,
images = [],
others = [],
liveinterval = 7,
saveintervals = [60]
),
)
startupcode = '''
SetDetectors(spcdet)
'''
```