Skip to main content
Version: 2.8

FANUC Data Access

This chapter outlines all possible native addresses to access memory and data. These addresses must be configured within the device configuration.

Format

A native FANUC address has following format:

{memory base}.{memory type}.{data type}:{address}(.{bit}?)(°{axis}?)`
Note

{bit} and {axis} depend on the memory to read. Check the sections below.

For array reading writing in PCODE and CUSTOM-MV memory, special array addresses are used:

{memory base}.{memory type}.{data type}:{address}[{arraySize}]`

The arraySize argument must be between 1 and 4096.

Memory Base

The CNC control provides different bases for memory:

Memory BaseDescription
GlobalGlobal memory base.
Nc1...Nc10Nc channel memory base. Not that there could exist shared memory between nc channels (path). In this case two different addresses will point to the exact same memory.
Pmc1...Pmc3Pmc channel memory base.
DcsDual check safety memory base.

Memory Type

Each memory base can have one or several memory types:

Memory BaseMemory TypeDescription
GlobalPCodeGlobal P-code memory
ParamGlobal parameter memory (axis parameter only)
SystemGlobal CNC Information
Nc1...Nc10PCodeChannel specific P-code memory
CustomMVCustomer macro variables
ParamChannel specific parameter memory
DiagnosisChannel specific diagnostic memory
DynamicDynamic memory (process and program states)
ProgramExtended program states (see Dynamic for common states)
ModalModal memory (commanding state)
OffsetOffset memory (G54, G55, ...)
ToolDataTool Data from tool table (Radius, Length, Magazine, ...)
ToolOffsetTool Offset Memory (T1, T2, ...)
ToolLifeTool Life Data
AxisAxis state memory (current, load, ...)
SpindleSpindle memory (current, load, ...)
TimerTimer memory (power on, operation, cycle, cutting, ...)
SystemSystem Information of the Nc-System
Pmc1...Pmc3, DscPmc_AMessages
Pmc_CCounters
Pmc_DData tables
Pmc_EExtra relay
Pmc_FInput signal to PMC from CNC
Pmc_GOutput signal from PMC to CNC
Pmc_KKeep relay
Pmc_MInput signal from another PMC path
Pmc_NOutput signal to another PMC path
Pmc_RInternal relay
Pmc_TTimer
Pmc_XInput signal from PMC to machine
Pmc_YOutput signal to PMC from machine
Pmc_ZSystem relay
SystemSystem information of the PMC

Data Types

Address Data TypeDescriptionData Type
BoolBit information. 0 = not set; 1 = setSystem.Boolean
Uint8Byte information (unsigned 8bit integer)System.Byte
Uint16Word information (unsigned 16bit integer)System.UInt16
Uint32DWord information (unsigned 32bit integer)System.Uint32
Int32Signed integer (32bit)System.Int32
Float64Floating point number (64bit)System.Double
StringString informationSystem.String
AutoAuto detecting data type (available only for Parameters and Diagnosis)Auto Detected

Examples

Nc5.Offset.Float64:1°1 addresses the offset memory of the 5th Nc-channel.

Dcs.Pmc_R.Uint32:0 addresses the R-memory of the dual check safety channel.

Global System Configuration

The global system configuration can only be read or monitored. Writing is not possible.

AddressDescriptionData Type
Global.System.String:0Control NameSystem.String
Global.System.Int32:1Connection status of the control
  • 0 = Disconnected
  • 1 = Connected
System.Int32
Global.System.Int32:2Sign of life (toggle bit if connection is established)System.Int32
Global.System.Int32:3Global number of axisSystem.Int32

NcChannel System Configuration

The Nc system configuration can only be read or monitored. Writing is not possible.

AddressDescriptionData Type
Nc{n}.System.Int32:0Number of axis available in the addressed nc channelSystem.Int32
Nc{n}.System.String:1Names of all axis in a semi-colon separated string (e.g. X;Y;Z;C).System.String
Nc{n}.System.Int32:100Number of tools available for Tool OffsetSystem.Int32
Nc{n}.System.Int32:1000Max number of tool groups (available only when ToolLifeManagement capability)System.Int32
Nc{n}.System.Int32:1001Max number of tools (available only when ToolLifeManagement capability)System.Int32
Nc{n}.System.Int32:1002Max life time of tool (available only when ToolLifeManagement capability)System.Int32
Nc{n}.System.Int32:1003Max number of cutting cycles (available only when ToolLifeManagement capability)System.Int32

Dynamic Memory

The dynamic memory can only be read or monitored. Writing is not possible.

Program Information

AddressDescriptionData Type
Nc{n}.Dynamic.Float64:0Main program numberSystem.Double
Nc{n}.Dynamic.Float64:1Current program numberSystem.Double
Nc{n}.Dynamic.Float64:2Current sequence numberSystem.Double
Nc{n}.Dynamic.Float64:3Current spindle speedSystem.Double
Nc{n}.Dynamic.Float64:4Current Axis feedSystem.Double

The following data access points require the capability of program management:

NOTE

The main program name and block number (program line) is supported by:

  • Fanuc0i (Model D, F)
  • Fanuc30i
  • Fanuc31i
  • Fanuc32i
  • Fanuc35i
  • PowerMotion i
AddressDescriptionData Type
Nc{n}.Program.String:0Main program name (for 0i_F and 30i-A/B, the program names can be character string).System.String
Nc{n}.Program.Int32:1Current block number (Program Line Nr.)System.Int32
Nc{n}.Program.String:2Current executing block as textSystem.String
Nc{n}.Program.Int32:3Current sequence number.System.Int32
Nc{n}.Program.String:10Program header of current selected program. The header contains program name/number and the comment.System.String
NOTE

