EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  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  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: if-then-else in iocsh
From: Emmanuel Mayssat <[email protected]>
To: Maren Purves <[email protected]>
Cc: [email protected]
Date: Fri, 28 Jan 2005 11:59:17 -0800
I use "dbLoad" files such as this one:

#----------------------------------------------------------------------
# HPS937A - LOAD RECORD INSTANCES
#----------------------------------------------------------------------
# Serial Port Number    =       ${SPN}
# Serial Configuration  =       9600 8N1
#----------------------------------------------------------------------

dbLoadRecords("${DB_DIR}/HPS937A.db","deviceName=${IOCNAME}:HPS937A:${SPN}:${PAD},
serialPortNumber=${SPN},primaryAddress=${PAD},
baudRate=${BR},numberOfDataBits=8,parity=0,numberOfStopBits=1");



those can be considered as template for intanciation.

In the stcmd file ( iocsh script ), I source those template files with a command as follow:

< /DBL_DIR/HPS937A.dbl

Now, before I source this file, I need to epicsSetEnv all the variables such as ${SPN} and ${PAD} and ${IOCNAME}. ( or they need to be defined in the linux shell )

Now, I would like to include in my dbl files a command that says:
If this variable is not set, then set it to this value.

This would enable me to just set the vars that are meaningful.
For example, baudRate could default to 9600. But if I really want to change it I can do so with epicsSetEnv(BR,19200).


--
E














Replies:
Re: if-then-else in iocsh Eric Norum
Re: if-then-else in iocsh Andrew Johnson
References:
if-then-else in iocsh Emmanuel Mayssat
Re: if-then-else in iocsh Andrew Johnson
Re: if-then-else in iocsh Maren Purves

Navigate by Date:
Prev: Re: if-then-else in iocsh Maren Purves
Next: Re: if-then-else in iocsh Eric Norum
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: if-then-else in iocsh Maren Purves
Next: Re: if-then-else in iocsh Eric Norum
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  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 ·