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: RE: Substitutions defaults and tricks
From: Emmanuel Mayssat <[email protected]>
To: "Brown, Garth" <[email protected]>, "Pietryla, Anthony F." <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Tue, 19 Nov 2013 10:42:58 -0800
> Hi Tony,
> In your example, there wouldn't be an option of whether you define TS1ST in st.cmd. You lose the default value so you must define it. The problem that I'm trying to solve is that there are literally hundreds of values with facility-specific defaults, not just TS1ST, and of those values most systems only need to define non-default values for a few of them if any.


Use include files with epicsEnvSet!

Example:

1/ FILE WITH DEFAULT VALUES
cat > all_my_default_valules.dft <<EOT
epicsEnvSet(SNOVA_DEVN, "SNOVA" )
epicsEnvSet(SNOVA_FSEP, "_" )
#And a lot more...
EOT

2/ FILE WITH DBLOAD
cat > database_load.dbl <<EOT
dbLoadRecords("${DB_DIR}/snova_asynStream.db","deviceName=${SNOVA_DEVN},_=${SNOVA_FSEP},asynPort=${SNOVAA_PORT},streamProtocol
=${SNOVAA_PROT}");
# And a lot more...
EOT

3/ IOC STARTUP FILE
cat > RunMe <<EOT
#!/usr/bin/env snova-3_14_11

< ${EPICS_IOCHOST}/envPaths                                                  # Path variables
dbLoadDatabase("${DBD_DIR}/snova.dbd")
snova_registerRecordDeviceDriver(pdbbase)

< ${DFT_DIR}/snova.dft
epicsEnvSet(SNOVA_DEVN, "SNOVA_1")                                      # First instance with non default name SNOVA_1
< ${DBL_DIR}/snova_streamEthernet.dbl

< ${DFT_DIR}/snova.dft
epicsEnvSet(SNOVA_DEVN, "SNOVA_2")                                      # Second instance with non default name SNOVA_2
< ${DBL_DIR}/snova_streamEthernet.dbl

iocInit()
EOT

Enjoy!
--
Emmanuel

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

Navigate by Date:
Prev: RE: Convertion for asynFloat64 Mark Rivers
Next: RE: Substitutions defaults and tricks Emmanuel Mayssat
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: Substitutions defaults and tricks Michael Davidsaver
Next: RE: Substitutions defaults and tricks Emmanuel Mayssat
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 ·