Use Nc{n}.Program.Int32:3 to prevent a well known FANUC issue about sequence number mismatch, when returning from a Macro-B program into Macro-Executer. See issues [Open FANUC Issues].

Operation Information

AddressDescriptionData Type
Nc{n}.Dynamic.Float64:5Running state
0 = RESET
1 = STOP
2 = HOLD (program interrupted)
3 = START (program running)
4 = MSTR (during retraction and re-positioning of tool retraction and recovery, and operation of JOG MDI)
System.Double
Nc{n}.Dynamic.Float64:6Alarm state
0 = NO ALARM
1 = ALARM
2 = BATTERY LOW
3 = FAN (NC or Servo Amplifier)
4 = PS Warning
5 = FSSB Warning
6 = LEAKAGE Warning
7 = ENCODER Warning
8 = PMC Alarm
System.Double
Nc{n}.Dynamic.Float64:7Emergency state
0 = none
1 = Emergency
2 = Reset
3 = Wait (FS35i only)
System.Double
Nc{n}.Dynamic.Float64:8Operation mode
0 = MDI (Manual Data Input)
1 = MEM (or automatic mode)
2 = reserved
3 = EDIT (or programming mode)
4 = HANDLE
5 = JOG (or hand mode)
6 = TEACH IN JOG
7 = TEACH IN HANDLE
8 = INC FEED
9 = REFERENCE (referencing the axis)
10 = REMOTE
System.Double
Nc{n}.Dynamic.Float64:9Program restart mode (this might require a Fanuc option)
0 = program not edited
1 = program edited
System.Double

Axis Positions

There are four axis position types in FANUC

  • Machine Positions: machine position coming from the servo motors and axis scales
  • Absolute Positions: workpiece related positions towards a workpiece zero point
  • Relative Positions: nullable axis positions used to move relative.
  • Distance to Go: distance towards the target position (only valid if the nc program is running)

To counter check the values, go to FANUC POS screen:

AddressDescriptionData Type
Nc{n}.Dynamic.Float64:100Machine positionsSystem.Double[]
Nc{n}.Dynamic.Float64:200Absolute positionsSystem.Double[]
Nc{n}.Dynamic.Float64:300Relative positionsSystem.Double[]
Nc{n}.Dynamic.Float64:400Distance to goSystem.Double[]

Each one of these memories can be also read by axis number:

AddressDescriptionData Type
Nc{n}.Dynamic.Float64:100°{x}Machine position of x-th axisSystem.Double
Nc{n}.Dynamic.Float64:200°{x}Absolute position of x-th axisSystem.Double
Nc{n}.Dynamic.Float64:300°{x}Relative position of x-th axisSystem.Double
Nc{n}.Dynamic.Float64:400°{x}Distance to go of x-th axisSystem.Double

Example: Nc1.Dynamic.Float64:100°3 reads the machine position of the third axis from the Nc channel 1.

Modal values are commanded by the nc program. They are located on the process screen on FANUC.

The driver supports following readings:

  • G-commands of current and next ISO block
  • Modal-parameters (A-Z) of current and next ISO block
  • Globally active Modal parameters (as text of double array)

The addresses of the modal commands are in following format:

Nc{x}.Modal.{datatype}:{address}
AddressDescriptionData Type
Nc{n}.Modal.String:0°{x}Active G-code of the current block. {x} specifies the G-code group. This depends on the FANUC control type (e.g. 30i ranges from 1 to 36).System.String
Nc{n}.Modal.String:1°{x}G-code of the next (preceding) block.System.String
Nc{n}.Modal.String:10Reading all active G-codes of the current block. The string is “;” separated.System.String
Nc{n}.Modal.String:11Reading all active G-codes of the next block. The string is “;” separated.System.String

G-Codes are grouped. This means only one G-code can be active within a specific group:

Group-Nr {x}FANUC 15FANUC 3xi, 0i-D/E/F M-SeriesFANUC 3xi, 0i-D/E/F – T-Series (System A)FANUC 3xi, 0i-D/E/F – T-Series (System B)FANUC 3xi, 0i-D/E/F – T-Series (System C)
0G00, G01, G02, G02.y, G03 G03.y, G06.1, G06.2, G33, G60G00, G01, G02, G02.y, G03, G03.y, G06.2, G32.2, G33, G34, G35, G36, G75, G77, G78, G79G00, G01, G02, G02.y, G03, G03.y, G06.y, G32, G34, G35, G36, G90, G92, G94G00, G01, G02, G02.y, G03, G03.y, G06.y, G33, G34, G35, G36, G77, G78, G79G00, G01, G02, G02.y, G03, G03.y, G06.y, G33, G34, G35, G36, G77, G78, G79
1G17, G18, G19G17, G71.1, G18, G19G96, G97G96, G97G96, G97
2G90, G91G90, G91-G90, G91G90, G91
3G22, G23G22, G23G68, G69G68, G69G68, G69
4G93, G94, G95G93, G93.1, G93.2, G94, G95G93, G93.3, G98, G99G93, G93.3, G98, G99G93, G93.3, G98, G99
5G20, G21G20 (G70), G21 (G71)G20, G21G20, G21G20, G21
6G40, G41, G41.2, G41.3, G42, G42.2G40, G41, G41.y, G42, G42.yG40, G41, G41.y, G42, G42.yG40, G41, G41.y, G42, G42.yG40, G41, G41.y, G42, G42.y
7G43, G43.1, G44, G49G43, G43.y, G44, G44.1G25, G26G25, G26G25, G26
8G73. G74, G76, G80, G81, G82, G83, G84, G84.2, G84.3. G85, G86, G87, G88, G89G73. G74, G76, G80, G81, G81.2, G82, G83, G84, G84.2, G84.3. G85, G86, G87, G88, G89G22, G23G22, G23G22, G23
9G98, G99G98, G99G80, G81, G82, G83, G83.1, G83.5, G84, G84.1, G84.2, G85, G86, G87, G87.5, G87.6, G88, G89G80, G81, G82, G83, G83.1, G83.5, G84, G84.1, G84.2, G85, G86, G87, G87.5, G87.6, G88, G89G80, G81, G82, G83, G83.1, G83.5, G84, G84.1, G84.2, G85, G86, G87, G87.5, G87.6, G88, G89
10G50, G51G50, G51-G98, G99G98, G99
11G66, G66.1, G67G66, G66.1, G67G66, G66.1, G67G66, G66.1, G67G66, G66.1, G67
12G96, G97G96, G97---
13G54, G54.1, G54.2, G55, G56, G57, G58, G59G54, G54.1, G54.2, G55, G56, G57, G58, G59G54, G54.1, G54.2, G55, G56, G57, G58, G59G54, G54.1, G54.2, G55, G56, G57, G58, G59G54, G54.1, G54.2, G55, G56, G57, G58, G59
14G61, G62, G63, G64G61, G62, G63, G64G61, G62, G63, G64G61, G62, G63, G64G61, G62, G63, G64
15G68, G69G68, G68.2, G68.3, G68.4, G69G17, G17.1, G18, G19G17, G17.1, G18, G19G17, G17.1, G18, G19
16G15, G16G15, G16G68.y, G69.1G68.y, G69.1G68.y, G69.1
17G50.1, G50.2G40.1 (G150), G41.1 (G151), G42.1 (G152)-G50, G51G50, G51
18G40.1, G41.1, G42.1G25, G26G40.1, G41.1, G42.1G40.1, G41.1, G42.1G40.1, G41.1, G42.1
19-G160, G161G50.2 (G250), G51.2 (G251)G50.2 (G250), G51.2 (G251)G50.2 (G250), G51.2 (G251)
20-G12.1 (G112), G13.1 (G113)G12.1 (G112), G13.1 (G113)G12.1 (G112), G13.1 (G113)G12.1 (G112), G13.1 (G113)
21-G50.1, G51.1G50.1, G51.1G50.1, G51.1G50.1, G51.1
22-G54.2G43, G43.y (G44.7), G44, G44.1, G49 (G49.1)G43, G43.y (G44.7), G44, G44.1, G49 (G49.1)G43, G43.y (G44.7), G44, G44.1, G49 (G49.1)
23-G80.5, G81.5G15, G16G15, G16G15, G16
24G25, G26-G05.5. G05.6G05.5. G05.6G05.5. G05.6
25G12.1, G13.1-G54.4G54.4G54.4
26-G44.9, G49.9G80.5, G81.5G80.5, G81.5G80.5, G81.5
27G80.5, G81.5-G80.4, G81.4G80.4, G81.4G80.4, G81.4
28--G08.8, G08.9G08.8, G08.9G08.8, G08.9
29-G54.3G05.7, G05.8G05.7, G05.8G05.7, G05.8
30-G50.2, G51.2G10.3, G10.4, G10.5G10.3, G10.4, G10.5G10.3, G10.4, G10.5
31-G05.5, G05.6---
32-G54.4---
33-G80.4, G81.4---
34-G12. G13---
35-G08.8, G08.9---
36-G05.7, G05.8---

The modal parameters are all variables of an ISO program except G-commands.

  • Positions, like X, Y and Z values
  • Feed, parameter F
  • Tool id, parameter T
  • ...

