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  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017 
<== Date ==> <== Thread ==>

Subject: Re: can't initialize record field with string
From: Andrew Johnson <anj@aps.anl.gov>
To: tech-talk@aps.anl.gov
Date: Tue, 27 Oct 2009 09:56:53 -0500
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
-- 
The best FOSS code is written to be read by other humans -- Harald Welte


Replies:
Re: can't initialize record field with string haquin
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

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