Skip to main content

Heidenhain TNC 640, TNC 730 and TNC7 (OPC-UA)

This is the recommended way to connect any Heidenhain control newer than a TNC 530. Add the machine in MachineMetrics as OPC-UA, not as the Heidenhain proprietary connector.

Applies to: TNC 640, TNC 730, TNC7 · Option required: 56 (OPC UA NC Server) · Port: 4840 · Connect to: the control's Ethernet port

For TNC 640, TNC 730, TNC7, and related controls with Option 56 (OPC-UA NC Server), add the machine in MachineMetrics as OPC-UA (not the Heidenhain proprietary connector). Use the Heidenhain OPC UA Information Model documentation for the authoritative node layout and minimum NC software for each Core Information Model version — see HEIDENHAIN OPC UA NC Server (downloads and revision history).

Network Configuration​

The control has to be reachable from the Edge device before you configure anything in MachineMetrics.

Physical Connection​

  1. Locate the Ethernet port on the control
    • TNC 640 / TNC 730 / TNC7: on the control panel or in the machine electrical cabinet
  2. Connect a network cable from the control to your network switch or router
  3. Verify the link lights on the Ethernet port are active

Accessing Network Settings on the TNC 640 / TNC 730 / TNC7​

  1. Press the Heidenhain button (logo button) to bring up the Linux menu
  2. Navigate to Network Settings or Ethernet Settings

The exact menu wording varies by NC software version, and some builders restrict the menu to service-level access. If you cannot reach it, contact the machine builder rather than guessing at a code.

Configuring the Address​

For Static IP Address (Recommended):

  1. In Network Settings, select Manual or Static IP
  2. Enter the following network information:
    • IP Address: (e.g., 192.168.1.100)
    • Subnet Mask: (e.g., 255.255.255.0)
    • Gateway: (e.g., 192.168.1.1)
    • DNS Server: (optional, e.g., 192.168.1.1 or 8.8.8.8)
  3. Save settings and reboot control if prompted

For DHCP (Dynamic IP):

  1. In Network Settings, select DHCP or Automatic
  2. Control will automatically obtain IP address from network
  3. Note the assigned IP address for later use
  4. Recommended: Reserve this IP in your DHCP server to prevent changes

Important Network Configuration Notes:

  • Use static IP or reserved DHCP to ensure consistent connectivity
  • Ensure IP address is on same subnet as Edge device
  • Document the IP address for MachineMetrics configuration
  • Verify no IP conflicts exist on the network

Testing the Connection​

Step 1: Verify IP Configuration

On the Heidenhain control:

  1. Navigate to Network Settings
  2. Verify IP address is displayed and valid
  3. Check connection status shows "Connected" or "Active"

Step 2: Test from Control (if available)

Some Heidenhain controls have built-in network diagnostics:

  1. Access Network Settings → Diagnostics (if available)
  2. Try pinging the Edge device IP address
  3. Verify successful response

Step 3: Test from Edge Device

Ping the control via Diagnostics → Manual Ping in Edge Management, or from another computer on the network:

ping [MACHINE-IP-ADDRESS]

Example:

ping 192.168.1.100

Expected Result: Continuous successful ping responses with low latency (< 10ms typical)

Software version and information model​

Heidenhain ties each Core Information Model revision to minimum NC software builds by product line. The table below is a short excerpt of what Heidenhain publishes (check the current PDF on their site before you deploy).

Core information modelProduct examplesMinimum NC software (per Heidenhain)
1.00TNC 64034059x-10
1.01TNC 640; TNC 62034059x-11; 81760x-08
1.07 (current model doc, 2026)TNC7; TNC7 basic; TNC7 goe.g. 817620-20, 817621-20, 817625-20; 81762x-20 (TNC7 go)

Important context from Heidenhain’s documentation:

  • NC software 19 and later are only for TNC7 products.
  • Further development of TNC 640 and TNC 620 is discontinued — newer information-model features are driven by TNC7; confirm support for your exact control with Heidenhain if you are not on TNC7.

If your NC software is older than the row required for the nodes you need, upgrade the control (or use the proprietary Heidenhain connector path in this guide where supported).

