Fanuc Series 15i/150i-MA (Programming) Operators Manual

B-63324EN/03 PROGRAMMING 17.CUSTOM MACRO
- 583 -
Original arithmetic expression
(example of common variable)
#100=#1 #100=#1*5 #100=#1+#1
Replacement result (if #1=<null>)
<null> 0 0
Replacement result (if #1=0)
00 0
Original arithmetic expression
(example of system variable)
#2001=#1 #2001=#1*5 #2001=#1+#1
Replacement result (if #1=<null>)
<null> 0 0
Replacement result (if #1=0)
00 0
(c) Conditional expressions
<vacant> differs from 0 only for EQ and NE
Conditional
expression
#1 EQ #0 #1 NE 0 #1 GE #0 #1 GT 0 #1 LE #0 #1 LT 0
When #1 = <null> Valid
(True)
Valid
(True)
Valid
(True)
Invalid
(False)
Valid
(True)
Invalid
(False)
When #1 = 0 Invalid
(False)
Invalid
(False)
Valid
(True)
Invalid
(False)
Valid
(True)
Invalid
(False)
- Naming of system variables (constants)
A system variable (constant) is specified using a variable number. A
system variable (constant) can also be specified using a preassigned
system variable (constant) name. A system variable (constant) name
starts with an underscore (_), and consists of up to eight characters
including uppercase letters, numeric characters, and underscores (_).
For variables such as axis-dependent variables (such as coordinates)
and variables (such as tool compensation values) that may involve
many items of similar data, [n] (n : integer) can be specified as the
suffix of each name. In this case, n can be specified for <expression>
or in arithmetic expression format. When specifying a system variable
name, use the format [# system variable name] indicated below :
[#_DATE]
[Example]
[#_DATE] = 19980817; : Assigns 1998.08.17 to #3011
Year/month/day).
[#_TIME] = 161705; : Assigns 16 : 17 : 05 to #3012 (hours :
minutes : seconds).
#101 = [#_ABSMT[1]]; : Reads #5021 (machine coordinate of the
first axis), and assigns the read value to
#101.
#102 = [#_ABSKP[#500*2]]; : Reads #506x (skip position of the
[#500*2]-th axis, and assigns the read
value to #102.
If a non-integral value is specified as suffix n, the value of n is rounded
off to the nearest integer to reference the variable value.
[Example]
[#_ABSIO[1.4999999]] : [#_ABSIO[1]], namely, #5001 is assumed.
[#_ABSIO[1.5000000]] : [#_ABSIO[2]], namely, #5002 is assumed.

Leave a Reply

Your email address will not be published. Required fields are marked *