(Common to Power Mate i–D and –H)
13. CUSTOM MACRO
Brackets ([, ]) are used to enclose an expression. Note that parentheses
( , ) are used for comments.
Errors may occur when operations are performed.
Table 13.3 (b) Errors involved in operations
Type of error
a = b*c 1.55×10
a = b / c 4.66×10
Relative error( 1)
a = b + c
a = b – c
a = SIN [ b ]
a = COS [ b ]
a = ATAN [ b ] / [ c ]
1 The relative error depends on the result of the operation.
2 Smaller of the two types of errors is used.
3 The absolute error is constant, regardless of the result of the
4 Function TAN performs SIN/COS.
The precision of variable values is about 8 decimal digits. When very
large numbers are handled in an addition or subtraction, the expected
results may not be obtained.
When an attempt is made to assign the following values to
variables #1 and #2:
the values of the variables become:
In this case, when #3=#2–#1; is calculated, #3=100000.000 results.
(The actual result of this calculation is slightly different because
it is performed in binary.)
Also be aware of errors that can result from conditional expressions
using EQ, NE, GE, GT, LE, and LT.
IF[#1 EQ #2] is effected by errors in both #1 and #2, possibly
resulting in an incorrect decision.
Therefore, instead find the difference between the two variables
Then, assume that the values of the two variables are equal when
the difference does not exceed an allowable limit (0.001 in this