For the complete documentation index, see llms.txt. This page is also available as Markdown.

Connect Heidenhain CNC with OPC UA support

In this tutorial you will learn how to integrate a Heidenhain controlled CNC machine and use it in your App.

This tutorial explains how to connect a Heidenhain controlled CNC machine to your App using OPC UA.

This guide uses a modern TNC7-based machine as an example, but the steps apply to any Heidenhain controller that supports OPC UA connectivity.

Connectivity guide

1

Allow SSH access via password

Temporarily enable password-based SSH access on your CNC machine.

  1. Open the settings (Einstellungen) menu on the controller.

  1. Under the operating system (Betriebssystem) section, select Current User and click Open (Öffnen).

  1. In the dialog box, select Certificates and keys (Zertifikate und Schlüssel).

  1. Check the box to allow password authentication (Erlaube Authentifizierung mit Passwort).

  1. Click Save and restart server (Speichern & Server neu starten) to restart the internal SSH server.

2

Download and start a Native Agent

Open the App Builder on a computer that has network access to your CNC machine.

  1. Click the create Agent icon in the Function Explorer panel (see Agents).

  1. Check the checkboxes for both the OPC UA Client and the Heidenhain OPC UA connectors.

  2. Enter a prefix that identifies your workspace and click Submit.

The system compiles a custom Native Agent executable to embed the specific security credentials of your workspace. This process takes up to 2 minutes.

Wait for the download dialog to open automatically in your browser.

Re-downloading Agents

You can access and download your compiled Native Agent executables at any time from the native-agents directory inside the File Explorer.

  1. Create a new directory on your local computer (such as C:\Heisenware) and move the downloaded Native Agent binary into it.

  1. Run the Native Agent executable. If prompted by Windows SmartScreen, click More info (Weitere Informationen) and select Run anyway (Trotzdem ausführen).

  1. Once the terminal window opens and displays a broker connection status of [OK], verify that your new Agent appears online in the Function Explorer panel of the App Builder.

Troubleshooting Agent connectivity

If the Agent fails to connect and repeatedly loops through reconnection attempts, verify that your network firewall permits outbound traffic on port 8883 to establish the secure MQTTS connection.

3

Set up certificates for the OPC UA connection

To establish a secure connection to the Heidenhain OPC UA server, you must exchange certificates between the CNC machine and your host computer.

Our Native Agent automates this file exchange. You only need to perform these configuration steps once per machine.

  1. Drag the create function from the Heidenhain OPC UA connector onto the Backend Builder canvas.

  2. Define an instance name (such as tnc7) and enter your machine's IP address in the machineIpAddress input field. Trigger the function manually.

  1. Drag both the prepareOpcUaAssistant and finalizeOpcUaAssistant functions onto the canvas.

  2. Trigger the prepareOpcUaAssistant function. Once it returns successfully, return to your CNC machine.

4

Run the OPC UA Assistant on the machine

Open the OPC UA Assistant interface on your CNC machine.

  1. On a TNC7 controller, navigate to Settings (Einstellungen) > Network/Remote Access (Netzwerk/Fernzugriff) > OPC UA > OPC UA Connection Assistant (OPC UA Verbindungsassistent). On a TNC640 controller, open this menu via the Heros interface.

  1. Follow the assistant's prompts step by step.

  1. When the assistant prompts you to export server certificates, select the TNC: drive, open the heisenware directory, and navigate into the export folder.

  1. Click Export all certificates (Alle Zertifikate exportieren) to save the machine certificates into this folder, then click Next (Vorwärts).

  1. When the assistant prompts you to import the client certificate, navigate to the heisenware folder and open the import directory.

  1. Select the heisenware_opcua_client.der certificate and complete the import.

  1. Check the checkbox to enable the OPC UA connection, click Apply (Anwenden), and click Next.

  1. When prompted to import the user certificate, open the heisenware/import directory and select the heisenware_opcua_user.der certificate file.

  1. Allow the system firewall to accept OPC UA traffic. Double-click the OPC UA method (Methode) option and set it to Allow all (Allen erlauben).

  2. Click Reload firewall configuration (Firewall-Konfiguration neu laden) to apply the network rules.

  1. Complete the assistant to finalize the on-machine certificate setup.

5

Connect to the OPC UA server

Return to the App Builder in your browser to finalize the integration.

  1. Trigger the finalizeOpcUaAssistant function on your canvas. It should return a success message.

  1. Drag the connect function from the Heidenhain OPC UA instance onto the canvas and trigger it. A return value of true confirms a successful connection.

You can now use the standard Heidenhain OPC UA functions to read, write, and monitor live parameters from your CNC machine.

Last updated

Was this helpful?