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

Subject: Substitutions defaults and tricks
From: "Brown, Garth" <[email protected]>
To: "[email protected]" <[email protected]>
Date: Thu, 14 Nov 2013 17:09:55 -0800
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


Replies:
Re: Substitutions defaults and tricks Pietryla, Anthony F.
RE: Substitutions defaults and tricks Emmanuel Mayssat

Navigate by Date:
Prev: RE: areaDetector for a Basler GigE camera Mark Rivers
Next: Re: The results of your email commands Julio Calvo
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: LIB_INSTALLS, static builds and .so files. Andrew Johnson
Next: Re: Substitutions defaults and tricks Pietryla, Anthony F.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·