Commonly used macro variable codes for FANUC and SIEMENS CNC
Date code
FANUC/Mitsubishi code:
#3011 (including year, month and day, such as 20170125)
Siemens code:
$_YEAR (year)
$_MONTH (month)
$_DAY (day)
Time code
FANUC/Mitsubishi code:
#3012 (including hours, minutes and seconds, such as 133045)
Siemens code:
$_HOUR (hour)
$_MINUTE (minute)
$_SECOND (second)
Tool length and tool compensation code
FANUC/Mitsubishi code:
#2001 T01 tool length
#2201 T01 tool compensation
#2002 T02 tool length
#2202 T02 tool compensation
---and so on---
Siemens code:
$TC_DP3[1,1] ;T01 tool length
$TC_DP6[1,1] ;T01 tool compensation
$TC_DP3[2,1] ;T02 tool length
$TC_DP6[2,1] ;T02 tool compensation
(DP3 here is not length wear, DP6 is not radius wear. If a tool uses multiple cutting edges, the tool number in [] will be misplaced)
Coordinate variables
FANUC/Mitsubishi code:
G54: #5221 (X) #5222 (Y) #5223(Z)
G55: #5241 (X) #5242 (Y) #5243(Z)
G56: #5261 (X) #5262 (Y) #5263(Z)
G57: #5281 (X) #5282 (Y) #5283(Z)
G58: #5301 (X) #5302 (Y) #5303(Z)
G59: #5321 (X) #5322 (Y) #5323(Z)
G54.1 P1: #7001 (X) #7002 (Y) #7003(Z)
G54.1 P2: #7021 (X) #7022 (Y) #7023(Z)
---And so on---
Siemens code:
G54
$P_UIFR[1,X,TR]
$P_UIFR[1,Y,TR]
$P_UIFR[1,Z,TR]
G55
$P_UIFR[2,X,TR]
$P_UIFR[2,Y,TR]
$P_UIFR[2,Z,TR]
G56
$P_UIFR[3,X,TR]
$P_UIFR[3,Y,TR]
$P_UIFR[3,Z,TR]
G57
$P_UIFR[4,X,TR]
$P_UIFR[4,Y,TR]
$P_UIFR[4,Z,TR]
G58
$P_UIFR[5,X,TR]
$P_UIFR[5,Y,TR]
$P_UIFR[5,Z,TR]
G59
$P_UIFR[6,X,TR]
$P_UIFR[6,Y,TR]
$P_UIFR[6,Z,TR]
G54.1P1
$P_UIFR[7,X,TR]
$P_UIFR[7,Y,TR]
$P_UIFR[7,Z,TR] |