
B-63944EN/02 PROGRAMMING 16.CUSTOM MACRO
- 353 -
• When 0 is assigned to #1
Conditional
expression
#1 EQ #0 #1 NE 0 #1 GE #0 #1 GT 0 #1 LE #0 #1 LT 0
Evaluation
result
Not
established
(false)
Not
established
(false)
Established
(true)
Not
established
(false)
Established
(true)
Not
established
(false)
- Specifying a system variable (constant) by its name
A system variable (constant) is specified by its variable number, but it
can also be specified by its predetermined system variable (constant)
name. A system variable (constant) name begins with an underscore
(_), followed by up to seven uppercase letters, numerics, or
underscores. For axis-dependent variables (such as coordinates) or
variables having a lot of data of similar types (such as tool
compensation), subscript [n] (n: integer) can be used to specify values.
In this case, n can be specified in <expression> format (calculation
format). The command format must be specified in
[#system-variable-name] format, as shown below.
[#_DATE]
[Example]
[#_DATE]=20040117 ; : 2004.01.17 is assigned to #3011 (year
month date).
[#_TIME]=161705 ; : 16:17:05 is assigned to #3012 (time
minute second).
#101=[#_ABSMT[1]] ; : #5021 (machine coordinate value of
the 1st axis) is read off and assigned
to #101.
#102=[#_ABSKP[#500*2]] ; : #506x (skip position of [#500*2]th axis)
is read off and assigned to #102.
If a value other than an integer is specified for subscript n, a variable
value is referenced, assuming that the fractional portion is rounded
off.
[Example]
[#_ABSIO[1.4999999]] : This value is assumed to be [#_ABSIO[1]],
that is, #5001.
[#_ABSIO[1.5000000]] : This value is assumed to be [#_ABSIO[2]],
that is, #5002.
NOTE
1 When the specified variable name is not registered,
an alarm PS1098 is issued.
2 When a negative or other invalid subscript is
specified, an alarm PS1099 is issued.