Experimental Physics and Industrial Control System
|
Hello
Andrew Johnson wrote:
Hi Dirk,
On Wednesday 06 January 2010 03:37:53 Dirk Zimoch wrote:
It is a pity that the Bx fields of mbboDirect do not update when VAL is
written. It seems mbboDirect has not been designed to have VAL written.
But then neither DOL not the record_init() code makes much sense. Maybe
this is an issue for the next Codeathon. Provided we have defined what
the "expected behaviour" is.
To add a little history to the discussion, the mbb*Direct record types were
created from the mbb* record types at JLAB. I suspect that their deficiencies
have not been corrected because their original author lost interest and nobody
else has been sufficiently motivated to fix them before now.
I have a couple of private emails about a patch to the mbboDirect record from
September 2008, but the suggestion at the time was that more changes were
still needed, which was one of the reasons why I didn't apply the change.
I would certainly encourage anyone who wants to work on improvements to do so
(and publicize that you are doing so), although if you make significant
changes to the configuration fields or runtime behaviour it might be advisable
to rename the record type at the same time so that existing IOCs which may
rely on the current behaviour do not break when upgraded to a release
containing the new version. It is then trivial to deprecate the old record
types and unbundle them from Base while still making them available for
existing installations to use.
I propose the following behavior:
I haven't examined your specific suggestions, I'm happy to let you, Stephanie
and others to work on the details. I would like reference documentation to
accompany any new or modified record type.
What about extending the mbb* records to 32 bits?
I don't understand what you mean by that; the VAL field of the mbb[io] records
is a DBF_ENUM (i.e. an index into a list of choices) and you can't change the
underlying type for the index value. The xxVL, RVAL and MASK fields are
DBF_ULONG and thus 32 bits wide already.
If you meant to increase the number of choices possible from 16 to 32, I'm
afraid that is currently limited by the CA network protocol and API which was
only designed to transport at most 16 state strings. That limitation is
likely to be removed at some point, but it will not be possible to make the
result backwards compatible so existing CA clients will have to be modified to
use more than 16 states.
If no states are defined for an mbbo, VAL is copied (after shifting)
into RVAL. That allows to write a bitfield to the hardware. It is a
little bit strange, that this works with mbbo which has been designed to
implement a selection of states but not with mbboDirect which has been
designed to implement a bitfield. Unfortunately, one is limited to 16
bits because of the ENUM type of mbbo.
I see that this is mixing two different things which should probably be
avoided. But then mbboDirect should be "fixed".
If you meant extend the mbb[io]Direct records to 32 bits though, I think that
has already been done by at least one site and does seem worthwhile.
That does not seem too difficult. One question is how to name the 16
high bits? BG ... BV or B10 ... B1F? And I would use DBF_LONG instead
of DBF_ULONG to keep CA happy. At the moment, the field is DBF_USHORT,
which is translated to LONG for CA. So nothing would change for CA
clients (except that the number may be negative now when bit 31 is set).
As far as I can see, the extension would be completely backward compatible.
Heretic question: What about combining the features of mbb[io]Direct
with mbb[io], i.e. adding Bx fields to mbb[io] records and get rid of
mbb[io]Direct?
I don't see any major advantage to doing this, since the record types are
really very different in purpose. The mbb[io] records allow a series of state
names to be associated with specific bit patterns, whereas the mbb[io]Direct
records allow individual bits in a word to be separated out and combined. The
only overlap between these is in the I/O of the raw value; sharing device
support between record types will need a whole new record/device interface to
be developed though...
- Andrew
And Ralph wrote:
Don't merge mbbi/o and mbbi/oDirect, as their functionality is too different, and we would end up with a big clumsy "all digital stuff in one" record.
Agreed. It would probably generate too much overhead to do "all in one".
All these really good and reasonable ideas (32 bit, strings and alarm stuff for each bit, reasonable startup and monitor behavior, maybe even sending DBE_PROPERTY events...) should go in two new record types to avoid breaking existing stuff.
The new records could also have a more descriptive name .... something resembling "bitfield" or "bitset"?
I am not a friend of record type inflation. But I think that extending
records in a backward compatible way should be possible. It has been
done in the past. (And even some non-compatible changes have been done.)
My proposal for the mbboDirect would not change anything that works now.
But it would add functionality (consistency of the record state, working
DOL and initialization or in short: writing to VAL). I can hardly
imagine that someone is relying on the fact that these things do not
work at the moment. But maybe my imagination is not good enough.
Concerning names: EPICS has always been quite inconsistent and
non-descriptive with the names of records and fields.
Examples:
ai, ao, bi, bo <-> longin, longout, stringin, stringout
ZNAM, ONAM <-> ZRST, ONST
INPA, INPB ... <-> DOL1, DOL2 ...
OUTA, OUTB ... <-> LNK1, LNK2 ...
ao.HIGH <-> bo.HIGH
sub instead of subroutine or similar
the infamous DOL input link
closed_loop for "read DOL"
...
Trying to fix that now cries for a complete re-design of all record types...
Dirk
- References:
- RE: mbboDirect problem Allison, Stephanie
- Re: mbboDirect problem Dirk Zimoch
- Re: mbboDirect problem Andrew Johnson
- Navigate by Date:
- Prev:
Re: Odd MEDM behavior on OS-X Noboru Yamamoto
- Next:
Re: Odd MEDM behavior on OS-X : RESOLVED Josh Stein
- Index:
1994
1995
1996
1997
1998
1999
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: mbboDirect problem Ralph Lange
- Next:
ca_pend_event fails to return Chris Slominski
- Index:
1994
1995
1996
1997
1998
1999
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, 02 Sep 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
·
Search
·
EPICS V4
·
IRMIS
·
Talk
·
Bugs
·
Documents
·
Links
·
Licensing
·
|