Namespace, browse paths, and channel​

Before production use:

  • Namespace index — Example scripts often use ns=3, which is typical for TNC 640 / TNC 730 / TNC7, but it is not guaranteed for every firmware build. In UaExpert, browse Objects → Machine → … and confirm the NodeId prefix (ns=) on a known node.
  • Browse paths vs. fixed NodeIds — Heidenhain recommends BrowsePaths aligned with BrowseName hierarchy from the Core Information Model where possible; string paths are more stable across machines of the same control generation than opaque numeric identifiers.
  • Channel — The sample script targets channel 0 only (Machine/Channels/0/...). Multi-channel machines need duplicated or merged tag sets per channel.

Default OPC-UA security on the control may require Sign with Basic256Sha256 (as in the sample below); align with what the server advertises and with OPC-UA Connectivity Guide settings in MachineMetrics.

Sample OPC-UA adapter script​

Example Transform Adapter Script for a single-channel Heidenhain NC with Core Information Model v1.07-style paths. Verify namespace, security, and paths against your control with UaExpert before deploying.

# Heidenhain OPC UA NC Server — Option 56 (Core Information Model v1.07)
# Single-channel machine (channel 0)
#
# NAMESPACE NOTE: All paths use ns=3. This is typical for TNC 640/TNC 730/TNC7
# controls but is NOT guaranteed. Verify the correct namespace index for your
# specific control generation using UaExpert before deploying.
# Browse to: Objects > Machine > ... and inspect the NodeId ns= value on any node.
#
# BROWSE PATH NOTE: Heidenhain recommends using BrowsePaths (not hardcoded NodeIds).
# The string paths below follow the BrowseName hierarchy from the Core Information
# Model and should be stable across machines of the same control generation.

version: 2
security-mode: Sign
security-policy: Basic256Sha256

# ─── TAGS ────────────────────────────────────────────────────────────────────

tags:
# Program execution state — NCProgramStateMachineType CurrentState
# Values: NotSelected, Idle, Running, Stopped, Interrupted, Finished, Error
exec-state:
path: ns=3;s=Machine/Channels/0/Program/ExecutionState/CurrentState

# Active program name
prog-name:
path: ns=3;s=Machine/Channels/0/Program/Name

# Universal workpiece counter (FUNCTION COUNT in NC program)
part-counter:
path: ns=3;s=Machine/Channels/0/Counter/CurrentValue

# Operating mode — NCOperatingMode enum
# Values (numeric): Manual=0, Handwheel=1, MDI=2, SingleStep=3, Automatic=4, Other=5
operating-mode:
path: ns=3;s=Machine/Channels/0/OperatingMode

# Feed override (%)
feed-override:
path: ns=3;s=Machine/Channels/0/FeedOverride

# Speed (spindle) override (%)
speed-override:
path: ns=3;s=Machine/Channels/0/SpeedOverride

# Actual feed rate (mm/min)
actual-feed:
path: ns=3;s=Machine/Channels/0/ActualFeed

# Spindle in motion (boolean)
spindle-in-motion:
path: ns=3;s=Machine/Channels/0/Spindle/InMotion

# Spindle nominal speed (RPM)
spindle-speed:
path: ns=3;s=Machine/Channels/0/Spindle/NominalSpeed

# Current tool name
tool-name:
path: ns=3;s=Machine/Channels/0/CurrentTool/Name

# NC state machine — overall control connection/availability state
# Values: NCIsNotConnected, NCIsConnected, NCIsBooted, NCIsAvailable,
# NCIsInitializing, NCIsShuttingDown
nc-state:
path: ns=3;s=Machine/State/CurrentState

# ─── VARIABLES ───────────────────────────────────────────────────────────────

variables:
# Execution state derived from NCProgramStateMachine CurrentState string value
execution:
- source: exec-state
- state:
- ACTIVE: this == "Running"
- INTERRUPTED: this == "Interrupted" or this == "Stopped" or this == "Error"
- READY: this == "Idle" or this == "Finished" or this == "NotSelected"

# Controller mode derived from NCOperatingMode enum
controller-mode:
- source: operating-mode
- state:
- AUTOMATIC: this == 4
- MANUAL_DATA_INPUT: this == 2
- MANUAL: this == 0 or this == 1
- SEMI_AUTOMATIC: this == 3

