EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  <19981999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  <19981999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: MBBI & mask
From: Marty Kraimer <[email protected]>
To: Paul Sichta <[email protected]>
Cc: tech-talk <[email protected]>
Date: Wed, 07 Oct 1998 10:38:51 -0500
Sorry I waited so long to respond.

Paul Sichta wrote:
> 
> To all :
> OK, Thanks for helping me understand the mbbi/hardware/soft
> device/shift/mask stuff better.
> 
> Proposal number 2 is to modify the device support module devMbbiSoftRaw.c
> to mask the rval similar to the way hardware device support does it.  The
> mask will be calculated from the NOBT and the user-specified SHFT fields.
> 
> I have produced a test version of devMbbiSoftRaw.c  and have tested it with
> CAMAC hardware and with soft raw device support.  The hardware worked as
> before,  and the soft raw support worked as desired,  extracting only the
> "middle" bits of interest.
> 
> Regarding changes to the devMbbiSoftRaw.c file :
> 
> This could be added to the end of the    init_record    section :
>     /* initialize mask*/
>     pmbbi->mask = 0;
>     for (i=0; i<pmbbi->nobt; i++) {
>         pmbbi->mask <<= 1; /* shift left 1 bit*/
>         pmbbi->mask |= 1;  /* set low order bit*/
>     }
>     pmbbi->mask <<=  pmbbi->shft;
> 

For the mbbi record the above can be replaced by

/* initialize mask*/
pmbbi->mask <<=  pmbbi->shft;

because mbbiRecord.c already computes mask.


> This could be added to the read_mbbi section following   dbGetLink   :
> if(status==0) pmbbi->rval = pmbbi->rval & pmbbi->mask;
> 
> Regarding legacy mbbi records which use raw soft device support:   If a
> legacy mbbi record had used bits "beyond" the specified NOBT as part of
> their
> state values,  then the record will produce a different result because
> the bits beyond NOBT will (now) be masked.
> 

This is a concern. What Paul is recommending sounds good. It certainly
makes the binary soft raw support do what is expected with mask,shft.
But what about existing applications that may break? I dont know what to
recommend.

If we make this change then the following should all be changed to use
mask,shft.

devBiSoftRaw, devBoSoftRaw, devMbbiDirectSoftRaw, devMbbiSoftRaw,
devMbboDirectSoftRaw, devMbboSoftRaw

Marty Kraimer

References:
Re: MBBI & mask Paul Sichta

Navigate by Date:
Prev: PEP VM162 and VM172 Stephen Pate
Next: Wavetex 395 Jan Chrin
Index: 1994  1995  1996  1997  <19981999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: MBBI & mask Paul Sichta
Next: beta12 & GPIB & Compiler Bug Marty Kraimer
Index: 1994  1995  1996  1997  <19981999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·