moves the gating configuration logic to epics

This commit is contained in:
2025-06-16 17:38:48 +02:00
parent f31e7c1e23
commit 3dd7c5a1d9
5 changed files with 22 additions and 79 deletions

View File

@ -199,13 +199,13 @@ setTestSignal {
getGateStatus {
out "GT \$2";
in "%d %(\$1GATE-ON-\$2_RBV)d";
in "%d %(\$1GATE-\$2-TRIG_RBV)d";
@mismatch{in "%(\$1MsgTxt)s";}
}
setGateStatus {
extrainput = ignore;
out "GT \$2 %(\$1GATE-\$2)d %(\$1GATE-ON-\$2)d";
out "GT \$2 %(\$1GATE-\$2-ENABLE)d %(\$1GATE-\$2-TRIG)d";
in "Gate \$2";
@mismatch{in "%(\$1MsgTxt)s";}
}
@ -217,7 +217,7 @@ setGate {
}
################################################################################
# To clean
# TODO To clean
startWithCountPreset4 {
clearTimer;

View File

@ -25,7 +25,17 @@ record(longin, "$(INSTR)$(NAME):MONITOR-CHANNEL_RBV")
field(DESC, "PRESET-COUNT Monitors this channel")
field(DTYP, "stream")
field(INP, "@$(PROTO) readPresetMonitor($(INSTR)$(NAME):) $(ASYN_PORT)")
field(SCAN, "5 second")
field(SCAN, "1 second")
}
# Force back to 1 if it is 0, as 0 has no meaning...
record(seq, "$(INSTR)$(NAME):CORRECT-MONITOR-CHANNEL")
{
field(SELM, "Specified")
field(SELL, "$(INSTR)$(NAME):MONITOR-CHANNEL_RBV.VAL NPP")
field(DO0, 1)
field(LNK0, "$(INSTR)$(NAME):MONITOR-CHANNEL PP")
field(SCAN, ".5 second")
}
################################################################################
@ -33,76 +43,3 @@ record(longin, "$(INSTR)$(NAME):MONITOR-CHANNEL_RBV")
################################################################################
# Read all monitors values
################################################################################
# Gating Settings
record(bo, "$(INSTR)$(NAME):GATE-1")
{
field(DESC, "First Gating Channel")
field(ZNAM, "Disabled")
field(ONAM, "Enabled")
field(DTYP, "stream")
field(OUT, "@$(PROTO) setGateStatus($(INSTR)$(NAME):, 1) $(ASYN_PORT)")
}
record(bo, "$(INSTR)$(NAME):GATE-ON-1")
{
field(DESC, "Count when first Gate high/low")
field(ZNAM, "Low")
field(ONAM, "High")
field(DTYP, "stream")
field(OUT, "@$(PROTO) setGateStatus($(INSTR)$(NAME):, 1) $(ASYN_PORT)")
}
record(bi, "$(INSTR)$(NAME):GATE-1_RBV")
{
field(DESC, "First Gating Channel")
field(ZNAM, "Disabled")
field(ONAM, "Enabled")
field(DTYP, "stream")
field(INP, "@$(PROTO) getGateStatus($(INSTR)$(NAME):, 1) $(ASYN_PORT)")
field(SCAN, "2 second")
}
record(bi, "$(INSTR)$(NAME):GATE-ON-1_RBV")
{
field(DESC, "Count when first Gate high/low")
field(ZNAM, "Low")
field(ONAM, "High")
}
record(bo, "$(INSTR)$(NAME):GATE-2")
{
field(DESC, "First Gating Channel")
field(ZNAM, "Disabled")
field(ONAM, "Enabled")
field(DTYP, "stream")
field(OUT, "@$(PROTO) setGateStatus($(INSTR)$(NAME):, 2) $(ASYN_PORT)")
}
record(bo, "$(INSTR)$(NAME):GATE-ON-2")
{
field(DESC, "Count when first Gate high/low")
field(ZNAM, "Low")
field(ONAM, "High")
field(DTYP, "stream")
field(OUT, "@$(PROTO) setGateStatus($(INSTR)$(NAME):, 2) $(ASYN_PORT)")
}
record(bi, "$(INSTR)$(NAME):GATE-2_RBV")
{
field(DESC, "Second Gating Channel")
field(ZNAM, "Disabled")
field(ONAM, "Enabled")
field(DTYP, "stream")
field(INP, "@$(PROTO) getGateStatus($(INSTR)$(NAME):, 2) $(ASYN_PORT)")
field(SCAN, "2 second")
}
record(bi, "$(INSTR)$(NAME):GATE-ON-2_RBV")
{
field(DESC, "Count when second Gate high/low")
field(ZNAM, "Low")
field(ONAM, "High")
}

View File

@ -167,7 +167,7 @@ record(bo,"$(INSTR)$(NAME):CONTINUE")
field(FLNK, "$(INSTR)$(NAME):RAW-STATUS")
}
record(bo, "$(INSTR)$(NAME):STOP")
record(longout, "$(INSTR)$(NAME):STOP")
{
field(DESC, "Stop the current counting operation")
field(DTYP, "stream")
@ -179,7 +179,9 @@ record(ao,"$(INSTR)$(NAME):THRESHOLD")
{
field(DESC, "Minimum rate for counting to proceed")
field(VAL, "0") # Rate
field(DRVL, "0.000001") # Minimum Rate
# Could perhaps still be improved.
# It seems to only accept whole counts?
field(DRVL, "1") # Minimum Rate
field(DRVH, "100000") # Maximum Rate
field(OMSL, "supervisory")
field(OROC, "0")