Mark,
Thank you - it works.
Yesterday I was nearly and tried something like
file "top/db/motor.db" ...
where
top = "/ade/epics/iocTop/R3.14.7/SystemVerX/"
But it didn't work and I found another unliked way.
Now
file "$(TOP)/db/motor.db" ...
Thanks again, Andrei.
-----Original Message-----
From: Mark Rivers [mailto:[email protected]]
Sent: Friday, June 30, 2006 1:46 PM
To: Liyu, Andrei; [email protected]
Subject: RE: question about dbLoadTemplate()
Hi Andrei,
dbLoadTemplate uses the environment variable substitution that EPICS
provide. My .substitutions files look like this:
file "$(CARS)/CARSApp/Db/motor.db"
{
pattern
{P, M, DTYP, C, S, DESC, EGU, DIR,
VELO, VBAS, ACCL, BDST, BVEL, BACC, SREV, UREV, PREC,
DHLM, DLLM}
{13LAB:, m1, "OMS VME58", 0, 0, "Tilt1", degrees, Pos, .07,
0, .2, 0, 1, .2, 2000, 1.0, 4, 20, -20}
{13LAB:, m2, "OMS VME58", 0, 1, "Tilt2", degrees, Pos, .07,
0, .2, 0, 1, .2, 2000, 1.0, 4, 20, -20}
{13LAB:, m3, "OMS VME58", 0, 2, "X", mm, Pos, .07,
0, .2, 0, 1, .2, 2000, 1.0, 4, 8, -8}
{13LAB:, m4, "OMS VME58", 0, 3, "Y", mm, Pos, .07,
0, .2, 0, 1, .2, 2000, 1.0, 4, 8, -8}
}
file "$(OPTICS)/opticsApp/Db/table.db"
{
pattern
{P, Q, T, M0X, M1X, M2X, M0Y, M1Y, M2Y,
M2Z, GEOM}
{13LAB:, MON:T1, MON:t1, junk, junk, junk, m2, m1, m3,
junk, SRI}
}
file "$(MOTOR)/motorApp/Db/sumDiff2D.db"
{
pattern
{P, T, SUM, DIFF, M1DRV, M1RBV, M2DRV, M2RBV,
M1STOP, M1DONE, M2STOP, M2DONE, PREC}
{13LAB:, KBV:, pm1, pm2, m7.VAL, m7.RBV, m8.VAL, m8.RBV,
m7.STOP, m7.DMOV, m8.STOP, m8.DMOV, 1}
}
file "$(SSCAN)/sscanApp/Db/scanParms.db"
{
{P=13LAB:,SCANREC=13LAB:scan1,Q=MON:T1X,POS=MON:t1.X,RDBK=MON:t1.XRB}
{P=13LAB:,SCANREC=13LAB:scan1,Q=MON:T1Y,POS=MON:t1.Y,RDBK=MON:t1.YRB}
{P=13LAB:,SCANREC=13LAB:scan1,Q=MON:T1Z,POS=MON:t1.Z,RDBK=MON:t1.ZRB}
{P=13LAB:,SCANREC=13LAB:scan1,Q=MON:T1AX,POS=MON:t1.AX,RDBK=MON:t1.AXRB}
{P=13LAB:,SCANREC=13LAB:scan1,Q=MON:T1AY,POS=MON:t1.AY,RDBK=MON:t1.AYRB}
{P=13LAB:,SCANREC=13LAB:scan1,Q=MON:T1AZ,POS=MON:t1.AZ,RDBK=MON:t1.AZRB}
}
So CARS, OPTICS, MOTOR and SSCAN are environment variables defined in
cdCommands (vxWorks) or envPaths (other systems). These are maintained
by the EPICS build facility through configure/RELEASE.
Note that I am loading .db files directly from the source (App/Db)
directory, rather than installing into db/, but that is just a personal
preference.
Mark
> -----Original Message-----
> From: Liyu, Andrei [mailto:[email protected]]
> Sent: Friday, June 30, 2006 12:00 PM
> To: [email protected]
> Subject: question about dbLoadTemplate()
>
> Hi,
>
> Standard way to use dbLoadTemplate()is
> 1. ***st.cmd***
> cd $TOP
> dbLoadTemplate( "db/Test.substitutions")
>
> 2. Test.substitutions has links to templates files
> ...
> file db/Test1.template ...
> file db/Test2.template ...
>
> So Test.substitutions and templates (Test1.template and
> Test2.template)
> files should be in the same directory (in this example top/db/ )
>
> How can it be used if the files are in the different directories?
>
> I found a way in vxWorks.
> For example, Test.substitutions is in
> /ade/epics/iocCommon/"IOCName"/Data
> and Test.template is in
> /ade/epics/iocTop/R3.14.7/SystemX/R2-0/db. Then
>
> 1. st.cmd has
>
> SubstitutionPath=malloc( 100)
> sprintf SubstitutionPath, "/ade/epics/iocCommon/%s/Data",iocName
> nfsMount nfsServer,SubstitutionPath,"/SubPath"
>
> TemplatePath=malloc( 100)
> sprintf TemplatePath, "/ade/epics/iocTop/R3.14.7/SystemX/R2-0/db"
> nfsMount nfsServer, TemplatePath,"/TemPath"
>
> ...
> cd "/SubPath"
> dbLoadTemplate("Test.substitutions")
>
> 2. Test.substitutions file has
>
> file TemPath/Test1.template ...
> (!!! "file top/db/Test1.template ..." doesn't work)
>
> It works. But that is spaghetti's way and I suppose it will
> not work in
> Windows and Linux.
>
> So question:
> Has anyone done something similar (to have template and substitutions
> files in different directories)?
>
> Thanks, Andrei.
>
- References:
- RE: question about dbLoadTemplate() Mark Rivers
- Navigate by Date:
- Prev:
Re: Lesson learned: LINR, LINEAR, SLOPE, R3.13, R3.14, breakpoint tables Andrew Johnson
- Next:
Matlab interfaces Korhonen Timo
- 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:
RE: question about dbLoadTemplate() Mark Rivers
- Next:
Matlab interfaces Korhonen Timo
- 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
|