
B-63944EN/02 PROGRAMMING 16.CUSTOM MACRO
- 351 -
- System variable
A variable whose usage does not vary in the system. The attribute of
a system variable is READ only, WRITE only, or READ/WRITE
enabled depending on the nature of a system variable.
- System constant
A system constant can be referenced as with a variable even though its
value is fixed. The attribute of a system constant is READ only.
- Omission of the decimal point
When a variable value is defined in a program, the decimal point can
be omitted.
[Example]
When #1 = 123; is defined, the actual value of variable #1 is 123.000.
- Referencing variables
The value following an address can be replaced with a variable.
When programming as <address>#i or <address>-#i, the variable
value or the complement of it is used as the specified value of the
address.
[Example] F#33 is the same as F1.5 when #33 = 1.5.
Z-#18 is the same as Z-20.0 when #18 = 20.0.
G#130 is the same as G3 when #130 = 3.0.
A variable cannot be referenced using address/, :, or O and N.
[Example] Programming such as O#27 or N#1 is not allowed.
n (n = 1 to 9) in the optional block skip /n cannot be a variable.
A variable number cannot be specified by a direct variable.
[Example] When replacing 5 in #5 with #30, specify #[#30] instead of ##30.
No values exceeding the maximum allowable value for each
address can be specified.
[Example] When #140 = 120, G#140 exceeds the maximum allowable
value.
When a variable is used as address data, the variable is
automatically rounded off to the number of significant figures of
each address or less.
[Example] For a machine with an increment system of 1/1000 mm (IS-B),
when #1 = 12.3456, G00 X#1; becomes G00 X12.346;.
If <expression>, described later, is used, the value following an
address can be replaced with <expression>.
<address>[<expression>] or <address>-[<expression>]
The program code shown above indicates the value of <expression> or
the complement of the value is used as an address value. Note that a
constant with no decimal point, enclosed in brackets ([ ]), is assumed
to have a decimal point at the end.
[Example] X[#24+#18*COS[#1]]
Z-[#18+#26]