3 parametric expressions as g- or m- codes – Rockwell Automation 8520 9/Series CNC Lathe User Manual
Page 680
![background image](/manuals/579999/680/background.png)
Paramacros
Chapter 28
28-6
You can use parametric expressions to specify G-codes or M-codes in a
program block.
For example:
G#1 G#100 G#500 M#1 M#100 M#500;
G#520 G[#521-1] G[#522+10] M#520 M[#522+1] M[#522+10];
When using a parametric expression to specify a G-- or M-code, remember:
When specifying more than one G-- or M-code in a block from the same
modal group, the G-- or M-code closest to the End-of-Block of that
block is the one activated. All others in that modal group are ignored.
Parametric expressions that generate G-- or M-codes used to call a
paramacro are invalid. If the result of the paramacro expression for a
G-code is 65, 66, 66.1, or any AMP-defined G-code, the error
“ILLEGAL G-CODE” appears. If the result of the paramacro
expression for an M-code is any AMP-defined M-code, the control will
not execute the macro but interpret the M--code as either a system
defined M--code or a user defined M--code. No error is generated.
To get the G-- or M-code value, the system will truncate, after the tenths
position, the result of the mathematical expression. The following
example assumes #1=37.0:
This Block
Generates This G-Code
G#1
G37.0
G[#1+0.32]
G37.3
G[#1+0.49]
G37.4
Illegal Paramacro Commands
It is possible to call subprograms or paramacros within an MDI program,
however, there are limitations to the allowable commands. The following
lists examples of illegal MDI commands for these features:
G66
G66.1
G67
DO--END
WHILE--DO--END
GOTO
IF--GOTO
M99
Amp--defined Modal G--code Macro Calls
Attempting to use any of the above as MDI commands, 9/Series generates
an “ILLEGAL MACRO CMD VIA MDI” error message.
28.1.3
Parametric Expressions as
G- or M- Codes