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 Channel | Description |
---|---|
Nc1 | Nc memory base. |
Memory Type
The CNC control provides different channels for memory:
Memory Channel | Description |
---|---|
Info | Connection information |
Automatic | General Information like uptime, program name... |
ProcessData | Process oriented data like spindle runtimes... |
Axis | All axis Data |
Dynamic | Various data out of the machine memory, specified by specific paths |
Tool | Allows queries on the tool table, read only |
Data Types
Data Type | Description | System Data Type |
---|---|---|
Bool | Bit information. 0 = not set; 1 = set | System.Boolean |
Uint8 | Byte information (unsigned 8bit integer) | System.Byte |
Uint16 | Word information (unsigned 16bit integer) | System.UInt16 |
Uint32 | DWord information (unsigned 32bit integer) | System.UInt32 |
UInt64 | Long information (unsigned 64bit integer) | System.UInt64 |
Int32 | Signed integer (32bit) | System.Int32 |
Float64 | Floating point number (64bit) | System.Double |
String | String information | System.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:
Case | Memory Type | Extension | Action |
---|---|---|---|
Single Axis | Axis | °{AxisLetter} | Allowed |
Spindle Data | ProcessData | °{SpindleNumber} | Required |
Variable | Dynamic | {VariablePath} | Required |
Parse Program Line | Automatic | °{PartToSearch}°{CutOffBefore} | Allowed, (CutOffBefore is optional) |
Axis Letters
The axis letters for HEIDENHAIN are limited:
String Data | Int Data | Description |
---|---|---|
X | 0 | Axis name of X Axis |
Y | 1 | Axis name of Y Axis |
Z | 2 | Axis name of Z Axis |
U | 3 | Axis name of U Axis |
V | 4 | Axis name of V Axis |
W | 5 | Axis name of W Axis |
Information about Control
The info channel can only be read or monitored. Writing is not possible.
Address | Description | Data Type |
---|---|---|
Nc1.Info.Int32:0 | Connection status of the control (0 = Disconnected; 1 = Connected) | System.Int32 |
Nc1.Info.String:1 | Control Type | System.String |
Nc1.Info.String:2 | Control Nc Version | System.String |
Nc1.Info.String:3 | Control Dnc Version | System.String |
Nc1.Info.Int32:4 | Sign of life toggle bit (in 1 Hz if connected) | System.Int32 |
Nc1.Info.Bool:5 | Bit 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.
Address | Description | Data Type |
---|---|---|
Nc1.Automatic.Int32:0 | Operation Mode MANUAL = 0 MDI = 1 RPF = 2 SINGLESTEP = 3 AUTOMATIC = 4 OTHER = 5 HANDWHEEL = 7 | System.Int32 |
Nc1.Automatic.Int32:1 | Program Status IDLE = 0 RUNNING = 1 STOPPED = 2 INTERRUPTED = 3 FINISHED = 4 ERROR = 5 NOT_SELECTED = 6 | System.Int32 |
Nc1.Automatic.String:2 | Current (sub) Program Name | System.String |
Nc1.Automatic.String:3 | Main Program Name | System.String |
Nc1.Automatic.String:5°{ParseFrom}°{CutOffBefore} | Parse from current (sub) program line, first 15 program lines are processed | System.String |
Nc1.Automatic.String:6 | First 15 lines of current (sub) program file, customer-specific data can be parsed here | System.String |
Nc1.Automatic.String:7 | First 15 lines of main program file, customer-specific data can be parsed here | System.String |
Nc1.Automatic.Int32:10 | Feedrate Override | System.Int32 |
Nc1.Automatic.Int32:11 | Spindle Feedrate Override (Speed) | System.Int32 |
Nc1.Automatic.Int32:12 | RapidFeed | System.Int32 |
Nc1.Automatic.Int32:100 | Current Tool Id | System.Int32 |
Nc1.Automatic.Int32:101 | Current Spare Tool Id | System.Int32 |
Nc1.Automatic.Int32:102 | Current Tool Index | System.Int32 |
Nc1.Automatic.Int32:110 | Last Tool Id | System.Int32 |
Nc1.Automatic.Int32:111 | Last Tool Spare Id | System.Int32 |
Nc1.Automatic.Int32:112 | Last Tool Index | System.Int32 |
Nc1.Automatic.Int32:200 | Emergency 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:201 | Alarm 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.
Address | Description | Data Type |
---|---|---|
Nc1.ProcessData.Float64:0°{x} | x-th PLC spindle running timer (min) | System.Double |
Nc1.ProcessData.Float64:1 | Controller up time (min) | System.Double |
Nc1.ProcessData.Float64:2 | Machine up time (min) | System.Double |
Nc1.ProcessData.Float64:3 | Machine running time (Program running time) (min) | System.Double |
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 timerx=3
is used for the secondary.
Axis Data
Reading the axis position and spindle speeds.
Address | Description | Data Type |
---|---|---|
Nc1.Axis.Float64:0 | Machine positions | System.Double[] |
Each of these memories can be also read by axis number:
Address | Description | Data Type |
---|---|---|
Nc1.Axis.Float64:0°{x} | Machine position of x-th axis | System.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.
Address | Description | Data Type |
---|---|---|
Nc1.Dynamic.{value data type}:0 | PLC tree of machine | Variable: Determine expected format |
Nc1.Dynamic.{value data type}:1 | MP tree of machine | Variable: Determine expected format |
Nc1.Dynamic.{value data type}:2 | TABLE tree of machine | Variable: 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/}
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:
Location | Function | Offset Range | Description |
---|---|---|---|
memory | M | 0-9999 | PLC Memory Var (HW storage) |
B | 0-14999 | PLC Memory Byte | |
W | 0-14998 | PLC Memory Word | |
D | 0-14996 | PLC Memory Double | |
I | 0-999 | PLC Input | |
O | 0-999 | PLC Output | |
T | 0-999 | Special Memory Vars (usually not used) | |
C | 0-143 | Special Memory Vars (usually not used) | |
S | 0-99 | Special Memory Vars (usually not used) | |
IB | 0-999 | PLC Input Byte | |
IW | 0-998 | PLC Input Word | |
ID | 0-996 | PLC Input Double | |
OB | 0-999 | PLC Output Byte | |
OW | 0-998 | PLC Input Word | |
OD | 0-996 | PLC Input Double | |
program | main | ... | ... |
symbol | ... | ... |
Example
Nc1.Dynamic.Bool:0\\memory\M\7000
NC Address
A NC Address has following path and data options:
Location | Function | Offset Range | Description |
---|---|---|---|
TOOL | T | 0-100 | Tool storage |
TOOL_P | main | ... | ... |
.... | ... | ... | .. |
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.
Address | Description | Data Type |
---|---|---|
Nc1.Tool.String:0°{Query} | Tool Table Data in CSV format | System.String |
Nc1.Tool.String:1°{Query} | Tool Table Data in JSON format | System.String |
Following queries are available:
Query | Description |
---|---|
Current | Monitors the data of the currently loaded tool. The update occurs periodically. |
Last | Monitors the data of the last loaded tool. The update occurs periodically. |
LastOnChange | Monitors the data of the last loaded tool. The update occurs only once immediately after changing the tool. |
{SQL Query} | The query is written in SQL syntax. |
The SQL query memory address is only available for iTNC530 controllers.
The SQL query returns a simplified tool structure without data types for JSON format.
Following SQL operators are accepted:
Operators | Description |
---|---|
+, -, *, / | Arithmetic operators |
NOT, AND, OR | Logical 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 |
Each returned value is added to a string either in CSV or JSON format.
CSV (Address 0)
value name column 1; ...; value name column N;
T0 value column 1; ...; T0 value column N;
T1 value column 1; ...; T1 value column N;
CSV 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;
JSON Example (Address 1) for address Nc1.Tool.String:1°WHERE T<2
[
[
{
"Name": "T",
"DataType": "System.Int32",
"Value": 0
},
{
"Name": "NAME",
"DataType": "System.String",
"Value": "NULLWERKZEUG"
},
{
"Name": "L",
"DataType": "System.Double",
"Value": 0.0
}
],
[
{
"Name": "T",
"DataType": "System.Int32",
"Value": 1
},
{
"Name": "NAME",
"DataType": "System.String",
"Value": "TOOL1"
},
{
"Name": "L",
"DataType": "System.Double",
"Value": 5.25
}
]
]
Address Examples
Address | Description |
---|---|
Nc1.Dynamic.Bool:0\\memory\M\7000 | cooling is on = true |
Nc1.Automatic.Int32:1 | status of the current program |
Nc1.Automatic.String:5°test | Will 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°now | Same as upper example with the difference that all text in the program line before now is cut off |
Nc1.Tool.String:0°WHERE T>=0 | Returns all tools which have a id equal or greater than zero |