Skip to content

D-TACQ/acq400ioc

 
 

Repository files navigation

 PV name convention:
${HOST}:${SITE}:FEATURE  or
${HOST}:FEATURE

## Names in ALL CAPS (other than ${HOST} are public names)
## Names ending in lower case eg :r, :s, :w are for internal use and should NOT be used.



# site-aliases
please leave all PV's with the names they have ${HOST}:${SITE}:stuff
however, any aliases set in /mnt/local/sysconfig/site-aliases.db will be loaded as aliases
at build time. So we hope that sites can tolerate the canonical ACQ400 names along with their
site-conformant names as aliases.

## alias_all

create an alias for every public PV name. This is more reliable than "HOST prefix substitution" below.

### Boot the system
### run this once : ./scripts/alias_all ALIAS_PREFIX
### reboot


## HOST prefix substitution

-make aliases for all public names by change the PV PREFIX from $(hostname)
-export IOC_HOST=ioc_119

- for more complicated transformations, create a custom alias file, perhaps using /tmp/records.dbl as source

To trace streamdevice operation:
./scripts/set.epics-trace [Sx]

REAL SPECTRUM:
/mnt/local/sysconfig/epics.sh:
export IOC_PREINIT=./scripts/load.SpecReal
[ -e /dev/shm/window ] || \
	ln -s /usr/local/CARE/hanning-float.bin /dev/shm/window

SPECTRUM NOTES

# try 8K length. Stub window file to allow generated 8K triangle..
# or, ideally substitute an 8K hanning window file.
export SIZE=8192
export EPICS_CA_MAX_ARRAY_BYTES=500000
#[ -e /dev/shm/window ] || \
#    ln -s /usr/local/CARE/hanning-float.bin /dev/shm/window

# for ADC with DATA32 eg ACQ43x, ACQ42x unpacked:
export IOC_PREINIT=./scripts/load.SpecReal32

Without a signal, it looks pretty much the same on plot. Interesting that we seem to have NO 50Hz at all..
DDC:
/mnt/local/sysconfig/epics.sh:
export IOC_PREINIT=./scripts/load.ddc

ATD : ANALOG THRESHOLD DETECT (TRIGGER) : automated
#was export IOC_PREINIT=./scripts/load.anatrg

DTD : DELTA TRIGGER DETECT : automated
#was export IOC_PREINIT=./scripts/load.deltrg


# SOD TIMEOUT : force a SOD capture to run to completion when pulses stop after SECS seconds from first pulse
export SOD_TIMEOUT="SECONDS [FLUSH_COUNT]"  

# allow more than 80 "channels" per module eg for LIA
export ACQ400IOC_IDX_GT32=1

# stop this seq running
export ACQ43X_SET_SAMPLE_RATE=-1

# set a default sample rate
export ACQ43X_SET_SAMPLE_RATE=10000

ACQ1014:
/mnt/local/sysconfig/epics.sh:
export IOC_PREINIT=./scripts/load.acq1014

# interrupt monitor
export LOAD_INTMON=y

# Enable AI records (OFF by default)

/mnt/local/sysconfig/epics.sh:
echo -1 > /etc/acq400/0/OVERSAMPLING


GPG_MON=y # enable gpg_monitor 
#recommended for testing gpg, you can also set it after the event with
# /usr/local/epics/scripts/gpg_monitor 1 

# Clock Monitor. Enabled by default, but can cause issues, disable:
CLOCKMONITOR=0

# OnSetTransient. Ensures Trigger is SET. Not good for new Sample On Demand mode, to disable:
ONSETTRANSIENT=0

# restrict EPICS to localhost. Some folks don't want to see EPICS CA activity on their LAN:
export EPICS_CAS_INTF_ADDR_LIST=localhost

# WF_ACQ_HOST_WINDOW_PER_CHANNEL .. normal is a window per site, to enable per channel:
export WF_ACQ_HOST_WINDOW_PER_CHANNEL=y

# Possible multiple windows per channel, combine with WF_ACQ_HOST_WINDOW_PER_CHANNEL=y for unique window per WF
# default cooked data channel name: ${UUT}:${SITE}:AI:WF:${cid}:V
# duplicate channels possible with name ${UUT}:${SITE}:AI:${WF}:${cid}:V   # $WF= W1..WF, $LNK=LNK1..F
# add to /mnt/local/sysconfig/epics.sh
# /usr/local/epics/scripts/add_W1.init W1 LNK1
# /usr/local/epics/scripts/add_W1.init W2 LNK2

# JUDGEMENT:
## JUDGMENT: a burst mode rapid scope / mask / windowed stats function
## on a modern SYSCONFIG, this is configured by a single setting in acq400.sh;
## then, epics.sh, a shell function completes the EPICS configuration and
## in rc.user, a shell function completes the BURST mode definition.

see /mnt/local/sysconfig/acq400.sh, uncomment one of:

