EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: Re: can't initialize record field with string
From: haquin <[email protected]>
To: Andrew Johnson <[email protected]>
Cc: [email protected]
Date: Tue, 27 Oct 2009 16:38:06 +0100
Hi Andrew,

Thank you for this clarification.

Initially I wanted to configure a gensub input as a string with number of element >=2 (string array input),
and initialize it with MACRO substitution.

I understand this is not possible because a string is considered as a CA_LINK.

But can you still answer the following questions:
- is it possible to initialize an array with a MACRO (be it numeric or string) ?
- is it possible to initialize a string array from the startup script using dbpf command or else ?

regards.


Andrew Johnson a écrit :
Hi Christophe,

On Tuesday 27 October 2009 05:50:55 haquin wrote:
I looked in the genSub record code and I think that what I do should work
... After deeper investigations, it turns out that when I initialize the
INPH field type with FTH=STRING or CHAR it is then assigned a CA_LINK type
((*plinkin).type)==CA_LINK instead of CONSTANT ... That's why the Constant
string is not copied at init.

When FTH=LONG then ((*plinkin).type)==CONSTANT

How can I force it to be a CONSTANT

You can't; with the existing database code the link type will be CONSTANT only if the INPH string is a number. This behavior is a fundamental feature of the way in which we parse link strings: If the string is completely consumed by strtod() or strtol() the link type is a CONSTANT; if not and it matches the name of a local PV it's a DB_LINK, otherwise it must be a CA_LINK.

As an alternative to Tim's suggestion you could put one or more dbpf commands in your startup script to set the .H field with your string(s), but they must appear after the iocInit command.

Sorry,

- Andrew
begin:vcard
fn:Christophe Haquin
n:Haquin;Christophe
email;internet:[email protected]
tel;work:02 31 45 46 61
x-mozilla-html:FALSE
version:2.1
end:vcard


Replies:
Re: can't initialize record field with string Andrew Johnson
Re: can't initialize record field with string Bruce Hill
References:
can't initialize record field with string haquin
Re: can't initialize record field with string Tim Mooney
Re: can't initialize record field with string haquin
Re: can't initialize record field with string Andrew Johnson

Navigate by Date:
Prev: ICALEPCS 2009 Lifetime Achievement Award Ned Arnold
Next: Re: can't initialize record field with string Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: can't initialize record field with string Andrew Johnson
Next: Re: can't initialize record field with string Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·