Skip to main content
Version: 2.6

HEIDENHAIN 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 HEIDENHAIN address has following format:

{memory base}.{memory type}.{data type}:{address}

Memory Base

Because there can only be one control coupled with the driver there is only one base address:

Memory ChannelDescription
Nc1Nc memory base.

Memory Type

The CNC control provides different channels for memory:

Memory ChannelDescription
InfoConnection information
AutomaticGeneral Information like uptime, program name...
ProcessDataProcess oriented data like spindle runtimes...
AxisAll axis Data
DynamicVarious data out of the machine memory, specified by specific paths
ToolAllows queries on the tool table, read only

Data Types

Data TypeDescriptionSystem Data 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
UInt64Long information (unsigned 64bit integer)System.UInt64
Int32Signed integer (32bit)System.Int32
Float64Floating point number (64bit)System.Double
StringString informationSystem.String

Address

Typically, the address is numerical or alpha-numerical name. It points to the memory cell inside the memory type.

Special cases allow or require further address information which is added behind the address:

CaseMemory TypeExtensionAction
Single AxisAxis°{AxisLetter}Allowed
Spindle DataProcessData°{SpindleNumber}Required
VariableDynamic{VariablePath}Required
Parse Program LineAutomatic°{PartToSearch}°{CutOffBefore}Allowed, (CutOffBefore is optional)

Axis Letters

The axis letters for HEIDENHAIN are limited:

String DataInt DataDescription
X0Axis name of X Axis
Y1Axis name of Y Axis
Z2Axis name of Z Axis
U3Axis name of U Axis
V4Axis name of V Axis
W5Axis name of W Axis

Information about Control

The info channel can only be read or monitored. Writing is not possible.

AddressDescriptionData Type
Nc1.Info.Int32:0Connection status of the control (0 = Disconnected; 1 = Connected)System.Int32
Nc1.Info.String:1Control TypeSystem.String
Nc1.Info.String:2Control Nc VersionSystem.String
Nc1.Info.String:3Control Dnc VersionSystem.String
Nc1.Info.Int32:4Sign of life toggle bit (in 1 Hz if connected)System.Int32
Nc1.Info.Bool:5Bit if Control is NCK based (false = NC, true = NCK)System.Bool

Automatic Variables

The configuration can only be read or monitored. For writing, use the appropriate commands.

AddressDescriptionData Type
Nc1.Automatic.Int32:0Operation Mode
MANUAL = 0
MDI = 1
RPF = 2
SINGLESTEP = 3
AUTOMATIC = 4
OTHER = 5
HANDWHEEL = 7
System.Int32
Nc1.Automatic.Int32:1Program Status
IDLE = 0
RUNNING = 1
STOPPED = 2
INTERRUPTED = 3
FINISHED = 4
ERROR = 5
NOT_SELECTED = 6
System.Int32
Nc1.Automatic.String:2Current (sub) Program NameSystem.String
Nc1.Automatic.String:3Main Program NameSystem.String
Nc1.Automatic.String:5°{ParseFrom}°{CutOffBefore}Parse from current (sub) program line, first 15 program lines are processedSystem.String
Nc1.Automatic.String:6First 15 lines of current (sub) program file, customer-specific data can be parsed hereSystem.String
Nc1.Automatic.String:7First 15 lines of main program file, customer-specific data can be parsed hereSystem.String
Nc1.Automatic.Int32:10Feedrate OverrideSystem.Int32
Nc1.Automatic.Int32:11Spindle Feedrate Override (Speed)System.Int32
Nc1.Automatic.Int32:12RapidFeedSystem.Int32
Nc1.Automatic.Int32:100Current Tool IdSystem.Int32
Nc1.Automatic.Int32:101Current Spare Tool IdSystem.Int32
Nc1.Automatic.Int32:102Current Tool IndexSystem.Int32
Nc1.Automatic.Int32:110Last Tool IdSystem.Int32
Nc1.Automatic.Int32:111Last Tool Spare IdSystem.Int32
Nc1.Automatic.Int32:112Last Tool IndexSystem.Int32
Nc1.Automatic.Int32:200Emergency State
None = 0
Pending Emergency Message = 1
The EmergencyState flag can be customized. See Alarm Access Configuration of the Driver.
System.Int32
Nc1.Automatic.Int32:201Alarm state
None = 0
Pending Error Message = 1
The AlarmState flag can be customized. See Alarm Access Configuration of the Driver.
System.Int32

Example

{
"Id": "0f0bc479-cd0c-45ef-9001-d36ac165c4e0",
"Name": "OperationMode",
"DataType": "System.Int32",
"Address": "Nc1.Automatic.Int32:0",
"Access": {
"Read": true,
"Receive": true
},
"Properties": [
{
"Name": "FieldName",
"Value": "OperationMode"
},
{
"Name": "PortMatchId",
"Value": "OperationModeType"
}
]
}

Process Data

Reads the timers of the NC control in minutes. The values can only be read or monitored.

AddressDescriptionData Type
Nc1.ProcessData.Float64:0°{x}x-th PLC spindle running timer (min)System.Double
Nc1.ProcessData.Float64:1Controller up time (min)System.Double
Nc1.ProcessData.Float64:2Machine up time (min)System.Double
Nc1.ProcessData.Float64:3Machine running time (Program running time) (min)System.Double
NOTE

