EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: stringout in softIOC
From: Andrew Johnson <[email protected]>
To: <[email protected]>
Date: Mon, 3 Apr 2017 14:08:16 -0500
Hi Al,

On 04/03/2017 12:45 PM, Al Honey wrote:
> There are two records (in my contrived example below) the only
> difference between the two records is in the DOL field, [UBACKLASH]
> versus [“UBACKLASH”].

Straight away I can tell you that in 3.14 and 3.15 a DOL field can only
be used to constant-initialize any record's VAL field when the DOL field
contains a number. It's a bit complicated, but the issue is that for it
to recognized and treated as a CONSTANT link value the value string has
to be completely convertible into either a double using strtod() or into
a long using strtol(). If the string value fails those tests it must be
a PV_LINK so will be passed first to the DB link code and if lookup
there fails to the CA link code.

To initialize the value of a stringin or stringout record you should set
the VAL field directly in the .db file.

In 3.16 we're going to allow you to provide constant links containing
both strings and even arrays, but we can't retro-fit this into older
Base versions.

> soutT1 is loaded and the DOL field is interpreted as a CA_LINK and the
> OUT field as DB_LINK.

Expected, as described above.

> soutT2 has the value of DOL in double quotes, which was my attempt to
> force it to be a constant. When loaded both DOL and OUT get set to
> CONSTANT. The DOL value is lost and I don’t understand why OUT does not
> remain as a DB_LINK.

> record(stringout,"soutT2") {
>     field(DESC,"string output record")
>     field(SCAN,"Passive")
>     field(DTYP,"Soft Channel")
>     field(VAL,"string")
>     field(DOL,""UBACKLASH"")                 
>     field(OMSL,"supervisory")
>     field(OUT,"param.VAL PP")
> }

Did you get any warnings or errors when you loaded that database? I
don't think your DOL field setting was actually parsed as you think, the
second double-quote would have closed the string, but then the word
UBLACKLASH followed another empty string wouldn't have made sense to the
parser, so I think you should have got an error message from
dbLoadRecords(). That would also explain the field values you got:

> epics> dbpr soutT2,4
> DESC: string output record             
> DOL:CONSTANT       
> DTYP: Soft Channel 
> NAME: soutT2       
> OMSL: supervisory  
> OUT:CONSTANT       
> OVAL: string       
> SCAN: Passive      
> TSEL:CONSTANT      
> VAL: string

HTH,

- Andrew

-- 
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon

References:
stringout in softIOC Al Honey

Navigate by Date:
Prev: stringout in softIOC Al Honey
Next: Re: stringout in softIOC Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: stringout in softIOC Al Honey
Next: Re: stringout in softIOC Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024