EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  <20012002  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  1998  1999  2000  <20012002  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: Hex constant as input to longin record?
From: "Redman, Russell O." <[email protected]>
To: "'Marty Kraimer'" <[email protected]>, Werner Portmann <[email protected]>
Cc: EPICS tech talk <[email protected]>
Date: Wed, 18 Jul 2001 10:44:17 -0700
If I can add my two cents, EPICS uses doubles a bit too often as a default
data type, and this is just one of several examples.  Echoing some of the
other comments in the thread, it should be possible to initialise 
	- longin and longout records with any valid long specification, 
	- mbbi and mbbo with integers or strings from the xxST enum,
	- stringin and stringout with any valid character string
etc.  In general, it should be possible to initialise a record with any
value that the record type would interpret unambiguously as input through
INP or DOL.

Following Benjamin Franksen, I think an appropriate syntax would be to add a
VAL field, which if nonblank would be parsed using the normal input
mechanisms to set the initial value of the record, just as if it had been
read from INP or DOL.

Cheers,
Russell O. Redman

-----Original Message-----
From: Marty Kraimer [mailto:[email protected]]
Sent: Wednesday, July 18, 2001 6:49 AM
To: Werner Portmann
Cc: EPICS tech talk
Subject: Re: Hex constant as input to longin record?


Werner Portmann wrote:
> 
> Hi all
> this is not only true for the INP field of the longin record but for the
> DOL field of the longout record either. (We have Epics 3.13.2).
> Is it the true for all INP and DOL fields?


The following code decides if the link should be a constant. (dbPutString in
dbStaticLib.c)

                    /* Check first to see if string is a constant*/
                    /*It is a double if strtod eats entire string*/
                    /*leading and trailing blanks have already been
stripped*/
                    tempval = strtod(pstr,&end);
                    if(*end == 0) {

Thus it does not accept hex constants. Note also that recGblInitConstantLink
uses sscanf to convert from a string
to a numeric value. Thus just changing the above code will not fix the
problem. 

A possible fix is to have the above code try both strtod and strtol and if
either is successful then make the link a constant.
If recGblInitConstantLink uses "%i" for sscanf it looks like it should work.


Unless something unforseen arises I will make the changes for the next
release
of 3.13 and 3.14.

Marty Kraimer


Replies:
Re: Hex constant as input to longin record? Marty Kraimer

Navigate by Date:
Prev: Initializing mbbo with a string value Benjamin Franksen
Next: Re: Hex constant as input to longin record? Marty Kraimer
Index: 1994  1995  1996  1997  1998  1999  2000  <20012002  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: Hex constant as input to longin record? Marty Kraimer
Next: Re: Hex constant as input to longin record? Marty Kraimer
Index: 1994  1995  1996  1997  1998  1999  2000  <20012002  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 ·