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: Differing lengths of EPICS string fields.
From: Steven M Beard <[email protected]>
To: Epics Questions <[email protected]>
Date: Fri, 20 Mar 1998 17:28:25 +0000 (GMT)
I have just run into a problem with the subRoutine record, and I am
grateful to Andy Foster (of the Royal Greenwich Observatory) for
suggesting a solution. Here it is in case anyone else meets this problem. 

The symptoms were as follows:

1) The database file, m2.db, contained a subRoutine record with the
   following field

        record(sub,"m3:interlock") {
                field(SNAM,"interlockMonitor")
        }

2) After the database was loaded, the following error appeared on the
   console when iocInit() was executed

   Subroutine not found PV: m3:interlock  recSub(init_record)

   Normally this error would be due to the subroutine declared in the
   SNAM field not matching a subroutine in the VxWorks symbol table.
   However, this time the subroutine interlockMonitor definitely existed.

3) When the  database record was examined with

      dbpr "m3:interlock"

   it looked as if the SNAM field of this record had been corrupted!

It turns out that the SNAM field of the subroutine record can only store
up to 16 bytes (15 characters plus a NULL terminator). The name of the
subroutine interlockMonitor is exactly 16 characters long, which meant it
could be stored in the SNAM field but the NULL terminator was missing.  It
looks like both "iocInit()" and "dbpr" came across this string and kept
reading garbage characters until they found a NULL terminator. Andy
Foster's solution was to reduce the length of the subroutine to 15
characters or less.

I am using EPICS 3.12.2, and the problem was noticed when running EPICS on
the Heurikon Baja 4700. For some reason the problem didn't show itself on
an mv167.

On examining the .ascii files in the EPICS 3.12.2 distribution I am using,
it turns out that some records allow the SNAM field to have up to 40
characters and others only allow SNAM to have 16 characters. I would find
it less confusing if all the records which used a particular named field
defined that field to have consistent properties (e.g. having SNAM 40
characters everywhere). Even better, would it be possible for every
string-type field in an EPICS database to be up to 40 characters long,
rather than having different fields different lengths? 

Regards,

Steven

==============================================================================
Steven Beard
Royal Observatory                  Tel.   : +44 (0)131 668 8253 (direct)
Blackford Hill                              +44 (0)131 668 8100 (switchboard)
Edinburgh EH9 3HJ                  Fax.   : +44 (0)131 668 1130
UK                                 E-mail : [email protected]       (Internet) 
                                   WWW    : http://www.roe.ac.uk/smbwww/


Replies:
Re: Differing lengths of EPICS string fields. Marty Kraimer

Navigate by Date:
Prev: EPICS sequence code on the Heurikon Baja 4700. Steven M Beard
Next: Re: Differing lengths of EPICS string fields. Marty Kraimer
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: EPICS sequence code on the Heurikon Baja 4700. Steven M Beard
Next: Re: Differing lengths of EPICS string fields. Marty Kraimer
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 ·