Working Ikon-L interface

Tested at Neutra
This commit is contained in:
2025-10-28 11:20:12 +01:00
commit c03467a7ed
5 changed files with 265 additions and 0 deletions

12
Makefile Normal file
View File

@@ -0,0 +1,12 @@
include /ioc/tools/driver.makefile
MODULE=camini
BUILDCLASSES=Linux
EPICS_VERSIONS=7.0.7
ARCH_FILTER=RHEL%
TEMPLATES += db/camini.db
TEMPLATES += db/sumIO.db
SCRIPTS += camini.cmd

7
README.md Normal file
View File

@@ -0,0 +1,7 @@
## Camini epics module
This is an epics interface module for camini.
This is the recommended solution (by Pierre) for Ikon-L camera.
You should make sure to configure Camini with string "EPICS-", meaning without internal IOC.
It then uses the PVs provided here as the interface.

3
camini.cmd Normal file
View File

@@ -0,0 +1,3 @@
#------------- Camini
dbLoadRecords("$(camini_DB)/camini.db","P=$(INSTR)CAMINI:")
dbLoadRecords("$(camini_DB)/sumIO.db","P=$(INSTR)sumi:,AI=MHC6:IST:2,CAM=$(INSTR)CAMINI:")

52
db/camini.db Normal file
View File

@@ -0,0 +1,52 @@
# This is a database for the simulation of the CAMINI
# detector control software @ ICON @ SINQ
record(bi,"$(P)ARM")
{
field(DTYP,"Soft Channel")
field(ZNAM,"Low")
field(ONAM,"High")
}
record(bi,"$(P)SHUTTER")
{
field(DTYP,"Soft Channel")
field(ZNAM,"Low")
field(ONAM,"High")
}
record(bo,"$(P)TRIG")
{
field(DTYP,"Soft Channel")
field(ZNAM,"Low")
field(ONAM,"High")
}
record(bo,"$(P)AUX")
{
field(DTYP,"Soft Channel")
field(ZNAM,"Low")
field(ONAM,"High")
}
record(bi,"$(P)VALID")
{
field(DTYP,"Soft Channel")
field(ZNAM,"Low")
field(ONAM,"High")
}
record(waveform, "$(P)META") {
field(DTYP, "Soft Channel")
field(FTVL, "CHAR")
field(NELM, "16000")
field(SCAN, "Passive")
}
record(waveform, "$(P)FILE") {
field(DTYP, "Soft Channel")
field(FTVL, "CHAR")
field(NELM, "1024")
field(SCAN, "Passive")
}

191
db/sumIO.db Normal file
View File

@@ -0,0 +1,191 @@
# This code integrates the beam intensity signal during the
# time where the integration is activated (SWITCH = 1)
# and the camera is acquiring (SHUTTER = 0). It also counts
# the time during which the integration occured to compute
# the average intensity. This average intensity is compared
# to a threshold to indicate the camera whether the exposure
# is sufficient.
# this is a switch which can be set to activate/deactivate the counting
record(bi, "$(P)SWITCH")
{
field(DTYP,"Soft Channel")
field(ZNAM,"Low")
field(ONAM,"High")
}
# This is an accumulator for the beam intensity integral
record(ai, "$(P)ACCINT")
{
field(DTYP, "Soft Channel")
field(LINR, "LINEAR")
}
# This is an accumulator for the exposure time
record(ai, "$(P)ACCTIME")
{
field(DTYP, "Soft Channel")
field(LINR, "LINEAR")
}
# This is the threshold for acceptable intensity
record(ai, "$(P)THRES")
{
field(DTYP, "Soft Channel")
field(LINR, "LINEAR")
}
# This record keeps the last average value
record(ai, "$(P)LASTAVG")
{
field(DTYP, "Soft Channel")
field(LINR, "LINEAR")
}
# This is a record to hold a copy of the HIPA proton beam intensity
record(ai, "$(P)BEAM")
{
field(DTYP, "Soft Channel")
field(LINR, "LINEAR")
}
# This is a calculation record to copy the HIPA proton beam intensity,
# visible from NICOS
record(calcout, "$(P)BEAMCOPY")
{
field(SCAN, "1 second")
field(INPA, "$(AI)")
field(CALC, "A")
field(OUT, "$(P)BEAM")
field(OOPT, "Every Time")
field(DOPT, "Use CALC")
}
# This record computes the integral of the beam intensity
# (gated by the SWITCH and SHUTTER signals)
record(calcout, "$(P)BEAMINT")
{
field(SCAN,".1 second")
field(INPA,"$(AI)")
field(INPB,"$(P)SWITCH")
field(INPC,"$(CAM)SHUTTER")
field(INPD,"$(P)ACCINT")
field(CALC,"(B >= 1) AND (C = 0)? D + 0.1*A : D")
field(OUT,"$(P)ACCINT")
field(OOPT,"On Change")
field(DOPT,"Use CALC")
}
# This record computes the total exposure time
# (gated by the SWITCH and SHUTTER signals)
record(calcout, "$(P)EXPTIME")
{
field(SCAN,".1 second")
field(INPA,"$(AI)")
field(INPB,"$(P)SWITCH")
field(INPC,"$(CAM)SHUTTER")
field(INPD,"$(P)ACCTIME")
field(CALC,"(B >= 1) AND (C = 0)? D + 0.1 : D")
field(OUT,"$(P)ACCTIME")
field(OOPT,"On Change")
field(DOPT,"Use CALC")
}
# This record computes the average beam intensity
record(calcout, "$(P)BEAMAVG")
{
field(SCAN,".1 second")
field(INPA,"$(P)EXPTIME")
field(INPB,"$(P)BEAMINT")
field(INPC,"$(P)LASTAVG")
field(CALC,"A > 0 ? B/A : C")
field(OUT,"$(P)LASTAVG")
field(OOPT,"On Change")
field(DOPT,"Use CALC")
}
# This record compares the average intensity to the threshold
record(calcout, "$(CAM)AUX")
{
field(SCAN,".1 second")
field(INPA,"$(P)BEAMAVG")
field(INPB,"$(P)THRES")
field(CALC,"A >= B ? 1 : 0")
field(OUT,"$(CAM)AUX")
field(OOPT,"On Change")
field(DOPT,"Use CALC")
}