From c03467a7ed02f11fe5b1bb830f7118e45d02c57a Mon Sep 17 00:00:00 2001 From: soederqvist_a Date: Tue, 28 Oct 2025 11:20:12 +0100 Subject: [PATCH] Working Ikon-L interface Tested at Neutra --- Makefile | 12 ++++ README.md | 7 ++ camini.cmd | 3 + db/camini.db | 52 ++++++++++++++ db/sumIO.db | 191 +++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 265 insertions(+) create mode 100644 Makefile create mode 100644 README.md create mode 100644 camini.cmd create mode 100644 db/camini.db create mode 100644 db/sumIO.db diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5578f12 --- /dev/null +++ b/Makefile @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..4fbf2a7 --- /dev/null +++ b/README.md @@ -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. diff --git a/camini.cmd b/camini.cmd new file mode 100644 index 0000000..dcd0330 --- /dev/null +++ b/camini.cmd @@ -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:") diff --git a/db/camini.db b/db/camini.db new file mode 100644 index 0000000..594dd45 --- /dev/null +++ b/db/camini.db @@ -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") +} + diff --git a/db/sumIO.db b/db/sumIO.db new file mode 100644 index 0000000..9296740 --- /dev/null +++ b/db/sumIO.db @@ -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") + +} + +