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  <20082009  2010  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  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: initial(init_value) rule within a field sometimes works
From: ivan <[email protected]>
To: [email protected]
Date: Wed, 24 Dec 2008 11:45:44 +0200
Hi, 
First time on tech-talk. Also new to epics.
I have been having trouble understanding why initial("init_value"), as a
rule within a field, works for some of my fields and not for others.

In my present ioc application I would prefer to initialize the field
from a substitutions file as then I can give individual initial values
to more than one process variable instead of one fixed value as defined
in the record .dbd file using initial.

I have included below, pieces from three files namely
 st.cmd (the ioc startup command),
 ioc.substitutions (a dbLoadTemplate file) and 
 iocpsc.db ( the .db that takes the substitutions from the pattern in
the substitute file)

in the st.cmd file I have:
dbLoadTemplate "../../db/ioc.substitutions"

in the ioc.substitutions file I have:
file ../../db/iocpsc.db {
    pattern { ioc,    pv,     crate,    module, chan, refval, refmax }
           { "ioc1", "eciv", "crate1", "0x00",  0,    20,      120   }
           { "ioc1", "ecii", "crate1", "0x00",  1,    0,       5    }
}

in the iocpsc.db file I have:
record(psc,"$(ioc):$(pv)")
{
 field(SCAN, "1 second")
 field(CRATE, "$(crate)")
 field(MODULE ,"$(module)")
 field(CHAN,$(chan))
 field(REFVAL,$(refval))
 field(REFMAX,$(refmax))
}


I find the strange effect that I can initialize the REFMAX field from
the substitutions file and in this case initial(120.0) below has no
effect, where as I cannot initialize the REFVAL field from the
substitutions file but it does initialize in the .dbd file to 12.0 as
initialized from the file below.  Both fields are doubles defined in
pscRecord.h:
	double		refval;	/*Reference Value*/
	double		refmax;	/*Max Reference V - sets max*/


in the pscRecord.dbd file I have:
	field(REFVAL, DBF_DOUBLE){
		prompt("Reference Value")
		asl(ASL1)
		special(SPC_MOD)
                initial(12.0)
	}	
	field(REFMAX, DBF_DOUBLE){
		prompt("Max Reference V - sets max")
		asl(ASL1)
		special(SPC_MOD)
                initial (120.0)
	}	

In summary it seems that if initial has no effect in the .dbd file then
I can initialize the fields from the substitute file, which is the way I
would like to do it.
many thanks,
Ivan. 


Navigate by Date:
Prev: Re: SUB Record SNAM/INAM routine definition Tim Mooney
Next: initial(init_value) rule within a field sometimes works - follow up ivan
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: SUB Record SNAM/INAM routine definition Tim Mooney
Next: initial(init_value) rule within a field sometimes works - follow up ivan
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·