EPICS Home

Experimental Physics and Industrial Control System


 
2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Conversion from hex number string to LONG-type field
From: Bruno Martins <[email protected]>
To: [email protected]
Date: Wed, 28 Feb 2018 11:27:10 -0500
Hi all,

I noticed that dbpf doesn't convert hex values to fields with type LONG. Digging through the code it seems that the culprit is in ioc/db/dbFastLinkConv.c: cvt_st_l (and a bunch others) calls strtol with base=10. Wouldn't it be better to call it with base=0 and let it figure out the proper base? Or, instead, to use epicsScanDouble like cvt_st_ul does?


$ cat test.db
record(ao, "aotest") {}
record(longout, "lotest") {}
$ /usr/lib/epics/bin/linux-x86_64/softIoc -d test.db
Starting iocInit
############################################################################
## EPICS R3.15.3-12+0~20170719135640.23+debian08~1.gbpaada8e $Date: Sun 2015-11-22 17:54:12 +0100$
## EPICS Base built Jul 19 2017
############################################################################
iocRun: All initialization complete
epics> dbl
lotest
aotest
epics> dbpf aotest 10
DBR_DOUBLE:         10                 
epics> dbpf lotest 10
DBR_LONG:           10        0xa                
epics> dbpf aotest 0x10
DBR_DOUBLE:         16                 
epics> dbpf lotest 0x10
DBR_LONG:           0         0x0                
epics>


Bruno

Replies:
Re: Conversion from hex number string to LONG-type field Andrew Johnson

Navigate by Date:
Prev: Re: epicsThreadGetStackSize Dirk Zimoch
Next: Re: Named Event, TSE and GeneralTime Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: epicsThreadGetStackSize Dirk Zimoch
Next: Re: Conversion from hex number string to LONG-type field Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024