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] (Marty Kraimer)
To: [email protected]
Date: Fri, 22 Sep 1995 13:56:37 -0500
It seems that the consensus is that the units string should be null terminated.
Here is my latest thoughts of how to patch problem for now.

Changes to dbAccess.h

       will define the following:

	#define DB_UNITS_SIZE	16
  
        The current definition for DBRunits will be changed to

         #define DBRunits \
              char        units[DB_UNITS_SIZE]

        Since everything is local to an ioc it is ok to
        change from 8 characters to 16.

The get_units of each record support module will be changed from

	strncpy(units,pai->egu,sizeof(pai->egu));

to

	strncpy(units,pai->egu,DB_UNITS_SIZE);

New database access, after calling the record support get_units routine,
will force the last byte of the units string to be null

The routine that translates between old and new database access
will force the units field passed to channel access to be a null
terminated 8 byte field.


This solution has the following features:

1) New database access completely supports a 16 byte null terminated
   units string
2) Clients (database and channel access) always get a null terminated string.
3) When we go to new major EPICS release number, i.e. CA protocal change
   database access will already support 16 byte character strings.

The only impact on existing clients is that some may find 8th character
of units string missing.

If there are any objections make them soon or else I will make
these changes for release 3.12.2 which is planned for next month.

Marty Kraimer


Navigate by Date:
Prev: Available CAMAC drivers? Peregrine McGehee
Next: announcing arrIDL_0p0 (IDL interface to EPICS archiver files) William Lupton
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 Jeff Hill
Next: Next Collaboration Meeting (etc...) Oct. 30th to Nov. 8th Bob Dalesio
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 ·