```
# ACQ400_JUDGEMENT: Burst mode rapid update, with mask and stats
# Rapid Scope, 256 points, external trigger to 50Hz
#ACQ400_JUDGEMENT="256 d0"
# Rapid Scope, 256 points, internal trigger to 50Hz
#ACQ400_JUDGEMENT="256 d1"
# Rapid Scope, 1024 points, internal trigger to 10Hz
#ACQ400_JUDGEMENT="1024 d1"
# Rapid Scope, 4096 points, internal trigger to 2Hz
#ACQ400_JUDGEMENT="4096 d1"
# for normal streaming, leave all ACQ400_JUDGEMENT above commented out
```
## The goal is to have a single setting to change all, but there are other specialist ttweaks available in /mnt/local/sysconfig/epics.sh
```
judgement() {
# short trace length, rapid update 50Hz possible
# $1:size, $2:dX (don't care) $3:BPB
	export SIZE=${1:-128}
# round to the nearest 10
	export SIZE=$((${SIZE%[123456789]*}*10))
	export IOC_PREINIT=./scripts/load.judgement
	export BURSTS_PER_BUFFER=${3:-1}
	export RTM_BUFFER_MON=y
	export RTM_BUFFER_MON_VERBOSE=1
}

```
## adjustment for off by one error in some personalities eg ACQ424
export RTM_TRANSLEN_ADJ=2
## bufferlength optimisation for burst mode is now AUTOMATED by rtm_buffer_mon
## if the burst rate is high >10Hz, you might get better results with multiple bursts per buffer.
## increase bufferlen accordingly, and set this variable (default is 1)

# .. reduce network load on fast updates
# export acq400Judgement_THROTTLE_HZ=2

## function in rc.user (do not change):
```
judgement() {
# short trace length, rapid update 50Hz possible
set.site 1 RTM_TRANSLEN 128
set.site 1 RGM RTM
set.site 1 RGM:DX d0
set.site 1 RGM:SENSE rising
}
```

# BURST MODE LIVE SCOPE. 
# This is largely superceded by "Judgement", but for the record:
# first make the changes to rc.user above to adjust for one buffer per burst,
# the change the way acq400_stream operates like this:
echo >> /etc/sysconfig/acq400.conf "export StreamHead_LDI_SOURCE=%s.bq"
#echo >> /etc/sysconfig/acq400.conf "export DemuxBufferShowES=1"
#echo >> /etc/sysconfig/acq400.conf "export DemuxBufferVerbose=1"
echo >> /etc/sysconfig/acq400.conf "export DemuxBufferSize=131072"
echo "STREAM_OPTS=" >> /etc/sysconfig/acq400_streamd.conf


# Rapid live plot with continuous data: JUDGEMENT_NJ
## variant of the Judgement module, does rapid plots with "No Judgement".
## works with continuous data, to enable, uncomment in /mnt/local/sysconfig/acq400.sh:
```
# for rapid update with normal streaming, not burst
# Rapid update, no trigger, No Judgment:
#ACQ400_JUDGEMENT_NJ="1024"
```


example python app:

[pgm@hoy5 ~]$ export EPICS_CA_ADDR_LIST=acq1001_329
[pgm@hoy5 ~]$ python
Python 3.8.6 (default, Sep 25 2020, 00:00:00) 
[GCC 10.2.1 20200723 (Red Hat 10.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import epics
>>> import numpy as np
>>> ramp=np.linspace(0,1,1024)
>>> ramp3=ramp+3
>>> mu01 = epics.PV('acq1001_329:1:JDG:MU:01:V')
>>> mu01.put(ramp)
1
>>> mu01.put(ramp3)
1
>>> 


# PG module: defaults as PG4 (PGx4, CLKOUT, TRG)
# PG5 option:   PGx5,TRG)
export DIO482TD_PG5=y
export DIO482TD_PG5=notrg


# WAN Environment. CLIENT probably wants to set 
export EPICS_CA_ADDR_LIST=xxx

# recommended for LARGE systems
export CB_QSIZE=4000

# WR
# Disable WR_COLDBOOT_PWR_HANDSHAKE
#export WR_COLDBOOT_PWR_HANDSHAKE=0
# WR COLDBOOT VERBOSE
#export WR_CLK_VERBOSE=1


#SLOWMON: default max poll 80Hz. 160 allows 40kSPS on ACQ43x
#export SLOWMON_FIN_MAX=160


# Z7IO: enable FP2BP (backplane master). ONLY ONE box in create should do this.
#export Z7IO_FP2BP_EN=y


# automated bufferlen comp for RTM. breaks 192ch, so make it an option
#export RTM_BUFFER_MON=y


About

EPICS IIOC for ACQ400 series

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 61.5%
  • Shell 22.5%
  • C 8.7%
  • Smalltalk 5.5%
  • Makefile 1.6%
  • Python 0.2%