From 37b1e4b593762fb4e1e65f018fb4d93f0ca0b2f3 Mon Sep 17 00:00:00 2001 From: soederqvist_a Date: Thu, 26 Feb 2026 14:27:32 +0100 Subject: [PATCH] Fix MsgTxt being broken --- db/daq_soft_proton.db | 10 ++++++---- src/daq_soft_proton.c | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/db/daq_soft_proton.db b/db/daq_soft_proton.db index b8be6c6..ab2f38e 100644 --- a/db/daq_soft_proton.db +++ b/db/daq_soft_proton.db @@ -50,9 +50,11 @@ record(longin, "$(INSTR)$(NAME):CHANNELS") field(DISP, 1) } -record(stringin, "$(INSTR)$(NAME):MsgTxt") +record(waveform, "$(INSTR)$(NAME):MsgTxt") { field(DESC, "Miscellanous messages") + field(FTVL, "CHAR") + field(NELM, 40) } record(bi, "$(INSTR)$(NAME):IS_LOWRATE") @@ -267,9 +269,9 @@ record(aSub, "$(INSTR)$(NAME):EMULATION") field(FTVE, "DOUBLE") field(OUTF, "$(INSTR)$(NAME):IS_LOWRATE PP") field(FTVF, "ULONG") - field(OUTF, "$(INSTR)$(NAME):MsgTxt PP") - field(FTVF, "CHAR") - field(NEVF, 40) + field(OUTG, "$(INSTR)$(NAME):MsgTxt PP") + field(FTVG, "CHAR") + field(NOVG, 40) } ####################### diff --git a/src/daq_soft_proton.c b/src/daq_soft_proton.c index de91fb9..3f50ed4 100644 --- a/src/daq_soft_proton.c +++ b/src/daq_soft_proton.c @@ -153,6 +153,9 @@ static long processEmulatedCounter(struct aSubRecord *psub) epicsUInt32* is_low_rate_out = (epicsUInt32*)psub->valf; epicsOldString* msg_txt_out = (epicsOldString*)psub->valg; + /* Always update the whole string */ + psub->nevg = psub->novg = 40; + /* Always no matter what, handle the rate */ /* - Calculate average rate */ spc->average_rate = (spc->proton_rate + spc->prev_proton_rate) / 2; @@ -202,7 +205,7 @@ static long processEmulatedCounter(struct aSubRecord *psub) } else if (((spc->status == COUNTING || spc->status == LOW_RATE) && spc->command_trig == PAUSE) || (spc->status == PAUSED && spc->command_trig == NONE)) { - strcpy(*msg_txt_out, "Stopping!"); + strcpy(*msg_txt_out, "Paused!"); /* We are counting or at low rate and received pause. * Also we are paused but have received no command, this * is probably slightly inaccurate but simplifies things.*/