# Part count — pass through cumulative counter value
part-count:
- source: part-counter

# Feed override — pass through
feedrate-ovr:
- source: feed-override

# Speed override — pass through
speed-ovr:
- source: speed-override

# Actual feed rate — pass through
feed-rate:
- source: actual-feed

# Spindle speed — pass through
spindle-rpm:
- source: spindle-speed

# Program name — pass through
program-name:
- source: prog-name

# Tool name — pass through
tool-id:
- source: tool-name

# NC state — pass through for diagnostics
nc-connection-state:
- source: nc-state

# Spindle in motion — pass through
spindle-running:
- source: spindle-in-motion

# ─── DATA ITEMS ──────────────────────────────────────────────────────────────

data-items:
- execution
- controller-mode
- part-count
- program-name
- tool-id
- feed-rate
- feedrate-ovr
- speed-ovr
- spindle-rpm
- spindle-running
- nc-connection-state

In MachineMetrics, complete OPC-UA machine setup (endpoint URL, credentials, adapter script) using the OPC-UA Connectivity Guide.


Part Count​

Over OPC-UA the part count comes straight off the control's universal workpiece counter — there is no PLC WORD address to find. The node is already in the adapter script above:

  # Universal workpiece counter (FUNCTION COUNT in NC program)
part-counter:
path: ns=3;s=Machine/Channels/0/Counter/CurrentValue
The NC program has to drive the counter

That node only increments if the part program calls FUNCTION COUNT. If the counter stays at zero while parts are being made, the program is not incrementing it — this is a program change, not a MachineMetrics setting.

Once values are arriving, map them:

Step 2: Configure Data Mapping

  1. Go to Machine Settings → Data Mapping tab
  2. Locate the part_count data item
  3. Map it to:
    • Type: EVENT
    • Subtype: PART_COUNT
    • Component: Machine or Controller
  4. Click Save

Step 3: Configure Data Rules

  1. Go to Machine Settings → Data Rules tab
  2. Locate Part Counting section
  3. Set Part Count Source to part_count
  4. Configure reset behavior:
    • Reset on Program Start: Optional (depends on your process)
    • Reset on Shift: Optional
  5. Click Save

Verifying Part Count​

Step 1: Run a Test Part

  1. Load a program on the machine
  2. Run the program to completion
  3. Verify part counter increments on the control display

Step 2: Check MachineMetrics Data

  1. Go to machine page in MachineMetrics
  2. Navigate to Parts tab
  3. Verify part count matches control display
  4. Check that timestamp is accurate

Step 3: Check Diagnostics

  1. Go to Diagnostics tab
  2. Locate part_count data item
  3. Verify value updates when part completes
  4. Check for consistent updates (no missed counts)

Step 4: Monitor Over Time

  1. Run multiple parts
  2. Verify count increments correctly
  3. Check for reset behavior (if configured)
  4. Confirm data is flowing to MachineMetrics Cloud

Troubleshooting Part Count Issues:

If parts are not counting correctly:

  1. Verify PLC WORD address is correct (double-check on control)
  2. Check M-code execution (review program for M53/M54)
  3. Verify Data Mapping settings in MachineMetrics
  4. Check adapter logs for errors or warnings
  5. Confirm part counter is enabled on the control
  6. Test manual increment on control (if possible)

If the Control Runs Option 18 Instead​

A TNC 640 or TNC 730 connected over the proprietary connector rather than OPC-UA has no counter node, and falls back to the PLC WORD table. The address is usually WORD 10, or WORD 19944 on some builders:

{
"partcounting": {
"plcPartCountMemAddressTNC640": "10"
}
}

The procedure for finding and confirming the address is on the TNC 530 page. This is another reason to specify Option 56.

  • OPC-UA Connectivity — certificates, security modes and browsing a server with UaExpert
  • Heidenhain Overview — identifying your control and its installed options
  • TNC 530 — the proprietary connector, for TNC 530 controls or a 640/730 stuck on Option 18
  • Troubleshooting — connection, data collection and part count faults