Andy Foster wrote:
> Has anyone successfully used CALCULATION records with
> capfast 3.02.23?
>
> I found the following:
>
> B=0?1:A was rejected with "missing question mark in conditional expression"
> A%6 was rejected with "Illegal Operand"
> B*(A+1) was rejected with "Illegal Operand"
>
> In my opinion, this makes this version of Capfast unusable with CALC records.
>
> Are these known bugs which have been fixed or are there **really**
> syntax errors in the above expressions?
>
> If they have been fixed, please can I get hold of a working version.
Appended is the comments about the checking of the CALC field syntax for
EPICS applications that was in the release notes. To avoid the problems
put the following in your ~/schedit.rc
:set checkEPICSexprs NO
I have tested your expressions in my version (3.02.25) and found the
same problems, but according to the release note they are legal. I will
let the guys at Phase 3 know about it. I feel they have gone a bit over
the top in all this - they have reinvented our RPN parser. What would
have been more sensible would have been to use our parser to check the
validity of the expression.
Can someone tell me how we could and if we could let Phase 3 have a copy
of postfix.c? I know this would probably involve lawyers, but since
it is purely for the benefit of the Epics community, then maybe there
may be a workaround.
Nick Rees
Joint Astronomy Centre Ph: +1 (808) 961-3756
660 N. Aohoku Place Fax: +1 (808) 961-6516
Hilo, HI. 96720 Internet: [email protected]
--- The following is from the Capfast release notes ---------------------
X. Reserved use of CALC for EPICS applications
When the internal variable, checkEPICSexprs, has been set to YES,
the property rules editor reserves the property name, CALC, for
arithmetic or logical expressions that use only certain legal
operands (defined as any single character A through L and RNDM)
and the following legal operators:
Alg. Trig.
operator Meaning operators Meaning
-------- ------- --------- -------
ABS Absolute value (unary) SIN Sine
SQR Square root (unary) SINH Hyperbolic sine
MIN Minimum (binary function) ASIN Arc sine
MAX Maximum (binary function) COS Cosine
CEIL Ceiling (unary) COSH Hyperbolic cosin
FLOOR Floor (unary) ACOS Arc cosine
LOG Log base 10 (unary) TAN Tangent
LOGE Natural log (unary) TANH Hyperbolic tange
EXP Exponential function (unary) ATAN Arc tangent
^ Exponential (binary)
** Exponential (binary)
+ Addition (binary) Relational
- Subtraction (binary) Operators
* Multiplication (binary) ----------
/ Division (ginary) <,>,<=,>= As prev. defined
% Modulo (binary) = Equal to
NOT Negate (binary) # Not equal to
Logical Bitwise
Operators Operators
--------- ---------
&& And | Bitwise Or
|| Or & Bitwise And
! Not OR Bitwise Or
AND Bitwise And
XOR Bitwise Excl. Or
- One's Complement
<< Left shift
>> Right shift
Open and closed parenthesis, and nested parenthesis are allowed.
Commas may only be used to separate the arguments of a binary function.
The editor will allow the "C" question mark operator in the following
format:
(condition)? True result : False result
SAMPLE expressions for reserved use of CALC:
Expression Result
---------- ------
A + B A + B
(A | B) < (C + D) 1 if (A+B)<(C+D)
0 if (A+B)>=(C+D)
(A+B)<(C+D)?E:F E if (A+B)<(C+D)
F if (A+B)>=(C+D)
(A+B)<(C+D)?E E if (A+B)<(C+D)
unchanged if (A+B)>=(C+D)
A&B converts A to integer, converts B to integer,
bit-wise And A and B, convert result to floating
point
- Navigate by Date:
- Prev:
RE: e2sr and the CALC record Eric Bjorklund, NPSM
- Next:
CA API: Future directions? Peregrine McGehee
- 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
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Capfast 3.02.23 and CALC records Andy Foster
- Next:
CA API: Future directions? Peregrine McGehee
- 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
2021
2022
2023
2024
|