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: Differences in DBR_xxx constants between dbAccess.h and cadef.h
From: "John A. Priller" <[email protected]>
To: "Tech-Talk (E-mail)" <[email protected]>
Date: Tue, 15 Dec 1998 11:55:10 -0500
All;

I'm working on an system of saving record values on an IOC onto a
battery-backed memory board, so that the most recent values can be
automatically restored on IOC reboot.  I'm using Channel Access to place
monitors on the records whose value I want to save (#include cadef.h), and
run-time database access (#include dbAccess.h) to restore the values as
early as I can in the reboot process, using dbPutField.

Everything works fine, except that garbage values were getting written to my
records on reboot.  I've tracked this down to differences in the way the
dbAccess.h/dbFldTypes.h and cadef.h/db_access.h define the DBR_xxx
constants - DBR_DOUBLE under channel access is 6, but under run-time
database access it's 8.  Here's the table for the common types:

               db   ca
  DBR_STRING   0    0
  DBR_CHAR     1    4
  DBR_UCHAR    2   n/a
  DBR_SHORT    3    1
  DBR_USHORT   4   n/a
  DBR_LONG     5    5
  DBR_ULONG    6   n/a
  DBR_FLOAT    7    2
  DBR_DOUBLE   8    6
  DBR_ENUM     9    3

I've worked around this for now by breaking my code up into separate
modules, one for run-time database access and another for channel access,
but I was wondering - is there a historical reason for the two being
different, or have they just accidentally diverged over time?  And there's
the answer I usually suspect, of course - I did something hideously and
embarassingly wrong the last time I rebuilt our EPICS base (we're using
R.3.13.0.beta12, btw).

--
John A. Priller            | Phone : (517) 333-6375
MSU Cyclotron Laboratory   | Fax   : (517) 353-5967
South Shaw Lane            | Email : [email protected]
East Lansing, MI 48824     | Web   : http://prille.nscl.msu.edu/jp.html


Navigate by Date:
Prev: Re: question about medm and the .PREC field Stephen Pate
Next: Re: Differences in DBR_xxx constants between dbAccess.h and cadef.h Tim Mooney
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: question about medm and the .PREC field Stephen Pate
Next: Re: Differences in DBR_xxx constants between dbAccess.h and cadef.h Tim Mooney
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 ·