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  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  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  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Trouble with macro substitutions
From: "Johnson, Andrew N. via Tech-talk" <tech-talk at aps.anl.gov>
To: "Leblanc, Gregory" <leblanc at ohio.edu>
Cc: EPICS tech-talk <tech-talk at aps.anl.gov>
Date: Mon, 23 Aug 2021 16:43:04 +0000
Hi Greg,

On Aug 23, 2021, at 10:24 AM, Leblanc, Gregory via Tech-talk <tech-talk at aps.anl.gov> wrote:

I’m having some trouble getting this substitution magic to work in my .db files.  I think that when I run ‘make’ I should get some .db files, which should have all of the $(XxX) stuff replaced, based on the contents of the .substitutions file, as long as the filenames match.  However, I’m getting some things replaced, and others not.  For example, I have the following in Watlow_PM_General.template:
 
{
        field(INPA,     "$(s):$(ta):$(ss):$(mod):ControlMode$(ch) CP")
 
And this in Watlow_PM_General.substitutions:
 
file Watlow_PM_General.template
{
pattern {  s, ta,      ss, mod, ch}
        {   , SE,  Watlow,   1,  1}
}
 
But when I compile, I get things like this in Watlow_PM_General.db:
 
{
        field(INPA,     "SE:Watlow:1:1:ControlMode$(ch) CP")
 
I haven’t been able to figure out why the ch macro is the only one not getting replaced.  Full source is at: https://github.com/gregoryleblanc/CsHeater

Well the obvious explanation is that the empty value intended for your $(s) macro in the substitutions file is being ignored — you have actually found a bug in our msi tool.

If it were setting $(s) to an empty string the PV name should begin with a colon character ‘:’ in the expanded version but it doesn’t — is that what you want to happen? For a workaround if you want $(s) to be empty you can do that by using an empty pair of double-quotes instead, I have just tried that and it works.

HTH,

- Andrew


-- 
Complexity comes for free, simplicity you have to work for.


Replies:
Re: Trouble with macro substitutions Johnson, Andrew N. via Tech-talk
References:
Trouble with macro substitutions Leblanc, Gregory via Tech-talk

Navigate by Date:
Prev: Re: [EXTERNAL] Trouble with macro substitutions Hartman, Steven via Tech-talk
Next: Re: Trouble with macro substitutions Johnson, Andrew N. via Tech-talk
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  <20212022  2023  2024 
Navigate by Thread:
Prev: Re: [EXTERNAL] Trouble with macro substitutions Hartman, Steven via Tech-talk
Next: Re: Trouble with macro substitutions Johnson, Andrew N. via Tech-talk
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  <20212022  2023  2024 
ANJ, 23 Aug 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·