Sorry, I see you were talking about mbbi, not mbbo. In that case the documentation (https://wiki-ext.aps.anl.gov/epics/index.php/RRM_3-14_Multi-Bit_Binary_Input)
says:
“MASK is used by the raw soft channel read routine, and by typical device support read routines, to select only the desired bits when reading the
hardware register. It is initialized to ((1 << NOBT) - 1) by record initialization. The user can configure the NOBT field, but the device support routines may set it, in which case the value given to it by the user is simply overridden. The device support
routines may also override MASK or shift it left by SHFT bits. If MASK is non-zero, only the bits specified by MASK will appear in RVAL.”
The 3.15.5 version of the record seems to do what the documentation says:
(base) corvette:src/std/rec>grep -i mask mbbiRecord.c
/* Initialize MASK if the user set NOBT instead */
if (prec->mask == 0 && prec->nobt <= 32)
prec->mask = ((epicsUInt64) 1u << prec->nobt) - 1;
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Mark Rivers via Tech-talk
Sent: Tuesday, September 15, 2020 10:55 AM
To: 'Eric Norum' <ericnorum at gmail.com>; Johnson, Andrew N. <anj at anl.gov>
Cc: tech-talk at aps.anl.gov (tech-talk at aps.anl.gov) <tech-talk at aps.anl.gov>
Subject: RE: mbbi record ignores mask?
The mbbo documentation in the record Wiki (https://wiki-ext.aps.anl.gov/epics/index.php/RRM_3-14_Multi-Bit_Binary_Output) says this:
“MASK is used by device support routine to read the hardware register. Record support sets low order of MASK the number of bits specified in NOBT. Device support can shift this value.”
The 3.15.5 version of the mbbo record seems to do what the documentation says:
(base) corvette:src/std/rec>grep -i mask mbboRecord.c
/* Initialize MASK if the user set NOBT instead */
if (prec->mask == 0 && prec->nobt <= 32)
prec->mask = ((epicsUInt64) 1u << prec->nobt) - 1;
Mark
Ø
The mbbi record in the couple of versions of base that Ive checked (3.15.5 and 3.15.7) don’t seem to use the MASK field.
I believe that is the responsibility of the device support. asyn device support handles the mask.
Mark
This is one of those things that seems impossible to have been wrong for so long that it makes me wonder if I’m misinterpreting what I’m reading.
The mbbi record in the couple of versions of base that Ive checked (3.15.5 and 3.15.7) don’t seem to use the MASK field.
/eda/epics/R3.15.7/base/src/std/rec
wenorum@xildev5 224> grep -n mask mbbiRecord.c
140:
if (prec->mask == 0 && prec->nobt <= 32)
141:
prec->mask = ((epicsUInt64) 1u << prec->nobt) - 1;