These parameters can be read as single value (like “programmed feed”, or as double array returning all parameter at once, or as text like X102.00 F910 M3.

AddressDescriptionData Type
Nc{n}.Modal.Float64:2°{x}Other commanded modal variables of the current block. {x} specifies the command id (letter). See table below.System.Double
Nc{n}.Modal.Float64:3°{x}Other commanded modal variables of the next block.System.Double
Nc{n}.Modal.Float64:4°{x}Global modal variables. {x} specifies the command id (letter). See table below.System.Double
Nc{n}.Modal.Float64:12Reading all commanded modal variables of the current block and returns an array.System.Double[]
Nc{n}.Modal.Float64:13Reading all commanded modal variables of the next block and returns an array.System.Double[]
Nc{n}.Modal.Float64:14Reading all globally active modal variables and returns an array.System.Double[]
Nc{n}.Modal.String:22Reading all commanded modal variables of the current block. The data is returned as a formatted string.System.String
Nc{n}.Modal.String:23Reading all commanded modal variables of the next block. The data is returned as a formatted string.System.String
Nc{n}.Modal.String:24Reading all globally active modal variables. The data is returned as a formatted string.System.String

Example: Nc1.Modal.String:22 returns X-12.281 Z90 F0.6

The following table show the mapping of {x} to the command id (letter):

xCommandxCommandxCommandxCommand
0A8I16Q24Y
1B9J17R25Z
2C10K18S26M (2nd)
3D11L19T27M (3rd)
4E12M (1st)20U28M (4th)
5F13N21V29M (5th)
6G14O22W
7H15P23X

Tool Offset Memory

Tool offset memory is used to correct a single tool (or tool edge).

To counter check the values, go to the SET-screen on FANUC and click on [OFFSET]:

The tool offset memory is readable and writeable.

IMPORTANT

Note that the axis numbers are not the id’s from the real axis, but the geometric axis id. The correlation between real axis id and geometric axis id is set in FANUC parameters (see FANUC Manual).

AddressDescriptionData Type
Nc{n}.ToolOffset.Float64:{x}°1X-axis geometry offsetSystem.Double
Nc{n}.ToolOffset.Float64:{x}°2Y-axis geometry offsetSystem.Double
Nc{n}.ToolOffset.Float64:{x}°3Z-axis geometry offset or tool length offset (tool length geometry)System.Double
Nc{n}.ToolOffset.Float64:{x}°4Nose radius geometry offset (Cutter radius geometry)System.Double
Nc{n}.ToolOffset.Float64:{x}°5Direction of imaginary tool noseSystem.Double
Nc{n}.ToolOffset.Float64:{x}°6X-axis wear offsetSystem.Double
Nc{n}.ToolOffset.Float64:{x}°7Y-axis wear offsetSystem.Double
Nc{n}.ToolOffset.Float64:{x}°8Z-axis wear offset or tool wear offset (tool length wear)System.Double
Nc{n}.ToolOffset.Float64:{x}°9Cutter radius wearSystem.Double

{x} specifies the tool number (typically 1...32, but there exist options to range up to 2000).

Reading memory using addresses without °{x} returns the whole structure as a double-array:

AddressDescriptionData Type
Nc{n}.ToolOffset.Float64:{x}Tool offset dataSystem.Double[]

Workpiece Offset Memory

The workpiece offset memory is used to offset (correct) the absolute positions in relation to the zero point on the workpiece.

FANUC has different memories that can be switched in nc program:

  • G54-G59: standard workpiece offsets
  • G54.x : extended workpiece offsets

To counter check the values, go to the SET-screen on FANUC and click on [WORK]:

The work offset memory is readable and writable. To access the memory, axis number must be given: {x}.

Single Value

Axis values are automatically converted to metric or inches respectively.

AddressDescriptionData Type
Nc{n}.Offset.Float64:0°{x}Reads or writes the external work zero offset valueSystem.Double
Nc{n}.Offset.Float64:1°{x}Reads or writes the work zero offset value of G54System.Double
Nc{n}.Offset.Float64:2°{x}Reads or writes the work zero offset value of G55System.Double
Nc{n}.Offset.Float64:3°{x}Reads or writes the work zero offset value of G56System.Double
Nc{n}.Offset.Float64:4°{x}Reads or writes the work zero offset value of G57System.Double
Nc{n}.Offset.Float64:5°{x}Reads or writes the work zero offset value of G58System.Double
Nc{n}.Offset.Float64:6°{x}Reads or writes the work zero offset value of G59System.Double

Depending on FANUC control options, following extended work zero offsets can be accessed:

Series 15/15i and 0i-D:

AddressDescriptionData Type
Nc{n}.Offset.Float64:{y}°{x}Reads or writes the work zero offset value of G54.1 P{y-6} with {y} ranging from 7 to 54System.Double

M Series 16/18/21, 16i/18i/21i, 0i-A/B/C and
M/T Series 0i-F and 30i:

AddressDescriptionData Type
Nc{n}.Offset.Float64:{y}°{x}Reads or writes the work zero offset value of G54.1 P{y-6} with {y} ranging from 7 to 306System.Double

Arrays

For arrays, only reading is supported.

AddressDescriptionData Type
Nc{n}.Offset.Float64:0Reads the external work zero offset valueSystem.Double[]
Nc{n}.Offset.Float64:1Reads the work zero offset value of G54System.Double[]
Nc{n}.Offset.Float64:2Reads the work zero offset value of G55System.Double[]
Nc{n}.Offset.Float64:3Reads the work zero offset value of G56System.Double[]
Nc{n}.Offset.Float64:4Reads the work zero offset value of G57System.Double[]
Nc{n}.Offset.Float64:5Reads the work zero offset value of G58System.Double[]
Nc{n}.Offset.Float64:6Reads the work zero offset value of G59System.Double[]

Depending on your control, following extended work zero offsets can be read:

Series 15/15i and 0i-D:

AddressDescriptionData Type
Nc{n}.Offset.Float64:{y}°Reads or writes the work zero offset value of G54.1 P{y-6} with {y} ranging from 7 to 54System.Double[]

M Series 16/18/21, 16i/18i/21i, 0i-A/B/C and
M/T Series 0i-F and 30i:

AddressDescriptionData Type
Nc{n}.Offset.Float64:{y}°Reads or writes the work zero offset value of G54.1 P{y-6} with {y} ranging from 7 to 306System.Double[]

Axis Status and Diagnostics

The axis status and diagnostic memory can only be read or monitored. Writing is not possible.

AddressDescriptionData Type
Nc{n}.Axis.Float64:0Reads the servo meter of all axisSystem.Double[]
Nc{n}.Axis.Float64:1Reads the servo current of all axisSystem.Double[]
Nc{n}.Axis.Float64:2Reads the servo loop gain of all axisSystem.Double[]

Each one of these memories can be also read by axis number:

AddressDescriptionData Type
Nc{n}.Axis.Float64:0°{x}Reads the servo meter of the x-th axisSystem.Double
Nc{n}.Axis.Float64:1°{x}Reads the servo current of the x-th axisSystem.Double
Nc{n}.Axis.Float64:2°{x}Reads the servo loop gain of the x-th axisSystem.Double
info

Other axis data is accessible using the FANUC Trace.

Spindle Status

Spindle status must be read aside from the axis status.

AddressDescriptionData Type
Nc{n}.Spindle.Float64:0Reads the load meter of all spindlesSystem.Double[]
Nc{n}.Spindle.Float64:1Reads the speeds of all spindlesSystem.Double[]

Each one of these memories can be also read by spindle number:

AddressDescriptionData Type
Nc{n}.Spindle.Float64:0°{x}Reads the load meter of the x-th spindleSystem.Double
Nc{n}.Spindle.Float64:1°{x}Reads the speed of the x-th spindleSystem.Double
info

Other spindle data is accessible using the FANUC Trace.

Timer

FANUC provides different timers:

AddressDescriptionData Type
Nc{n}.Timer.Float64:0Reads the power on timer [min]System.Double
Nc{n}.Timer.Float64:1Reads the operation timer [min]System.Double
Nc{n}.Timer.Float64:2Reads the cutting timer [min]System.Double
Nc{n}.Timer.Float64:3Reads the cycle timer [min]System.Double
Nc{n}.Timer.String:10Reads the system date and timeSystem.String

FANUC also provides two timers on the NC side: a millisecond timer #3001 and an hour timer #3002.

Use the CustomMV address to access these timers:

  • Nc{n}.CustomMV.Float64:3001 for millisecond timer (read/write)
  • Nc{n}.CustomMV.Float64:3002 for hour timer (read/write)

Customer Macro Variables

The addresses of customer macro variables are in the following format:

Nc{n}.CustomMV.Float64:{address}

The {address} must be in the range of the CNC settings.

AddressDescriptionData Type
Nc{n}.CustomMV.Float64:{1...33}Reads or writes local variables belonging to the macro program being executed. ONLY READING!System.Double
Nc{n}.CustomMV.Float64:{100...999}Reads or writes common variables. The range depends on the CNC settings and optionsSystem.Double
Nc{n}.CustomMV.Float64:{1000...}Reads or writes system variables. ONLY READING!System.Double
Nc{n}.CustomMV.Float64:{98000...98499}Reads or writes common variables. The range depends on the CNC settings and optionsSystem.Double

Example:

  • Nc1.CustomMV.Float64:20 reads the local variable #20 on the first NC path.
  • Nc2.CustomMV.Float64:900 reads the common variable #900 on the second NC path.

Arrays

The customer macro variables can also be read or written as an array. The array size can be freely chosen between 1 to 4096.

Nc{n}.CustomMV.Float64:{address}[{arraySize}]

Example:

  • Nc1.CustomMV.Float64:500[32] reads 32 common variables starting from #500 on the first NC path.

Variable Ranges

Depending on the FANUC control type and their options, different variable ranges are valid:

CNC TypeOptionRanges
Series 15 M/T0100,..,149
500,..,549
1100,..,199
500,..,599
2100,..,199
500,..,699
3100,..,199
500,..,999
Series 15 TT0100,..,149
500,..,524
1100,..,149
500,..,549
2100,..,149
500,..,599
3100,..,149
500,..,749
Series 15i3100,..,199
500,..,999
4100,..,199
200,..,999
Series 16/18/21, 16i/18i/21i, 0i-A/B/C0100,..,149
500,..,531
1100,..,199
500,..,999
2100,..,199
500,..,599
Series 16i/18i-W0100,..,149
500,..,531
1100,..,314
500,..,699
2100,..,149
500,..,699
3100,..,314
500,..,531
4100,..,149
500,..,999
5100,..,314
500,..,999
Power Mate i0100,..,149
500,..,531
1100,..,199
500,..,999
2100,..,199
500,..,699
Series 30i/31i/32i, 0i-D/F, PMi-A0100,..,149
500,..,549
1100,..,199
500,..,999
2100,..,149
200,..,499
500,..,549
3100,..,499
500,..,999
4100,..,199
500,..,999
98000,..,98499
5100,..,499
500,..,999
98000,..,98499
IMPORTANT

Reading arrays only works inside one range.

P-Code Variables

The addresses of the P-code variables are in the following format:

Nc{n}.PCode.Float64:{address}

The {address} must be in the range of the CNC settings.

AddressDescriptionData Type
Nc{n}.PCode.Float64:{10000...89999}Reads or writes a P-code addressSystem.Double
Nc{n}.PCode.Float64:{< 10000}Reads or writes a System P-code address of “conversation” macroSystem.Double

Example:

  • Nc1.PCode.Float64:10000 reads the P-code variable #10000 on the first NC path.

Arrays

The P-code variables can also be read or written as an array. The array size can be freely chosen between 1 to 4096.

Nc{n}.PCode.Float64:{address}[{arraySize}]

Example:

  • Nc1.PCode.Float64:10100[32] reads 32 common variables starting from #10100 on the first NC path.

PMC Variables

The addresses of the PMC variables are in the following format:

{PmcType}.{MemoryType}.{DataType}:{address}.{bit?}

Following pmc types are supported:

PMC TypeDescription
Pmc1Main PMC (first PMC channel)
Pmc2Second PMC channel
Pmc3Third PMC channel
DcsDual check safety channel

Following memory types are supported:

Memory TypeDescription
Pmc_AMessages
Pmc_CCounters
Pmc_DData tables
Pmc_EExtra relay
Pmc_FInput signal to PMC from CNC
Pmc_GOutput signal from PMC to CNC
Pmc_KKeep relay
Pmc_MInput signal from another PMC path
Pmc_NOutput signal to another PMC path
Pmc_RInternal relay
Pmc_TTimer
Pmc_XInput signal from PMC to machine
Pmc_YOutput signal to PMC from machine
Pmc_ZSystem relay
IMPORTANT

The pmc type Dcs supports only memory types Pmc_R and Pmc_D.

The base data type of all pmc memory is Uint8. All other data types are derived accordingly:

Data TypeDescriptionExample
BoolReading or writing a bit information. Bit information require the {bit} number (0 to 7) after the memory address.Pmc1.Pmc_D.Bool:100.1
Uint8Reading or writing a byte informationPmc2.Pmc_A.Uint8:9
Uint16Reading or writing a word informationDcs.Pmc_R.Uint16:192
Uint32Reading or writing a dword informationPmc1.Pmc_X.Uint32:100

PMC Information

The addresses of the PMC information variables are in the following format:

Pmc1.System.String:{address}

Following addresses are supported:

AddressDescription
Pmc1.System.String:0Machine tool builder name
Pmc1.System.String:1Machine tool name
Pmc1.System.String:2NC & PMC type name
Pmc1.System.String:3PMC program number
Pmc1.System.String:4Edition number
Pmc1.System.String:5Program drawing number
Pmc1.System.String:6Creation date of the program
Pmc1.System.String:7Author of the program
Pmc1.System.String:8Company or person who wrote the ROM
Pmc1.System.String:9Remarks

Parameter

The addresses of the parameter variables are in the following format:

Nc{n}.Param.{datatype}:{address}{.bit?}{°axis?}

Global{n}.Param.{datatype}:{address}{.bit?}{°axis?}

The {bit} or {axis} part must be added depending on the parameter from FANUC. The {bit} can only be added for Bool data type.

Data TypeDescriptionExample
BoolReading or writing a bit information. Bit information require the {bit} number 0 to 7 after the memory address.Nc1.Param.Bool:100.1 or Nc5.Param.Bool:3201.1°5
Uint8Reading or writing a byte information.Nc1.Param.Uint8:9
Uint16Reading or writing a word information.Nc6.Param.Uint16:192
Uint32Reading or writing a dword information.Nc2.Param.Int32:5241
Int32Reading or writing an integer information.Nc2.Param.Int32:5241
Float64Reading or writing a float value information.Nc3.Param.Float64:9281°1
AutoReading or writing a value information. The data type is automatically detected from the parameter info on the CNC.Nc3.Param.Auto:981°1
Note

Use global addresses to access axis parameter from multiple NC path, e.g. Global.Param.Uint8:981°1. To know how many axis are globally available, use Global.System.Int32:3. This feature is only supported for 0i-D/F, 30i-A/B, 31i-A/B and Power Motion-i controls.

Note

For Axis parameters, it's possible to read all axis at once. The data is returned as an array. The data type of the DataNode must be an array type, like System.Double[]. In this case {axis} is left out, e.g. Global.Param.Uint8:981. Important: This can be used only to read axis parameters. Writing axis parameter requires exact addresses including {axis}.

Example: Reading the channel (path) assignment of each axis. This must be read globally to receive information from all channels (paths). The parameter is byte based and it returns a byte-array because Global.Param.Uint8:981 contains no {axis} address.

{
"Id": "5ab17bbc-3759-4eb0-bcc2-02600046d62c",
"Name": "AxisInChannel",
"Address": "Global.Param.Uint8:981",
"DataType": "System.Byte[]",
"Unit": "",
"Access": {
"Read": true,
"Receive": true
},
"Properties": []
}

Diagnosis

The addresses of the diagnosis variables are in the following format:

Nc{n}.Diagnosis.{datatype}:{address}{.bit?}{°axis?}

The {bit} or {axis} part must be added depending on the diagnosis item you want to read. Note that {bit} can only be added for Bool data type.

Data TypeDescriptionExample
BoolReading a bit information. Bit information require the {bit} number 0 to 7 after the memory address.Nc1.Diagnosis.Bool:100.1 or Nc5.Diagnosis.Bool:3201.1°5
Uint8Reading a byte information.Nc1.Diagnosis.Uint8:9
Uint16Reading a word information.Nc6.Diagnosis.Uint16:192
Uint32Reading a dword information.Nc2.Diagnosis.Int32:5241
Int32Reading an integer information.Nc2.Diagnosis.Int32:5241
Float64Reading a float value information.Nc3.Diagnosis.Float64:9281°1
AutoReading a value information. The data type is automatically detected from the diagnosis info on the CNC.Nc3.Diagnosis.Auto:981°1

Tool Management Data

The following addresses can be used to read tool data out of the FANUC tool table.

Nc{n}.ToolData.Float64:{ToolId}°{FieldNr}

This table shows the different fields to be read from to tool table:

AddressNameFANUC FieldName
Nc{n}.ToolData.Float64:{ToolId}°1tool number(T)T_code
Nc{n}.ToolData.Float64:{ToolId}°2tool life counterlife_count
Nc{n}.ToolData.Float64:{ToolId}°3maximum of tool lifemax_life
Nc{n}.ToolData.Float64:{ToolId}°4rest of tool liferest_life
Nc{n}.ToolData.Float64:{ToolId}°5state of tool lifelife_stat
Nc{n}.ToolData.Float64:{ToolId}°6customizing bitcust_bits
Nc{n}.ToolData.Float64:{ToolId}°7tool info.tool_info
Nc{n}.ToolData.Float64:{ToolId}°8tool length compensation number (H)H_code
Nc{n}.ToolData.Float64:{ToolId}°9cutter compensation number (D)D_code
Nc{n}.ToolData.Float64:{ToolId}°10spindle speed (S)spindle_speed
Nc{n}.ToolData.Float64:{ToolId}°11feed rate(F)feedrate
Nc{n}.ToolData.Float64:{ToolId}°12magazine numbermagazine
Nc{n}.ToolData.Float64:{ToolId}°13pot numberpot
Nc{n}.ToolData.Float64:{ToolId}°14tool geometric compensation number(G)G_code
Nc{n}.ToolData.Float64:{ToolId}°15tool wear compensation number(W)W_code
Nc{n}.ToolData.Float64:{ToolId}°16tool geometric numbergno
Nc{n}.ToolData.Float64:{ToolId}°17edge group number(only 0i-F, 30i/31i/32i)grp
Nc{n}.ToolData.Float64:{ToolId}°18edge number(only 0i-F, 30i/31i/32i)edge
Nc{n}.ToolData.Float64:{ToolId}°19origin magazine number(only 0i-F, 30i/31i/32i)org_magazine
Nc{n}.ToolData.Float64:{ToolId}°20origin pot number(only 0i-F, 30i/31i/32i)org_pot

Tool Life Management Memory

The tool life management is a special management memory of tool wear, life and sister tools.

IMPORTANT

The Tool Life Management (TLM) option of FANUC must be also enabled on the FANUC controls. Check the FANUC manuals for description of the TLM.

Addressing Tool Life Memory

The tool life management (TLM) is realized as a double array. Therefore, the address room (32bit address) is split into two sections: the high-word represents the tool group address, the low-word represents the tool address.

The address must by given in HEX format.

Example: the address 0x00100009 is split into 0x0010 and 0x0009 (hex) or 16 and 9 in decimal.

Status Information (Address 0x00000000)

AddressDescriptionData Type
Nc{n}.ToolLife.Int32:0x00000000Reads the current status of the TLMSystem.Int32[]
Nc{n}.ToolLife.Int32:0x00000000°1Reads the number of tool group currently selectedSystem.Int32
Nc{n}.ToolLife.Int32:0x00000000°2Reads the number of tool group currently in useSystem.Int32
Nc{n}.ToolLife.Int32:0x00000000°3Reads the number of tool group to be used nextSystem.Int32
Nc{n}.ToolLife.Int32:0x00000000°4Reads the number of tool optional group currently selectedSystem.Int32
Nc{n}.ToolLife.Int32:0x00000000°5Reads the number of tool optional group currently in useSystem.Int32
Nc{n}.ToolLife.Int32:0x00000000°6Reads the number of tool optional group to be used nextSystem.Int32

Tool Group Information

The high-word of the address specifies the Group Id, written as {group}. The low-word is always zero.

The address 0x000A0000 points to the information of 10th group.

AddressDescriptionData Type
Nc{n}.ToolLife.Int32:0x{group}{0000}Reads the current status of the group {group}System.Int32[]
Nc{n}.ToolLife.Int32:0x{group}{0000}°1Reads the number of used toolsSystem.Int32
Nc{n}.ToolLife.Int32:0x{group}{0000}°2Reads the number of free toolsSystem.Int32
Nc{n}.ToolLife.Int32:0x{group}{0000}°3Reads the selected tool in orderSystem.Int32
Nc{n}.ToolLife.Int32:0x{group}{0000}°4Reads the tool life counter typeSystem.Int32
Nc{n}.ToolLife.Int32:0x{group}{0000}°5Reads or writes the tool life counterSystem.Int32
Nc{n}.ToolLife.Int32:0x{group}{0000}°6Reads the rest of tool life counter*System.Int32
Nc{n}.ToolLife.Int32:0x{group}{0000}°7Reads the rest signal state*System.Int32
Nc{n}.ToolLife.Int32:0x{group}{0000}°8Reads the optional tool group\System.Int32
Nc{n}.ToolLife.Int32:0x{group}{0000}°9Reads the tool life (in total)System.Int32
Note

Note: These items are only available for tool life management B function is set. Parameter 6805.4 (Tool life management B)

Tool Life Information

The high-word of the address specifies the Group Id, written as {group}. The low-word is addresses the tool within that group.

The address 0x00100002 points to the 2nd tool information of 16th group

AddressDescriptionData Type
Nc{n}.ToolLife.Int32:0x{group}{tool}Reads the current status of the tool {tool}System.Int32[]
Nc{n}.ToolLife.Int32:0x{group}{tool}°1Reads the tool identification numberSystem.Int32
Nc{n}.ToolLife.Int32:0x{group}{tool}°1Reads the status of the tool
  • 0 = not registered
  • 1 = Tool is registered
  • 2 = Tool is expired
  • 3 = Tool is skipped
System.Int32
Nc{n}.ToolLife.Int32:0x{group}{tool}°3Reads the tool length compensation number (Zero in T-series)System.Int32
Nc{n}.ToolLife.Int32:0x{group}{tool}°4Reads the cutter radius compensation number (Zero in T-series)System.Int32

Trace Addresses

The following addresses are only accessible with SDK using the TFanucDataTracer class.

Axis Trace

AddressDescriptionData Type
Nc{n}.Axis.Float64:100°{x}Reads position feedback (POSF) of axis {x}System.Double[]
Nc{n}.Axis.Float64:101°{x}Reads position error (ERR) of axis {x}System.Double[]
Nc{n}.Axis.Float64:102°{x}Reads velocity command (VCMD) of axis {x}System.Double[]
Nc{n}.Axis.Float64:103°{x}Reads torque command (TCMD) of axis {x}System.Double[]
Nc{n}.Axis.Float64:104°{x}Reads speed feedback signal (SPEED) of axis {x}System.Double[]
Nc{n}.Axis.Float64:105°{x}Reads estimated disturbance torque (DTRQ) of axis {x}System.Double[]
Nc{n}.Axis.Float64:107°{x}Reads OVC simulation data (OVCLV) of axis {x}System.Double[]
Nc{n}.Axis.Float64:108°{x}Reads effective current (IEFF) of axis {x}System.Double[]
Nc{n}.Axis.Float64:123°{x}Reads reactive current (ID) of axis {x}System.Double[]
Nc{n}.Axis.Float64:124°{x}Reads active current (IQ) of axis {x}System.Double[]
Nc{n}.Axis.Float64:125°{x}Reads motor winding temperature (MTTMP) of axis {x}System.Double[]
Nc{n}.Axis.Float64:126°{x}Reads pulse coder temperature (PCTMP) of axis {x}System.Double[]
Nc{n}.Axis.Float64:131°{x}Reads vibration frequency (FREQ) of axis {x}System.Double[]
Nc{n}.Axis.Float64:132°{x}Reads vibration torque command (FRTCM) of axis {x}System.Double[]

Spindle Trace

AddressDescriptionData Type
Nc{n}.Axis.Float64:101°{x}Reads motor speed (SPEED) of spindle {x}System.Double[]
Nc{n}.Axis.Float64:102°{x}Reads torque command (TCMD) of spindle {x}System.Double[]
Nc{n}.Axis.Float64:103°{x}Reads motor speed command (VCMD) of spindle {x}System.Double[]
Nc{n}.Axis.Float64:106°{x}Reads spindle load torque (DTRQ) of spindle {x}System.Double[]
Nc{n}.Axis.Float64:108°{x}Reads motor winding temperature (MTTMP) of spindle {x}System.Double[]
Nc{n}.Axis.Float64:110°{x}Reads frequency of disturbance torque(FREQ) of spindle {x}System.Double[]
Nc{n}.Axis.Float64:111°{x}Reads gain data(GAIN) of spindle {x}System.Double[]
Nc{n}.Axis.Float64:112°{x}Reads torque command 2(TCMD2) of spindle {x}System.Double[]
Nc{n}.Axis.Float64:117°{x}Reads velocity error (VERR) of spindle {x}System.Double[]
Nc{n}.Axis.Float64:118°{x}Reads spindle speed (SPSPD) of spindle {x}System.Double[]

Often used Variables

Feedrate

The feed rates are exchanged between PMC and NC modules. Therefore the variables are located in the PMC-G memory.

AddressDescriptionData Type
Pmc{n}.Pmc_G.Uint8:12Reads the current federate override 1System.Int32
Pmc{n}.Pmc_G.Uint8:13Reads the current federate override 2 (Option)System.Int32

Note that the value is encoded:

The programmed feed of the nc path is stored in the modal parameters.

AddressDescriptionData Type
Nc{n}.Modal.Float64:2°5Reads the programmed feed (parameter F)System.Double
Nc{n}.Dynamic.Float64:4Reads the current axis feedSystem.Double

Workpiece Counter

AddressDescriptionData Type
Nc{n}.Param.Uint32:6711Number of machined partsSystem.Uint32
Nc{n}.Param.Uint32:6712Total number of machined partsSystem.Uint32

Depending on the application, NC programs may run endlessly. In these cases the workpiece counter is not increased automatically.

Following Macro System-Variables can be used:

VariableDescription
#3901Number of machined parts (machined)
#3902Number of parts required

Modify your NC-Programs in the following way to increase the part counter:

%
O0010 (ENDLESS)
N10

#3901 = #3901 + 1 (INCREASE THE COUNTER)
GOTO10
M30
%

Operation Hours

AddressDescriptionData Type
Nc{n}.Param.Uint32:6750Integrated value of power on period in minutesSystem.UInt32
Nc{n}.Param.Uint32:6751Operation time in milliseconds (integrated value of time during automatic operation)*System.UInt32
Nc{n}.Param.Uint32:6752Operation time in minutes (integrated value of time during automatic operation)*System.UInt32
Nc{n}.Param.Uint32:6753Integrated value of cutting time in milliseconds **System.UInt32
Nc{n}.Param.Uint32:6754Integrated value of cutting time in minutes**System.UInt32
Nc{n}.Param.Uint32:6757Cutting time of current run in milliseconds **System.UInt32
Nc{n}.Param.Uint32:6758Cutting time of current run in minutes**System.UInt32

*Total time of operation in [min] = #6752 + #6752 / 60000

** Total cutting time [min] = #6754 + #6754 / 60000

Customized Cycle Time

If the process is realized in an endless nc program, the system cycle time cannot be used.

Following example shows, how to use the millisecond time of the nc #3001 as a customized cycle time. Note, that you use some kind of read-ahead-stop M50 to prevent FANUC interpreter to pre read lines ahead.

%
O0200(MAT 837121)
N10
M50
#3001=0(RESET TIMER)

M50
#501=#3001/1000(CYCLE TIME SEC)
GOTO10
M30
%