17.CUSTOM MACRO PROGRAMMING B-63324EN/03
- 582 -
n (1 to 9) of optional block skip/n cannot be replaced with a
No variable number can be specified directly using a variable.
[Example] When replacing 5 of #5 with #30, specify #[#30] instead of
Values exceeding the maximum allowable number for each address
cannot be specified.
[Example] When #140 = 120, G#140 exceeds the maximum allowable
When a variable is used as address data, the value of the variable is
automatically rounded to the significant number of decimal places for
[Example] If G00 X#1; is executed when #1 = 12.3456 on a machine
for which the increment system is 1/1000 mm (IS-B), the
result is G00 X12.346;.
By using <expression> described later, the number after an address can
be replaced with <expression>. When the following is programmed :
<Address>[<expression>] or <Address>-[<expression>]
the value of <expression> or the compliment of the value of
<expression> is used as the value of the address. Note that a constant
with no decimal point used in [ ] is assumed to have a decimal point at
- Undefined variable
When the value of a variable is not defined, such a variable is referred
to as a "null" variable. Variable #0 is always a null variable. It cannot
be written to, but it can be read.
When an undefined variable is quotated, the address itself is also
Original command G90 X100 Y#1
Equivalent command when #1 = <null>
Equivalent command when #1 = 0
G90 X100 Y0
(b) Definition/replacement, addition-type, multiplication-type
If a local variable or common variable is replaced directly with
<null>, the result becomes <null>. If a system variable is replaced
directly with <null>, or the result of an operation in which <null>
is used is replaced, it is treated in the same way as for a variable
assigned with 0.
Original arithmetic expression
(example of local variable)
#2=#1 #2=#1*5 #2=#1+#1
Replacement result (if #1=<null>)
<null> 0 0
Replacement result (if #1=0)