User's Manual

PMAC User Manual
Computational Features 159
Why Needed
When assigning values to variables is part of the calculation, the variables will get their new values ahead
of their place in the program when looking at actual move execution. For P and Q-variables, this is
generally not a problem, because they exist only to aid further motion calculations. However, for M-
variables, particularly outputs, this can be a problem, because with a normal variable value assignment
statement, the action will take place sooner than is expected, looking at the statement's place in the
program.
For example, in the program segment
X10 ; Move X-axis to 10
M1=1 ; Turn on Output 1
X20 ; Move X-axis to 20
expect that Output 1 would be turned on at the time the X-axis reached position 10. But since PMAC is
calculating ahead, at the beginning of the move to X10, it will have already calculated through the
program to the next move, working through all program statements in between, including M1=1, which
turns on the output. Therefore, using this technique, the output will be turned on sooner than desired.
How They Work
Synchronous M-variable assignment statements were implemented as a solution to this problem. When
one of these statements is encountered in the program, it is not executed immediately; rather, the action is
put on a stack for execution at the start of the actual execution of the next move in the program. This
makes the output action properly synchronous with the motion action.
In the modified program segment
X10 ; Move X-axis to 10
M1==1 ; Turn on Output 1 synchronously
X20 ; Move X-axis to 20
the statement M1==1 (the double-equals indicates synchronous assignment) is encountered at the
beginning of the move to X10, but the action is not actually performed until the start of blending into the
next move (X20).
Note:
With synchronous assignment, the actual assignment is performed where the
blending to the new move begins, which is generally ahead of the programmed
point. In LINEAR and CIRCLE mode moves, this blending occurs V*TA/2
distance ahead of the specified intermediate point, where V is the commanded
velocity of the axis, and TA is the acceleration (blending) time.
Also, notice that the assignment is synchronous with the commanded position, not necessarily the actual
position. It is the responsibility of the servo loop to make the commanded and actual positions match
closely.
In applications where PMAC is executing segmented moves (I13>0), the synchronous M-variables are
executed at the start of the first I13 spline segment after the start of blending into the programmed move.
Note:
Synchronous M-variables after the last move or DWELL in the program do not
execute when the program ends or temporarily stops. Use a DWELL as the last
statement of the program to execute these statements.