The Nc1.ProcessData.Float64:0°{x} reads the x-th timer of the PLC.

  • Typically, on iTNC530 the PLC operation timer x=0 is used for spindle run-time counter.
  • Typically, on TNC640 the PLC operation timer x=2 is used for the main spindle run-time counter, and timer x=3 is used for the secondary.

Axis Data

Reading the axis position and spindle speeds.

AddressDescriptionData Type
Nc1.Axis.Float64:0Machine positionsSystem.Double[]

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

AddressDescriptionData Type
Nc1.Axis.Float64:0°{x}Machine position of x-th axisSystem.Double
Nc1.Axis.Float64:1°{x}Spindle state of x-th axis
CW = 0
CCW = 1
STOPPED = 2
POS_CTRL = 3
TAPPING = 4
RIGID_TAPPING = 5
System.Int32

Dynamic Data

The values can only be read or monitored. For writing, use the appropriate command.

AddressDescriptionData Type
Nc1.Dynamic.{value data type}:0PLC tree of machineVariable: Determine expected format
Nc1.Dynamic.{value data type}:1MP tree of machineVariable: Determine expected format
Nc1.Dynamic.{value data type}:2TABLE tree of machineVariable: Determine expected format

Not all variables are accessible some must be unlocked (not supported yet) and some cannot be written or read at all (refer to the machine manual).

PLC Address

With following address, you can read a PLC variable:

Nc1.Dynamic.{DataType}:0\\{PLC Address}
PLC/NC/CNC Address = {Location+Function+Offset/Address/}
Note

Some data trees have even more data in sub paths, extend accordingly.

All data types can be used.

A PLC Address has following path and data options:

LocationFunctionOffset RangeDescription
memoryM0-9999PLC Memory Var (HW storage)
B0-14999PLC Memory Byte
W0-14998PLC Memory Word
D0-14996PLC Memory Double
I0-999PLC Input
O0-999PLC Output
T0-999Special Memory Vars (usually not used)
C0-143Special Memory Vars (usually not used)
S0-99Special Memory Vars (usually not used)
IB0-999PLC Input Byte
IW0-998PLC Input Word
ID0-996PLC Input Double
OB0-999PLC Output Byte
OW0-998PLC Input Word
OD0-996PLC Input Double
programmain......
symbol......

Example

Nc1.Dynamic.Bool:0\\memory\M\7000

NC Address

A NC Address has following path and data options:

LocationFunctionOffset RangeDescription
TOOLT0-100Tool storage
TOOL_Pmain......
............

Ranges and read/write access depend on the used controller and the version, as well as customization through the machine supplier.

Refer to the manual or machine supplier for accurate data addresses or data ranges and trees.

Tool Data

The values can only be read or monitored. For writing, use the appropriate tool commands.

AddressDescriptionData Type
Nc1.Tool.String:0°{Query}Tool Table DataSystem.String
Note

This memory address is only available for iTNC530 controllers.

The query is written in SQL syntax.

Each value is which is returned is added to a string in csv format:

value name column 1; ...; value name column N;
T0 value column 1; ...; T0 value column N;
T1 value column 1; ...; T1 value column N;

Example for address Nc1.Tool.String:0°WHERE T<1:

T;NAME;L;R;R2;DL;DR;DR2;TL;RT;TIME1;TIME2;CUR.TIME;DOC;CUT.;LTOL;RTOL;DIRECT.;PLC;TT:L-OFFS;TT:R-OFFS;LBREAK;RBREAK;LCUTS;ANGLE;TYP;TMAT;CDT;PLC-VAL;CAL-OF1;CAL-OF2;CAL-ANG;PTYP;NMAX;LIFTOFF;P1;P2;P3;KINEMATIC;T-ANGLE;PITCH;AFC;R2TOL;LAST_USE;ACC;OVRTIME;CL;CR;P4;
0;NULLWERKZEUG;+0;+0;+0;+0;+0;+0;;;0;0;0;;0;0;0;-;%00000000;+0;R;0;0;0;60;;;;+0;+0;+0;0;0;-;N;+0;+0;+0;;+0;+0;;0;2019.07.29 17:55;0;0;+0;+0;+0;

Following operators are accepted:

OperatorsDescription
+, -, *, /Arithmetic operators
NOT, AND, ORLogical operators
<, >, <=, >=, ==, <>Comparisons
LIKE 'abc'Text comparisons
LIKE '_abc'Text-string partial comparisons
(, )Parentheses
MIN(<column title>)Minimum value of the entries in a column
MAX(<column title>)Maximum value of the entries in a column

Address Examples

AddressDescription
Nc1.Dynamic.Bool:0\\memory\M\7000cooling is on = true
Nc1.Automatic.Int32:1status of the current program
Nc1.Automatic.String:5°testWill parse the actual running program for the word "test" and will return all content in the same program line as "test"
Nc1.Automatic.String:5°test°nowSame as upper example with the difference that all text in the program line before now is cut off
Nc1.Tool.String:0°WHERE T>=0Returns all tools which have a id equal or greater than zero