diff --git a/Makefile b/Makefile index 05825c6..3772b5a 100644 --- a/Makefile +++ b/Makefile @@ -24,5 +24,6 @@ TEMPLATES += templates/shutter.substitutions SCRIPTS += scripts/shutter.cmd SCRIPTS += sim/shutter_sim.py +TEMPLATES += db/sans_llb_beamstop.db TEMPLATES += templates/sans_llb_beamstop.substitutions SCRIPTS += scripts/sans_llb_beamstop.cmd diff --git a/db/sans_llb_beamstop.db b/db/sans_llb_beamstop.db new file mode 100644 index 0000000..305b4ee --- /dev/null +++ b/db/sans_llb_beamstop.db @@ -0,0 +1,52 @@ +record(longout, "$(INSTR)$(SPS_REGISTER_NAME):BEAMSTOP") +{ + field(DESC, "Move to new Beamstop") + field(OUT, "$(INSTR)$(SPS_REGISTER_NAME):BEAMSTOP-RAW PP") + field(OMSL, "supervisory") + field(DRVL, 1) + field(DRVH, 3) + field(PINI, "NO") + field(FLNK, "$(INSTR)$(SPS_REGISTER_NAME):TRIGGER PP") +} + +record(longout, "$(INSTR)$(SPS_REGISTER_NAME):TRIGGER") +{ + field(DESC, "Internal Trigger") + field(OUT, "$(INSTR)$(SPS_REGISTER_NAME):EXECUTE-CHANGE PP") + field(OMSL, "closed_loop") + field(DOL, 1) + field(PINI, "NO") +} + +record(calc, "$(INSTR)$(SPS_REGISTER_NAME):MAP-STATUS") +{ + field(DESC, "Maps Status Variables to singular status") + field(INPA, "$(INSTR)$(SPS_REGISTER_NAME):SERVICE-MODE NPP") + field(INPB, "$(INSTR)$(SPS_REGISTER_NAME):IN-POSITION NPP") + field(INPC, "$(INSTR)$(SPS_REGISTER_NAME):MOVES NPP") + field(INPD, "$(INSTR)$(SPS_REGISTER_NAME):ERROR NPP") + field(INPE, "$(INSTR)$(SPS_REGISTER_NAME):EXECUTE-POSSIBLE NPP") + field(INPF, "$(INSTR)$(SPS_REGISTER_NAME):ConnStatusFetch NPP") + field(INPG, "$(INSTR)$(SPS_REGISTER_NAME):ConnStatusWrite NPP") + field(INPH, "$(INSTR)$(SPS_REGISTER_NAME):BEAMSTOP NPP") + field(INPI, "$(INSTR)$(SPS_REGISTER_NAME):BEAMSTOP_RBV NPP") + field(CALC, "(F=0||G=0||D=1||A=1)?3:(C=1||H#I)?1:(B=0)?3:0") + field(SCAN, ".1 second") + field(FLNK, "$(INSTR)$(SPS_REGISTER_NAME):STATUS PP") +} + +record(mbbi, "$(INSTR)$(SPS_REGISTER_NAME):STATUS") +{ + field(DESC, "Status of Shutter") + field(INP, "$(INSTR)$(SPS_REGISTER_NAME):MAP-STATUS NPP") + field(ZRVL, "0") + field(ZRST, "Okay") + field(ONVL, "1") + field(ONST, "Busy") + field(TWVL, "2") + field(TWST, "Warning") + field(THVL, "3") + field(THST, "Error") + field(FRST, "4") + field(FRST, "Unknown") +} diff --git a/scripts/sans_llb_beamstop.cmd b/scripts/sans_llb_beamstop.cmd index e3a74f7..42159de 100644 --- a/scripts/sans_llb_beamstop.cmd +++ b/scripts/sans_llb_beamstop.cmd @@ -20,3 +20,6 @@ dbLoadRecords("$(sinqSPS_DB)/sps_status.db", "INSTR=$(INSTR), SPS_REGISTER_NAME= # Shutter PVs dbLoadTemplate("$(sinqSPS_DB)/sans_llb_beamstop.substitutions", "INSTR=$(INSTR), SPS_REGISTER_NAME=$(SPS_REGISTER_NAME)") + +# Additional Mapping PVs +dbLoadRecords("$(sinqSPS_DB)/sans_llb_beamstop.db", "INSTR=$(INSTR), SPS_REGISTER_NAME=$(SPS_REGISTER_NAME)") diff --git a/templates/sans_llb_beamstop.substitutions b/templates/sans_llb_beamstop.substitutions index 25ef6d8..4a6c16c 100644 --- a/templates/sans_llb_beamstop.substitutions +++ b/templates/sans_llb_beamstop.substitutions @@ -1,15 +1,15 @@ file "$(sinqSPS_DB)/writeusint.db" { pattern - {OFFSET, UINT_NAME , DESC } - {0 , "BEAMSTOP" , "Beamstop to change to" } + {OFFSET, UINT_NAME , DESC } + {0 , "BEAMSTOP-RAW" , "Beamstop to switch to" } } file "$(sinqSPS_DB)/writebit.db" { pattern {OFFSET, BIT, BIT_NAME , DESC } - {1 , 0 , "EXECUTE-CHANGE" , "Changes Beamstop" } + {1 , 0 , "EXECUTE-CHANGE" , "Change Beamstop" } } file "$(sinqSPS_DB)/readusint.db"