Garth,
If I understand what you want correctly you can have your substitution file setup like this:
pattern { SYS, SYS0_TS1, SYS1_TS1, TS1ST, .... }
{ SYS0, 1, 2, \$(TS1ST) , .... }
then your database will contain the macro $(TS1ST) and you can make your substitutions in the st.cmd file.
Tony
On Nov 14, 2013, at 7:09 PM, "Brown, Garth" <[email protected]>
wrote:
> We have a module which is used by many systems in slightly different environments. Each environment has a long list of default settings that work for nearly every IOC in that environment.
> If my environments are SYS0 and SYS1, and I want to define default values for the macro TS1ST, I can do something like this:
> Substitutions file for SYS0 contains
> file evrPatternAll.db
> {
> pattern { SYS, SYS0_TS1, SYS1_TS1, TS1ST, .... }
> { SYS0, 1, 2, \$(TS1ST=$($(SYS)_TS1)) , .... }
> ....
>
> And in the output, $($(SYS)_TS1)) becomes $(SYS0_TS1), which becomes 1, so $(TS1ST) from evrPatternAll.db is substituted by $(TS1ST=1), which is what I wanted as the default value in SYS0.
> If I want to use this for SYS1, I could change that to
> file evrPatternAll.db
> {
> pattern { SYS, SYS0_TS1, SYS1_TS1, TS1ST, .... }
> { SYS1, 1, 2, \$(TS1ST=$($(SYS)_TS1)) , .... }
> ....
>
> And I get $(TS1ST=2), the desired SYS1 default value.
> That may be a useful trick, but it's not quite what I want. The file my example is based on has lots more in the pattern line, and many more lines. To simplify maintenance and reduce errors for all the installations where we want to take the per-environment defaults, I want a way for users to just define SYS in one place, preferably a macro in dbLoadRecords. That would let you cut and paste one st.cmd line into new systems, while maintaining per-environment defaults centrally. Does anyone have a way to do that, or good alternatives for this type of problem?
>
> Thanks,
> Garth
>
--
Anthony Pietryla
Controls Engineer
Advanced Photon Source
Argonne National Laboratory
Phone: 630-252-7430
Fax: 630-252-6123
- Replies:
- RE: Substitutions defaults and tricks Brown, Garth
- References:
- Substitutions defaults and tricks Brown, Garth
- Navigate by Date:
- Prev:
Re: The results of your email commands Julio Calvo
- Next:
Job Announcement: US ITER Instrumentation & Controls Group Leader - 1st of a kind fusion reactor, international partnership, management role Cherry, Steve J.
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Substitutions defaults and tricks Brown, Garth
- Next:
RE: Substitutions defaults and tricks Brown, Garth
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|