EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  <19971998  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  Index 1994  1995  1996  <19971998  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 
<== Date ==> <== Thread ==>

Subject: Re: Bad CALC record kills IOC
From: [email protected] (Tim Mooney)
To: [email protected]
Cc: [email protected]
Date: Mon, 7 Jul 1997 16:14:26 -0500
Andrew Johnson writes...

> > BAD:
> > 
> > grecord(calc,"$(Ring):BXBCM:TEMPA") {
> >         field(SCAN,"10 second")
> >         field(CALC,"( (A&C) >> 3 ) - B")
> > ...
> 
> The thing which I see as significant in these differences is that Ron
> has taken the literal "3" out of the expression and put it into the
> input D instead.  I have been aware for some time that literals aren't
> always accepted in CALC expressions (but some work fine -- thats the
> wierd thing about it).  I suspect this may be the area of the problem,
> but I'm only guessing.  It may relate to a literal with an adjacent
> space, which matches where Rozelle's saw the error being reported.

Your exactly right.

Literals (i.e., FLOAT_PT_CONST's in postfix.c) aren't accepted in CALC
expressions when they are preceded by a space.  This is because literals
are parsed twice, and the second parse doesn't accept spaces.  (The first
parse, which all expression elements undergo, does handle leading spaces.)

If the line marked below is added to postfix.c, the problem goes away.

-----excerpt from postfix.c-----------
long postfix(pinfix,ppostfix,perror)
.
.
.
	    case FLOAT_PT_CONST:
		if (!operand_needed){
		    *perror = 5;
		    return(-1);
		}

		/* add constant to the expression */
		*ppostfix++ = pelement->code;
		pposthold = ppostfix;

		pinfix-=no_bytes;
>>>----->	while (*pinfix == ' ') *ppostfix++ = *pinfix++;
		while (TRUE) {
.
.
.
---------------------------------------

Tim Mooney
Beamline Controls & Data Acquisition
Advanced Photon Source
Argonne National Lab

Replies:
Re: Bad CALC record kills IOC Marty Kraimer

Navigate by Date:
Prev: CPU speed on mv162/167 Ralph Lange
Next: RE: SGL encoder in EPICS Eric Bjorklund, NPSM
Index: 1994  1995  1996  <19971998  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: Bad CALC record kills IOC Ralph Lange
Next: Re: Bad CALC record kills IOC Marty Kraimer
Index: 1994  1995  1996  <19971998  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 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·