Add SIMM=RAW to bo record

This commit is contained in:
Ralph Lange
2022-05-10 14:26:31 -07:00
parent 371cdde6df
commit 4e9bb9fe50
3 changed files with 29 additions and 15 deletions

View File

@@ -34,7 +34,7 @@
#include "special.h"
#include "menuIvoa.h"
#include "menuOmsl.h"
#include "menuYesNo.h"
#include "menuSimm.h"
#define GEN_SIZE_OFFSET
#include "boRecord.h"
@@ -427,14 +427,18 @@ static long writeValue(boRecord *prec)
}
switch (prec->simm) {
case menuYesNoNO:
case menuSimmNO:
status = pdset->write_bo(prec);
break;
case menuYesNoYES: {
case menuSimmYES:
case menuSimmRAW:
recGblSetSevr(prec, SIMM_ALARM, prec->sims);
if (prec->pact || (prec->sdly < 0.)) {
status = dbPutLink(&prec->siol, DBR_USHORT, &prec->val, 1);
if (prec->simm == menuSimmYES)
status = dbPutLink(&prec->siol, DBR_USHORT, &prec->val, 1);
else /* prec->simm == menuSimmRAW */
status = dbPutLink(&prec->siol, DBR_ULONG, &prec->rval, 1);
prec->pact = FALSE;
} else { /* !prec->pact && delay >= 0. */
epicsCallback *pvt = prec->simpvt;
@@ -446,7 +450,6 @@ static long writeValue(boRecord *prec)
prec->pact = TRUE;
}
break;
}
default:
recGblSetSevr(prec, SOFT_ALARM, INVALID_ALARM);

View File

@@ -206,8 +206,9 @@ The WPDT field is a private field for honoring seconds to hold HIGH.
The following fields are used to operate the record in simulation mode.
If SIMM (fetched through SIML) is YES, the record is put in SIMS
severity and the value is written through SIOL.
If SIMM (fetched through SIML, if populated) is YES, the record is put
in SIMS severity and the unconverted value is written through SIOL.
If SIMM is RAW, the value is converted and RVAL is written.
SSCN sets a different SCAN mechanism to use in simulation mode.
SDLY sets a delay (in sec) that is used for asynchronous simulation
processing.
@@ -352,7 +353,7 @@ for more information on simulation mode and its fields.
prompt("Simulation Mode")
special(SPC_MOD)
interest(1)
menu(menuYesNo)
menu(menuSimm)
}
field(SIMS,DBF_MENU) {
prompt("Simulation Mode Severity")