EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  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  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: The EPICS record field base attribute
From: Marty Kraimer <[email protected]>
To: "J. Frederick Bartlett" <[email protected]>, [email protected]
Date: Tue, 09 Sep 2003 13:11:01 -0500
The only thing base(<type>) does is determine how a field is converted from an integer to a string by dbStaticRun, i.e. how dbGetStringNum convert the number.

In the 3.12 versions of epics the old DCT used base to decide how to convert from an integer to a string. In 3.12 DCT did not keep numberic fields as strings and base was very important. Starting with 3.13 it lost most of its meaning since dbStaticNoRun keeps numeric fields as strings. We should have removed this attribute from the recordtype definitions. Perhaps Andrew will remove it for 3.15?

Note that numeric fields in record dbd files are converted during ioc initialization by strtol or strtoul with a third argument of 0. This means that the string is interpeted as a decimal, octal (leading 0), or hex (leading 0x) value.

Marty Kraimer


J. Frederick Bartlett wrote:
  The field definition for an EPICS database record allows for the
specification of a base radix with the syntax:

base(<base-type>)

where <base-type> can be DECIMAL or HEX with DECIMAL the default, c.f.
"EPICS IOC Application Developer's Guide"; Release 3.14beta1; page 67-68.

  I would interpret this to mean that any numeric value assigned to this
field when defining an instance of an EPICS record would be interpreted
according to the designated (or default) base radix. This does not, however,
appear to be the case.

Here is a field definition from a .dbd file:

          field(BADR,DBF_ULONG) {
                prompt("VME base address (hex)")
                promptgroup(GUI_DISPLAY)
                base(HEX)
                interest(1)
                initial("0")
          }

and here is an instance of a record definition in a .db file:

          record(vme,"TRG_CSEQ_M001/NXTA:R") {
                field(DESC, "CSEQ Next Address Read")
                field(SCAN, "Passive")
                field(BADR, "400000")
                field(ADDR, "0x8000")
                field(AMOD, "A24")
                field(DSIZ, "D16")
                field(RDWT, "Read")
                field(NMAX, "2048")
                field(NUSE, "1113")
                field(AINC, "2")
                field(ASND, "1")
                field(EXPR, "0")}

The value that appears in the BADR field is decimal 400000. If the value is
prefixed by "0x", i.e. "0x400000", the field value is hexadecimal 400000.

Am I missing something?

Fritz Bartlett





References:
The EPICS record field base attribute J. Frederick Bartlett

Navigate by Date:
Prev: The EPICS record field base attribute J. Frederick Bartlett
Next: Re: EPICS to WAGO PLC using Ethernet MODBUS John Maclean
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: The EPICS record field base attribute J. Frederick Bartlett
Next: stale data monitor Vladimir Sirotenko
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  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 ·