Reference Manual
PMAC 2 Software Reference
PMAC Program Command Specification 331
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.
Remarks
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.
(Programs 10n1 are usually 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.
If the specified program and/or line label do not exist, the M command is ignored, and the
program continues as if it were not there. No error is generated.
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.
Typically, M-codes will be 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
MACROAUXREAD
Function
Read MACRO auxiliary parameter value
Type
Background PLC (no motion program, PLC0, or compiled PLC)
Syntax
MACROAUXREAD{NodeNum}{ParamNum}{Variable}
MXR{NodeNum}{ParamNum}{Variable}
where:
• {NodeNum} is an integer constant from 0 to 15 specifying the slave number of the
node.
• {ParamNum} is an integer constant from 0 to 65535 specifying the auxiliary
parameter number for this node.
• {Variable} is the name of the PMAC variable (I, P, Q, or M) into which the
parameter value is to be copied.
Remarks
This command permits PMAC to read auxiliary register values from slave nodes across
the MACRO ring. The command must specify the node number of the slave node, the
auxiliary parameter number at this node, and the name of the PMAC variable to receive
the value.
Only one auxiliary access (read or write) of a single node can be done on one command
line.