PMAC Product Guide M{constant}={expression} Function : Set M-Variable value Type : Motion program (PROG and ROT) Syntax : M{constant}={expression} where {constant} is an integer constant from 0 to 1023 representing the number of the M-Variable. {expression} is a mathematical expression representing the value to be assigned to this M-Variable. This command sets the value of the specified M-Variable to that of the expression on the right side of the equals sign. Note: In a motion program, the assignment is done as the line is processed, not necessarily in order with the actual execution of the move commands on either side of it.
If it is in the middle of a continuous move sequence, the assignment occurs one or two moves ahead of its apparent place in the program (because of the need to calculate ahead in the program). To have the actual assignment of the value to the variable be synchronous with the beginning of the next move, use the synchronous M-Variable assignment command M{constant}=={expression} instead. Examples: M1=1 M102=$00FF M161=P161*I108*32 M20=M20 & $0F M{constant}=={expression} Function : Synchronous M-Variable value assignment Type : Motion program Syntax : M{constant}=={expression} where {constant} is an integer constant from 0 to 1023 representing the number of the M-Variable.
{expression} is a mathematical expression representing the value to be assigned to this M-Variable. This command allows the value of an M-Variable to be set synchronously with the start of the next move or dwell. This is useful especially with M-Variables assigned to outputs, so the output changes synchronously with beginning or end of the move. Non-synchronous calculations (with the single =) are fully executed ahead of time, during previous moves. In this form, the expression on the right side is evaluated just as for a non-synchronous assignment, but the resulting value is not assigned to the specified M-Variable until the start of the actual execution of the following motion command.
Note: Remember that if using this M-Variable in further expressions before the next move in the program is started, the value assigned in this statement will not be received. Examples: X10 M1==1 ; Set Output 1 at start of actual blending to next move. X20 M60==P1+P2 224 Buffer Commands