updates soft proton current to functions with updated nicos device
Example Action / Lint (push) Successful in 2s
Example Action / BuildAndTest (push) Successful in 38s

This commit is contained in:
2026-06-09 13:14:16 +02:00
parent d6f0dd54eb
commit 7e795504aa
2 changed files with 50 additions and 11 deletions
+48 -4
View File
@@ -167,7 +167,9 @@ record(dfanout, "$(INSTR)$(NAME):DB_POLL")
# and count records to their final values
field(OUTA, "$(INSTR)$(NAME):T_STS_RAW.PROC")
field(OUTB, "$(INSTR)$(NAME):CH1_STS_RAW.PROC")
field(OUTB, "$(INSTR)$(NAME):STATUS.PROC")
field(OUTC, "$(INSTR)$(NAME):STATUS.PROC")
field(OUTD, "$(INSTR)$(NAME):T_PRESET_CLEAR.PROC")
field(OUTE, "$(INSTR)$(NAME):PRESET_CLEAR.PROC")
}
# Array Subroutine record which emulates the counterbox functionality
@@ -258,6 +260,17 @@ record(ai,"$(INSTR)$(NAME):T")
{
field(DESC, "DAQ Measured Time")
field(EGU, "sec")
field(PREC, 1)
}
record(calcout, "$(INSTR)$(NAME):T_PRESET_CLEAR")
{
field(INPA, "$(INSTR)$(NAME):STATUS NPP")
field(CALC, "A")
field(OOPT, "Transition To Zero")
field(DOPT, "Use OCAL")
field(OCAL, "0")
field(OUT, "$(INSTR)$(NAME):T_PRESET PP")
}
record(ai, "$(INSTR)$(NAME):T_PRESET")
@@ -269,7 +282,7 @@ record(ai, "$(INSTR)$(NAME):T_PRESET")
record(calc, "$(INSTR)$(NAME):T_STS_RAW")
{
field(DESC, "Raw time channel status")
field(INPA, "$(INSTR)$(NAME):STATUS NPP MS")
field(INPA, "$(INSTR)$(NAME):RAW_STATUS NPP MS")
field(INPB, "$(INSTR)$(NAME):T_CLEARED NPP")
field(CALC, "(0 < A && A < 4) || B")
field(FLNK, "$(INSTR)$(NAME):T_STS")
@@ -342,18 +355,49 @@ record(ai, "$(INSTR)$(NAME):CH1_RATE-PREV") {
field(DESC, "Previous rate of DAQ CH0 proton current")
}
record(calcout, "$(INSTR)$(NAME):PRESET_CLEAR")
{
field(INPA, "$(INSTR)$(NAME):STATUS NPP")
field(CALC, "A")
field(OOPT, "Transition To Zero")
field(DOPT, "Use OCAL")
field(OCAL, "0")
field(OUT, "$(INSTR)$(NAME):CH1_PRESET PP")
}
record(int64in, "$(INSTR)$(NAME):CH1_PRESET")
{
field(DESC, "Monitor Count Preset")
field(VAL, 0)
field(FLNK, "$(INSTR)$(NAME):CH1_SETTING")
}
record(calcout, "$(INSTR)$(NAME):CH1_SETTING")
{
field(INPA, "$(INSTR)$(NAME):CH1_PRESET NPP")
field(CALC, "A")
field(OOPT, "Transition To Non-zero")
field(DOPT, "Use OCAL")
field(OCAL, "1")
field(OUT, "$(INSTR)$(NAME):CH1_SET PP")
}
record(bo, "$(INSTR)$(NAME):CH1_SET")
{
field(DESC, "are hw counts being cleared")
field(ZNAM, "Set")
field(ONAM, "Setting")
field(HIGH, 0.1) # Emulate Waiting for HW setting preset
field(FLNK, "$(INSTR)$(NAME):CH1_STS_RAW")
}
record(calc, "$(INSTR)$(NAME):CH1_STS_RAW")
{
field(DESC, "Raw Channel Status")
field(INPA, "$(INSTR)$(NAME):STATUS NPP MS")
field(INPA, "$(INSTR)$(NAME):RAW_STATUS NPP MS")
field(INPB, "$(INSTR)$(NAME):CH1_CLEARED NPP")
field(CALC, "(0 < A && A < 4) || B")
field(INPC, "$(INSTR)$(NAME):CH1_SET NPP")
field(CALC, "(0 < A && A < 4) || B || C")
field(FLNK, "$(INSTR)$(NAME):CH1_STS")
}
+2 -7
View File
@@ -220,12 +220,6 @@ static long processEmulatedCounter(struct aSubRecord *psub) {
if (softProtonDebug)
printf("%s: Starting Count! (time <= %f, count <= %d)\n",
funcstr, spc->t_preset, spc->ch1_preset);
/* Sanity check that count type is properly stored */
// if (spc->command_trig != spc->count_type) {
// if (softProtonDebug)
// printf("%s: Count type not stored!\n", funcstr);
// return -1;
// }
/* Starting a new count
* Reset counter and time */
*monitor_count_out = 0;
@@ -283,7 +277,8 @@ static long processEmulatedCounter(struct aSubRecord *psub) {
/* Check if count is finished normally.
* Higher priority than low rate */
if (
(spc->t_preset > 0 && *elapsed_time_out >= spc->t_preset) ||
// The time only has precision 0.1 so we could make this somewhat less precise
(spc->t_preset > 0 && *elapsed_time_out >= spc->t_preset - 1e-6) ||
(spc->ch1_preset > 0 && *monitor_count_out >= spc->ch1_preset)
) {
if (softProtonDebug)