Reference Manual

Turbo PMAC/PMAC2 Software Reference
Turbo PMAC Program Command Specification 445
The locking bit itself is always set to 1 at the end of a LOCK command. It will stay at 1 until cleared by
an UNLOCK command.
The status of locking bits 0-7 is reported as bits 4-11, respectively, of I4904.
If no motion program buffer or PLC program buffer is open when this command is issued, this command
will be executed immediately as an on-line command.
Example:
P10=1 ; Assume locked to start
WHILE(P10=1) ; Loop until unlocked
LOCK4,P10 ; Check status of locking bit 4
ENDWHILE
M1=M1^1 ; Invert Machine Output 1
UNLOCK4 ; Release process 4 for other tasks
M{data}
Function: Machine Code (M-Code)
Type: Motion program
Syntax: M{data}
where:
{data} is a floating-point constant or expression in the range 0.000 to 999.999, specifying the
program number and the line label to jump to
Turbo PMAC interprets this statement as a CALL 10n1.({data’}*1000) command, where n is the
hundreds’digit of {data}, and {data’} is the value of {data} without the hundred’s digit (modulo
100 in mathematical terms). That is, this statement causes a jump (with return) to motion program 10n1,
and the specified line label. (Usually programs 10n1 are used to implement the machine codes as the
system designer sees fit.) The value of {data’} can be from 0.0 to 99.999, corresponding to line labels
N0 to N99999.
This structure permits the implementation of customizable M-Code routines for machine-tool style
applications by the writing of subroutines in motion programs 10n1. Arguments can be passed to these
subroutines by following the M-Code with one or more sets of {letter}{data}, as in CALL and
READ statements.
Most users will have M-codes only in the range 0-99, which permits the use of PROG 1001 only, and
allows {data’} to equal {data} for direct specification of the line label.
Example:
M01 jumps to N1000 of PROG 1001
M12 jumps to N12000 of PROG 1001
M115 jumps to N15000 of PROG 1011
See Also:
Program commands CALL{data}, D{data}, M{data}, T{data}, RETURN
M{data}={expression}
Function: Set M-Variable Value
Type: Motion program (PROG and ROT)
Syntax: M{data}={expression}
where:
{data} is a constant, or an expression in parentheses, for an integer value from 0 to 8191
representing the M-variable number;