EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  <19951996  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  Index 1994  <19951996  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 
<== Date ==> <== Thread ==>

Subject: Re: Engineering Units
From: [email protected] (Tim Mooney)
To: [email protected], [email protected]
Date: Thu, 21 Sep 1995 16:50:55 -0500
re...

> > I think dbGet() should guarantee CA clients a null-terminated string by
> > writing a null into the last available element of the units-string
> > space.  If we do this, we don't need to patch any existing code (but
> > we do lose one character of units information).
> > 
> > Defining MAX_UNITS_SIZE, and patching what record-support code we can
> > find, will not guarantee a null-terminated string.  Eventually, some CA
> > client will crash in response to user input, after working fine for
> > months.
> 
> The problem is that many users may already have 8 character unit fields that
> work just fine with medm, ed, and other standard tools. They will all of a
> sudden have 8th character chopped off. 

Yup.  It's a dilemma.

But don't forget that most of these clients go straight to the .EGU
field and display however many characters are there.  They would be
unaffected by anything we do to get_units().

The only clients I've played with that actually use information from
get_units() are 'probe' and 'dp'.  Neither of them can handle the
unterminated string they get back when the units field has eight
characters (or more).

I badly want scientists to be able to write robust CA clients.  They're
just not going to be well enough informed to know they have to handle
units differently from other strings they get via CA.  To them, this
will be the software equivalent of an unfenced hole in the sidewalk.

> I thought of something else. Maybe we want to leave ascii def files
> with length of 16 and just change recSup code to copy up to
> MAX_UNITS_SIZE chanacters. That way any databases that have longer
> units strings will work properly in the future and for now just have
> units chopped off at 8 characters.

This is better than shortening the actual units fields, I think, but
it's not going to help probe, dp, or any other client that's expecting
a null-terminated string.  And, of course, it's a lot more work than
simply stepping on the eighth character of an array.

Can someone come up with an existing CA client that gets engineering
units via get_units() (i.e., via DBR_GR_xxx or DBR_CTRL_xxx) and that
*does* correctly handle exactly eight characters?

Tim  Mooney


Replies:
Re: Engineering Units watson

Navigate by Date:
Prev: Updated Agenda Bob Dalesio
Next: RE: Engineering Units Stephanie Allison 926-4534
Index: 1994  <19951996  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: Engineering Units Marty Kraimer
Next: Re: Engineering Units watson
Index: 1994  <19951996  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, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·