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: haquin <haquin@ganil.fr>
To: Tim Mooney <mooney@aps.anl.gov>
Cc: tech-talk@aps.anl.gov
Date: Tue, 27 Oct 2009 11:50:55 +0100
Hi Tim,

Thank you for your proposal but:
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

Tim Mooney a écrit :
haquin wrote:
Hi,

I initialize the INPH (with macro substitution) of a gensub record with a string,
but it is never transferred to the corresponding H variable ...

in the IOC shell I use the commands:
epics> dbgf MyGensub.INPH
       DBR_STRING:          MyString NPP NMS

epics> dbgf MyGensub.H
       DBR_STRING:

The behaviour is different if I use LONG instead of STRING ...

Can someone tell me how to do retreive MyString in MyGensub.H ?
You can use a stringout record to hold the string, like so:

record(stringout, "myStringInit") {
   field(VAL, "$(MYSTRINGMACRO)")
   field(UDF, "0")
}
record(aSub, "myASub") {
   ....
   field(INPH, "myStringInit")
   ....
}

Then, dbLoadRecords("myDatabase.db", "MYSTRINGMACRO=MyString")


begin:vcard
fn:Christophe Haquin
n:Haquin;Christophe
email;internet:haquin@ganil.fr
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 Tim Mooney
Re: can't initialize record field with string Andrew Johnson
References:
can't initialize record field with string haquin
Re: can't initialize record field with string Tim Mooney

Navigate by Date:
Prev: Re: can't initialize record field with string Tim Mooney
Next: Re: can't initialize record field with string Tim Mooney
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 Tim Mooney
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 ·