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: How to pass system environment to .substitutions?
From: "Zhichu Chen" <[email protected]>
To: [email protected]
Date: Sat, 16 Aug 2008 05:11:30 +0000
Hi all,

I know I can use
==========================================
dbLoadRecords ("db/test.db","device=${DEV},channel=1")
dbLoadRecords ("db/test.db","device=${DEV},channel=2")
dbLoadRecords ("db/test.db","device=${DEV},channel=3")
dbLoadRecords ("db/test.db","device=${DEV},channel=4")
==========================================
in st.cmd script and epics will get the system environment "DEV" so
that I don't need to modify my ioc package and just use
export DEV=blahblah
on each device. But I kind of like my st.cmd script to be clean and neat,
thus I made some .substitutions file like:
======================
file "db/test.db" {
    pattern { device, channel }
        { "${DEV}", 1 }
        { "${DEV}", 2 }
        { "${DEV}", 3 }
        { "${DEV}", 4 }
}
======================
For your information, I may have many lines, so the latter is actually
I preferred. But when I put
dbLoadTemplate "db/test.substitutions"
in the st.cmd file instead of the above four messy lines, I got the following
error message:
========================================
dbLoadTemplate "db/test.substitutions"
macLib: macro DEV is undefined (expanding macro device)
========================================
Apparently DEV is not expanded before the records is loaded.
So I'm thinking maybe DEV is not expandable for .substitutions
files. I've searched the talk list but maybe I got the inappropriate
keywords, I didn't get a solution here. So may I ask is there
any way to do that? Or should I just put a bunch of dbLoadRecords
commands with the long ugly macros which can not break into
lines?





-- 
Best Regards
Chen
----------------------------------------------------------------

 Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
 | www.sinap.ac.cn
----------------------------------------------------------------

Replies:
RE: How to pass system environment to .substitutions? Allison, Stephanie

Navigate by Date:
Prev: Leap second at end of 2008. Thompson, David H.
Next: RE: How to pass system environment to .substitutions? Allison, Stephanie
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: Leap second at end of 2008. Thompson, David H.
Next: RE: How to pass system environment to .substitutions? Allison, Stephanie
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 ·