Delta Tau GEO BRICK LV ユーザーズマニュアル
Turbo PMAC User Manual
248
Turbo PMAC Computational Features
Logical Operators
Turbo PMAC has three logical operators that do bit-by-bit operations: & (bit-by-bit AND), | (bit-by-bit
OR), and ^ (bit-by- bit EXCLUSIVE OR). If floating-point numbers are used, the operation works on the
fractional as well as the integer bits. & has the same precedence as * and /; | and ^ have the same
precedence as + and -. Use of parentheses can override these default precedence levels.
OR), and ^ (bit-by- bit EXCLUSIVE OR). If floating-point numbers are used, the operation works on the
fractional as well as the integer bits. & has the same precedence as * and /; | and ^ have the same
precedence as + and -. Use of parentheses can override these default precedence levels.
Note:
These bit-by-bit logical operators are different from the simple Boolean operators
AND and OR used in compound conditions (q.v.).
AND and OR used in compound conditions (q.v.).
Functions
As in any programming language, Turbo PMAC mathematical functions perform mathematical operations
on constants or expressions to yield new values. The general format is:
on constants or expressions to yield new values. The general format is:
{function name} ({expression})
The available functions are:
SIN: Trigonometric
sine
COS: Trigonometric
cosine
TAN: Trigonometric
tangent
ASIN:
Trigonometric inverse sine (arcsine)
ACOS:
Trigonometric inverse cosine (arccosine)
ATAN:
Trigonometric inverse tangent (arctangent)
ATAN2:
Special two-argument, four-quadrant trigonometric inverse tangent
LN:
Natural logarithm (log base e)
EXP: Exponentiation
(e
x
)
SQRT:
Positive square root
ABS: Absolute
value
INT:
Truncation to integer (towards minus infinity)
Global I-variable I15 controls whether the trigonometric functions use degrees (I15 = 0) or radians (I15 = 1).
Detailed descriptions of each function, including domain and range, are given in the Software Reference
Manual.
Detailed descriptions of each function, including domain and range, are given in the Software Reference
Manual.
Expressions
A Turbo PMAC expression is a mathematical construct consisting of constants, variables, and functions,
connected by operators. Expressions can be used to assign a value to a variable, to determine a motion
program parameter, or as part of a condition. A constant can be an expression, so if the syntax calls for
{expression}, a constant may be used as well as a more complicated expression. No extra
parentheses are required for non-constant expressions, unlike when {data} is specified (see below).
Examples of expressions are:
connected by operators. Expressions can be used to assign a value to a variable, to determine a motion
program parameter, or as part of a condition. A constant can be an expression, so if the syntax calls for
{expression}, a constant may be used as well as a more complicated expression. No extra
parentheses are required for non-constant expressions, unlike when {data} is specified (see below).
Examples of expressions are:
512
P1
P1-Q18
1000*COS(Q25*3.14159/180)
I100*ABS(M347)/ATAN(P(Q3+1)/6.28)+5
The {DATA} Syntax
For Turbo PMAC purposes, if command syntax requires {data}, utilize either a constant that is not
surrounded by parentheses or an expression that is surrounded by parentheses. (Since a constant can be
an expression, it is legal to put a constant in parentheses, but this takes more storage and more calculation
time.)
surrounded by parentheses or an expression that is surrounded by parentheses. (Since a constant can be
an expression, it is legal to put a constant in parentheses, but this takes more storage and more calculation
time.)
For example, if the listed command syntax is T{data}, it is legal to use T100, T(P1+250*P2), or
T(100) (which is legal but wasteful).
T(100) (which is legal but wasteful).