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: RE: How to pass system environment to .substitutions?
From: "Allison, Stephanie" <[email protected]>
To: "Zhichu Chen" <[email protected]>, <[email protected]>
Date: Mon, 18 Aug 2008 08:17:31 -0700
Hi Chen, 

> 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 }
> }
> ======================

Let's say the "some .substitutions file" had a name like "testAll.substitutions" and that you add a line to your Makefile like this:

DB += testAll.db

The build should create testAll.db from your testAll.substitutions file (I use "should" since I don't know what version of epics you are using).

> For your information, I may have many lines, so the latter is actually
> I preferred. But when I put
> dbLoadTemplate "db/test.substitutions"

If you have the build create "testAll.substitutions", then you would add this line to your st.cmd:

dbLoadRecords ("db/testAll.db","device=${DEV})

Stephanie Allison


References:
How to pass system environment to .substitutions? Zhichu Chen

Navigate by Date:
Prev: How to pass system environment to .substitutions? Zhichu Chen
Next: Agenda for Padua Dalesio, Leo
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: How to pass system environment to .substitutions? Zhichu Chen
Next: Fwd: How to pass system environment to .substitutions? Zhichu Chen
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 ·