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  <20102011  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  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Calling an iocsh "sub-script"
From: [email protected]
To: Mark Rivers <[email protected]>
Cc: tech-talk <[email protected]>
Date: Thu, 14 Oct 2010 09:27:07 -0700
Angus,

An even better trick I found (since iocsh is not scriptable)
is something like this

< device.defaultValues               # a set of epicsEnvSet entries
epicsEnvSet(NAME, "instance1")       # overwrite default values
< device.cmd                         # create an instance of the device

With a trick like this, you can develop the driver 
without interfering with the existing instances or modifying past stcmd files.
For example, if you want to add a feature to a driver, you just need to supply  
default values for the device already instanciated. 

You can push this even further
A subsystem (ex allMyAdcs) is a group of device

< adc1
#< adc2

Another high-level subsystem (ex bpm)

< allMyAdcs
< allMyDacs
< pvAliasAndOtherSoftVariables

An ioc is a group of subsystems

< kicker
< bpm

Now to troubleshoot an IOC, you can just comment out what should not run 
when the ioc is started. With the configuration above the adc2 will not be started.
You can actually start it in another IOC and bring it up and down at your will.
With a setup like this you can troubleshoot a synchrotron while operators are using it. 
Only the smallest parts that needs to be troubleshooted is down.  
The rest is up and operational.

You can even push this even further --  but in the other direction -- and separate the preIocInit and postIocInit sequences.
In preIocInit scripts you create the instances, set the var, start iocshScript.  
In postIocInit scripts you can test the instance was loaded correctly, start sequencer
In stcmd you load default paths, dbl * > nfsFile, etc. 

Enjoy!

--
Emmanuel

On 18:21 Tue 12 Oct     , Mark Rivers wrote:
> How about the following using the "<" to read another file:
> # other ioc commands go here
> epicsEnvSet MY_ENV A
> < mychildscript.cmd
> epicsEnvSet MY_ENV B
> < mychildscript.cmd
> # more ioc commands go here

References:
Calling an iocsh "sub-script" Angus Gratton
RE: Calling an iocsh "sub-script" Mark Rivers

Navigate by Date:
Prev: Re: Calling an iocsh "sub-script" Eric Norum
Next: RE: EPICS CA problems Jeff Hill
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Calling an iocsh "sub-script" Eric Norum
Next: EPICS CA problems Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 14 Oct 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·