Skip to main content
Version: 2.8

Heidenhain to OPC-UA Bridge

This tutorial uses the Heidenhain Simulator and an OPC-UA server.

Preconditions

  1. HumanOS IoT Designer installed on development client (Check Installation Manual)

  2. HeidenhainDNC installed on the development client.
    The HeidenhainDNC manages the connections to different Heidenhain Controllers.
    Download the HeidenhainDNC here.

  3. Heidenhain Simulator for iTNC530 installed on the development client.
    Download the Heidenhain Simulator for iTNC530 here

  4. OPC-UA Client installed on the development client

RECOMMENDATION

Examples work with UAExpert from Unified Automation. Download UAExpert here

Step 1: Setup connection to Heidenhain Controller (Simulator)

  1. Start the Heidenhain Simulator (Icon on the Windows Desktop)

  2. Wait until the Simulator is up. Confirm the with [CE]-button

    Simulator Step1

  3. Deactivate the collision check.

    • Manual Mode
    • Twice [Arrow Right]
    • Click on [Collision]
    • Set "Program Run" to Inactive

    Simulator Step1

  4. Open the "Create HeidenhainDNC Connection" from Windows Start Menu.

  5. Add a new connection. Click [Add]-button

    Create Connection Step1

  6. Set the name to ItncSim

    Create Connection Step2

  7. Choose the correct NC, e.g. iTNC530

    Create Connection Step3

  8. Setup the connection parameter. For Heidenhain simulator, use localhost and port 19000.

    Create Connection Step4

  9. The connection shows the state "Online". You are ready to connect to the Heidenhain Controller from the development client.

    Create Connection Step5

Step 2: Create a Designer Project for Heidenhain

  1. Create an IoT project with HumanOS IoT Designer. Check Tutorial 1 Example for details about OPC-UA Bridges.

  2. Add a new device template for Heidenhain Controllers.
    In this example we use the empty device template.

    Create Template

  3. Add a group node to the device template with name Controller.

    Add GroupNode

INFO

Group nodes help you to structure your device model. For instance, use groups could represent NC paths (channels).

  1. Add new data node for RunningState to the Controller-group.

    Add DataNode

    Add other data nodes to the Controller:

    • OperationMode
    • MachinePositions
    • CurrentProgram

    Your device template looks like this:

    Tree Step3

  2. The details of the data node are shown on the right side of the designer.

    Details Step3

NOTE

The address field specifies the controller address. It depends on the controller type you selected at the beginning.
Check the manual for Heidenhain controller addresses.

NOTE

The Data Type defines the data type of the data node inside HumanOS NodeSpace.

  • Use System.Double for real numbers
  • Use System.Int32 for integer numbers
  • Use System.String for text and character strings

Step 3: Create Heidenhain Device

  1. Create a Heidenhain Device within the default-Target.

    Create Device

  2. Deploy and run HumanOS IoT Gateway

  3. Connect with OPC-UA client to the OPC-UA server. Use the connection address opc.tcp://localhost:4840.

    OpcUa Client

NOTE

The groups are also mapped to OPC-UA groups.

Extension Step 1: History Mode

  1. Add the history mode to OperationMode.

    • Sampling Rate: defines the sampling rate for long term history

    • Retention Time: How long are the data stored

    Hints

    • Reassign the changed device template to your Heidenhain device.

    Change History Mode

IMPORTANT

History mode could lead to full disks. Therefore, activate the history mode only on selected data nodes and limit the retention time.

  1. Deploy and run HumanOS IoT Gateway

  2. Go to UAExpert and add the history trend view. [Document] - [Add].

    Add History View

  3. Drag and Drop the OperationMode to the "Configuration".

  4. Select "Cyclic Update" and click [Start]

    History View

Extension Step 2: Commands

Commands are used to execute actions on the Heidenhain controller such as reading or writing NC programs.

  1. Add the ReadFile command node to the Controller-group of your device template

    Command Node

    A command defines input and output arguments. In our case, the input argument Name specifies the NC program name and path. The output argument Content contains the file content after reading.

    Command Node

    Hints

    • Reassign the changed device template to your Heidenhain device.
  2. Deploy and run HumanOS IoT Gateway

  3. Go to UAExpert and right click on the command ReadFile. Select [Call] to call the command.

NOTE

If the OPC-UA command node is not yet visible, you might have to [Rebrowse] the objects first.

Input TNC:\DEMO\CYCLES\cycle28.h as "Name".

Command Node

The argument Content contains the NC file:

0  BEGIN PGM cycle28 MM 
1 BLK FORM 0.1 Z X-30 Y-30 Z-15
2 BLK FORM 0.2 X+30 Y+30 Z+0
3 TOOL CALL 19 Z S2000
4 CALL LBL 10
...
36 LBL 99
37 END PGM cycle28 MM

Extension Step 3: Alarm and Event Handling

Alarm and Events are captured by an Alarm Event Pool Node.

  1. Select the root node of your device template and add a new device node here. Click [+] button.

  2. Select the MachineAlarming node

    Command Node

    The alarm event pool MachineAlarming contains an alarm task with address Nc1.NcAlarmEvent:0.

    Command Node

    Hints

    • Reassign the changed device template to your Heidenhain device.
  3. Deploy and run HumanOS IoT Gateway

  4. Go to UAExpert and add the history trend view. [Document] - [Add].

    Add Event View

  5. Drag and Drop the MachineAlarming to the "Configuration".

    Add Event View

  6. Switch to the Heidenhain Simulator and press any non-functional key, e.g. select Manual mode and then press [GOTO].

  7. The alarm appears in the "Event View" of the UAExpert.

    Add Event View

Questions

  1. What is the main purpose of the device information model?

    Answer
    The main purpose is to define the access to devices (hardware or software).

  2. What are the main node types of the device information model?

    Answer
    Main node types in device information model are:
    • Group Node
    • Data Node
    • Command
    • Alarm Event Pool

  3. Are there other node types for device information models? Name them.

    Answer
    Other node types are:
    • Constant Node
    • Processing Network with Data Processor
    • Port Matching Rule

  4. What information are provided by the Alarm Event Pool for OPC-UA Alarms?

    Answer
    Following information are passed:
    • Condition Name
    • Message Text
    • Source Name
    • Time stamp
    • Severity of the Event
    • Event Id

Further Information

Source Files