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: Fwd: How to pass system environment to .substitutions?
From: "Zhichu Chen" <[email protected]>
To: [email protected]
Date: Wed, 20 Aug 2008 10:49:35 +0800
Hi Stephanie,


On Mon, Aug 18, 2008 at 11:17 PM, Allison, Stephanie
<[email protected]> wrote:
> 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
>

Sorry, maybe I haven't made myself clear but this is not what I wanted
and the very reason I asked the question.

I need testAll.db to be loaded many times so I don't like to put a lot of
dbLoadRecords commands in the st.cmd script. Besides, I have like
five or six macros in the .db file so that I can make it universal to the
instruments in my charge. But when it appears in the st.cmd script, it's
a long line and not supposed to be broken into several lines which,
I'm sorry, doesn't seem perfect to me. While if I use the "pattern" form
of a .substitutions template, the macros are just grouped logically.
It's very nice except it can't accept the system environment.


By the way, I have the
DB += testAll.db testAll.substitutions
in my Makefile otherwise if I load the testAll.substitutions template which
contains "file db/testAll.db" will fail to execute at the very first line.

--
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: Fwd: How to pass system environment to .substitutions? Andrew Johnson
References:
How to pass system environment to .substitutions? Zhichu Chen
RE: How to pass system environment to .substitutions? Allison, Stephanie

Navigate by Date:
Prev: Re: Is there anyone using EPICS for a FDA approved device? Bill Nolan
Next: EPICS meeting in 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: RE: How to pass system environment to .substitutions? Allison, Stephanie
Next: Re: Fwd: How to pass system environment to .substitutions? Andrew Johnson
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 ·