diff --git a/modules/database/src/std/rec/biRecord.c b/modules/database/src/std/rec/biRecord.c index 3f9b2821c..5c5d70815 100644 --- a/modules/database/src/std/rec/biRecord.c +++ b/modules/database/src/std/rec/biRecord.c @@ -146,6 +146,10 @@ static long process(struct dbCommon *pcommon) prec->udf = FALSE; } else if(status==2) status=0; + + /** IVAL is always the inverse of VAL. */ + prec->ival = (prec->val == 0) ? 1 : 0; + /* check for alarms */ checkAlarms(prec, &timeLast); /* check event list */ @@ -202,7 +206,7 @@ static long get_enum_str(const DBADDR *paddr, char *pstring) static long get_enum_strs(const DBADDR *paddr,struct dbr_enumStrs *pes) { biRecord *prec=(biRecord *)paddr->precord; - + pes->no_str = 2; memset(pes->strs,'\0',sizeof(pes->strs)); @@ -295,6 +299,9 @@ static void monitor(biRecord *prec) /* send out monitors connected to the value field */ if (monitor_mask){ db_post_events(prec,&prec->val,monitor_mask); + + /** IVAL can post monitors. */ + db_post_events(prec, &prec->ival, monitor_mask); } if(prec->oraw!=prec->rval) { db_post_events(prec,&prec->rval, diff --git a/modules/database/src/std/rec/biRecord.dbd.pod b/modules/database/src/std/rec/biRecord.dbd.pod index bd9b35616..45f3544b2 100644 --- a/modules/database/src/std/rec/biRecord.dbd.pod +++ b/modules/database/src/std/rec/biRecord.dbd.pod @@ -65,7 +65,9 @@ field. The value from RVAL is then converted using the process described in the next section. -=fields INP, DTYP, ZNAM, ONAM, RVAL, VAL +The IVAL field is always the inverse of the VAL field. + +=fields INP, DTYP, ZNAM, ONAM, RVAL, VAL, IVAL =head3 Conversion Fields @@ -166,6 +168,11 @@ is not equal to VAL. asl(ASL0) pp(TRUE) } + field(IVAL, DBF_SHORT) { + prompt("Inverted Value") + special(SPC_NOMOD) + interest(1) + } field(ZSV,DBF_MENU) { prompt("Zero Error Severity") promptgroup("70 - Alarm") @@ -308,6 +315,8 @@ for more information on simulation mode and its fields. interest(4) extra("epicsCallback *simpvt") } + + =head2 Record Support diff --git a/modules/database/src/std/rec/boRecord.c b/modules/database/src/std/rec/boRecord.c index 0b9c7057c..cd65296cf 100644 --- a/modules/database/src/std/rec/boRecord.c +++ b/modules/database/src/std/rec/boRecord.c @@ -395,6 +395,9 @@ static void monitor(boRecord *prec) { unsigned short monitor_mask; + /** IVAL is always the inverse of VAL. */ + prec->ival = (prec->val == 0) ? 1 : 0; + monitor_mask = recGblResetAlarms(prec); /* check for value change */ if (prec->mlst != prec->val){ @@ -407,6 +410,9 @@ static void monitor(boRecord *prec) /* send out monitors connected to the value field */ if (monitor_mask){ db_post_events(prec,&prec->val,monitor_mask); + + /** IVAL can post monitors. */ + db_post_events(prec, &prec->ival, monitor_mask); } if(prec->oraw!=prec->rval) { db_post_events(prec,&prec->rval, diff --git a/modules/database/src/std/rec/boRecord.dbd.pod b/modules/database/src/std/rec/boRecord.dbd.pod index 89e3e6c52..c9df51092 100644 --- a/modules/database/src/std/rec/boRecord.dbd.pod +++ b/modules/database/src/std/rec/boRecord.dbd.pod @@ -74,7 +74,9 @@ again with VAL set to 0 after the number of seconds specified by HIGH. Thus, HIGH implements a momentary output which changes the state of the device back to 0 after I number of seconds. -=fields DTYP, OUT, VAL, RVAL, HIGH, ZNAM, ONAM +The IVAL field is always the inverse of the VAL field. + +=fields DTYP, OUT, VAL, IVAL, RVAL, HIGH, ZNAM, ONAM =head2 Conversion Parameters @@ -212,6 +214,11 @@ for more information on simulation mode and its fields. asl(ASL0) pp(TRUE) } + field(IVAL, DBF_SHORT) { + prompt("Inverted Value") + special(SPC_NOMOD) + interest(1) + } field(OMSL,DBF_MENU) { prompt("Output Mode Select") promptgroup("50 - Output")