User's Manual

PMAC User Manual
158 Computational Features
Function
truncation function
Syntax
INT ({expression})
Domain
all reals
Domain units
free
Range
integers
Range units
free
Possible errors
none
Expressions
A 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. Examples of
expressions are:
512
P1
P1-Q18
1000*COS (Q25*3.14159/180)
I100*ABS (M347)/ATAN (P(Q3+1)/6.28)+5
Data
For PMAC purposes, if command syntax requires {data}, either a constant that is not surrounded by
parentheses, or an expression that is surrounded by parentheses can be utilized. (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).
Variable Value Assignment Statement
This type of statement calculates and assigns a value to a variable. When a value assignment statement is
sent to PMAC, if a program buffer is open, the statement is added to the buffer. If not, it is executed
immediately. The standard assignment syntax is:
{variable name}={expression}
where {variable name} specifies which variable is to be used, and {expression} represents the
value to be assigned to the variable.
I-Variable Default Value Assignment
A statement with the syntax:
I{data}=*
will assign to the specified I-variable the manufacturer's default value for that variable (not the user's
EEPROM-stored value).
Synchronous M-Variable Value Assignment
In a motion program, when PMAC is blending or splining moves together, it must be calculating in the
program ahead of the actual point of movement. This is necessary in order to be able to blend moves
together at all, and to be able to do reasonable velocity and acceleration limiting. Depending on the mode
of movement, calculations while blending may occur one, two, or three moves ahead of the actual
movement.