Skip to content

Connecting a PLC using OPC UA Connector

Use OPC UA Connector to connect a PLC to your Industrial Edge environment.

To connect Industrial Edge to your environment, you need three main components:

  • The OPC UA Connector to read data from your PLC and translate it to MQTT.
  • The Databus App to run on your IE Device, act as a central data broker, and store data configurations for your individual applications.
  • The IIH Essentials App to implement a digital representation of your machine and make the data accessible via a REST API for further processing.

Two additional apps are used during the process for convenience:

  • The Databus Configurator App in the IEM instance.
  • The Common Configurator App to provide a user interface for IIH Essentials and to add data sources to OPC UA Connector.

The figure below highlights the roles of the different applications and components.

The figure below highlights the roles of the different applications and components.

Prerequisites for connecting a PLC using OPC UA Connector

Software requirements

Hardware requirements

  • A PLC device that supports data transfer via OPC UA.
  • An RJ45 Ethernet cable when using VMware and a virtual IE Device.

Enabling the OPC UA server in TIA Portal

TIA Portal is Siemens engineering software for programming and managing automation devices. Activate the OPC UA server in TIA Portal to use the OPC UA Connector app on the PLC.

  1. Open TIA Portal.
  2. In the "Device" column, click the PLC you wish to enable. Click "Device Configuration".
  3. Click "OPC UA" > "Server" > "General".
  4. Under "Accessibility of the Server", select "Activate OPC UA server".

    Under "Accessibility of the Server", click the checkbox to "Activate OPC UA server".

  5. Click "OPC UA" > "Server" > "Security".

  6. Under "Security policies available on the server for the secure channel", select "No security".

    Under "Security policies available on the server for the secure channel", click the checkbox for "No security".

NOTICE

Using "No Security" for OPC UA Connector is not recommended for production. Use certificates for cybersecurity best practices.

Configuring the network interfaces for IE Devices to connect to OPC UA Connector

The network interfaces for physical IE Devices are configured as part of the onboarding process. Additional steps are required to allow connections between the PLC and a virtual IE Device.

If you are using a physical IE Device, proceed to Adding your PLC as an OPC UA data source.

To configure a virtual IE Device, follow the matching conditional steps.

Conditional steps

Create a virtual adapter in Hyper-V. Bridge the virtual adapter to the physical adapter on your machine to establish communication between the PLC and the virtual IE Device.

Next, apply the virtual adapter to your virtual IE Device.

Creating and mapping a virtual network adapter

  1. Open Hyper-V. The library contains a virtual machine for the virtual IE Device.

    Open Hyper-V.

  2. In the right sidebar, click "Virtual Switch Manager". The "Virtual Switch Manager" window opens.

    Virtual switch manager

  3. In the left sidebar, select "New Virtual Network Switch".

  4. Choose type "External".
  5. Click "Create Virtual Switch".
  6. Click "OK".

    Create External Virtual Switch

  7. Choose a name for your virtual switch.

  8. Select "External network". A drop-down menu appears.
  9. Select the network adapter you want to use.
  10. Select "Allow management operating system to share this network adapter".
  11. Click "Apply".
  12. Click "OK".

    Configure virtual switch

  13. Read the warning message shown in the figure below. Click "Yes".

    Select VM named "IndustrialEdgeVirtualDevice".

Applying the virtual network adapter to the virtual machine

  1. Select the VM named "IndustrialEdgeVirtualDevice".
  2. In the right sidebar, click "Settings". A drop-down menu appears.

    Select VM named "IndustrialEdgeVirtualDevice". In the right sidebar, click "Settings".

  3. Select the newly created switch.

  4. Click "Apply".
  5. Click "OK".

    configure_network_interface_hyper-v_apply_created_adapter_marked.png

Hyper-V displays the virtual network adapters when the connection is successful.

configure_network_interface_hyperv_check_config.png

Proceed to Setting up the network connection for the virtual IE Device and OPC UA Connector.

Bridging the physical network adapter to the virtual machine

Use an Ethernet cable to bridge the physical network adapter directly to the virtual machine with VMware.

Proceed as follows:

  1. Connect the PLC to your laptop using an RJ45 Ethernet cable.
  2. Open VMware Workstation.
  3. In the Virtual Machine window, click the Player button in the top-left corner.
  4. Navigate to "Manage" > "Virtual Machine Settings". The Virtual Machine Settings dialog opens.

    Navigate to "Manage" > "Virtual Machine Settings". The Virtual Machine Settings menu opens.

  5. Select "Network Adapter 2".

  6. Change the network connection setting from "NAT" to "Bridged".
  7. Select "Replicate physical network connection state".

    Change the network connection setting from "NAT" to "Bridged". Check the box for "Replicate physical network connection state".

  8. Click "Configure Adapters". The "Automatic Bridging Settings" dialog appears.

  9. Select "Intel® Ethernet Connection (10) 12L9-LM". Clear all other options.
  10. Click "OK" to confirm the changes.

    NOTICE

    The virtual machine default network adapter is Network Address Translation (NAT), which does not allow external devices to communicate with Industrial Edge Management. Change the adapter type to "Bridged" to allow external devices to communicate with Industrial Edge Management.

Proceed to Setting up the network connection for the virtual IE Device and OPC UA Connector.

Create and configure the virtual network adapter based on your specific infrastructure and communication requirements with ESXi.

  1. In the left navigation pane, select the newly created IEVD VM, and then click "Edit". The "Edit Settings" popup appears.

configure_network_interface_esxi_00_navigate.png

  1. Click "Add network adapter".

    configure_network_interface_esxi_01_edit_settings.png

  2. For the "New Network Adaptor" field, select the adapter to the network that contains the PLC you want to connect to the IEVD.

    configure_network_interface_esxi_02_added_adapter.png

  3. Check the "Connect" checkbox so the adapter is ready after VM startup.

    configure_network_interface_esxi_03_adapter_settings.png

  4. Review the adapter settings, then click "SAVE". ESXi saves the configuration.

Setting up the network connection for the virtual IE Device and OPC UA Connector

  1. Open the web browser on your local computer.
  2. Enter the IP address of the IE Device with HTTPS, for example https://<ip address>. The screen displays the IE Device UI login screen.
  3. Log in to the device UI.
  4. Click "Settings" from the left navigation pane. The "Settings" page opens.
  5. Click "Connectivity".
  6. Click "LAN Network".

    Click "LAN Network".

  7. Click the pencil icon next to the network adapter ens32 to modify its network settings.

    Click on the pencil icon next to the network adapter "ens32" to modify its network settings.

  8. Uncheck the "DHCP" checkbox.

  9. Enter a static IP address and netmask for the interface. The static IP address should be in the same subnet as the PLC.

    Enter a static IP address and netmask for the interface. The static IP address should be in the same subnet as the PLC.

    For a PLC with the IP address 192.168.236.127, enter the following values to ensure connectivity between the virtual IE Device and the PLC:

    • IPv4 (Static IP for the virtual IE Device): 192.168.236.129
    • Netmask: 255.255.255.0
    • Gateway: 192.168.236.1 (if applicable)
  10. Click "Update" to save the changes.

Adding your PLC as an OPC UA data source

Use the Common Configurator App to configure an OPC UA data source and set up the OPC UA communication channel to the PLC for data acquisition.

  1. In the device UI, click "Apps" from the left navigation pane. The "Apps" page opens.
  2. Click the "Common Configurator" tile. The "Common Configurator" UI opens.

    Click the "Common Configurator" tile. The "Common Configurator" UI opens.

  3. Click "Get Data" from the left navigation pane. A list of configuration apps appears.

  4. Click "Connector Configuration". The "Get Data" page opens.
  5. Under "Installed Connectors", click "OPC UA Connector".

    Under "Installed Connectors", click "OPC UA Connector".

  6. Click "Add". The "Add Data Source" page opens.

    Click "Add". The "Add Data Source" page opens.

    NOTICE

    The OPC UA Connector is the interface between the PLC and the IE Device. It must be configured with the PLC IP address and other PLC data. Once configured, the connector can browse the PLC data points.

  7. Define the following information:

    • Communication Protocol: OPC UA (OPC Server)
    • Communication Protocol: Select "Add manually"
    • Name: Can be freely chosen
    • OPC UA Server URL: opc.tcp://<ip address of PLC>
    • IP port number: 4840
    • Message Security Mode: None
    • Security Policy: None
    • Authentication mode: Anonymous

    Define the following information about the data source.

    NOTICE

    This tutorial does not select security policies or authentication because it focuses on testing. Using "No Security" for OPC UA Connector is not recommended for production. Use certificates for cybersecurity best practices.

    NOTICE

    More information about the settings is available in the OPC UA Connector documentation.

  8. Click "Save". OPC UA Connector activates the configuration.

  9. Click the "Log Messages" tab. The OPC UA Configurator logs open.
  10. Check the logs for the message "Connection established to [connector name]." to ensure the connection is established.

    Check the logs for the message "Connection established to [connector name]." to ensure the connection is properly established.

Configuring OPC UA Connector data source tags

Tags are data points that you wish to fetch from the IE Device. Once the OPC UA Connector data source is created, add and configure the IE Device tags to complete the connector configuration process.

Adding tags for OPC UA Connector

  1. In the OPC UA Connector page of the device UI, click the "Tags" tab. The "Tags" page opens.
  2. Click "Browse tags".

    Click "Browse tags".

  3. Click "Start browse". OPC UA Connector lists all available tags.

    Click "Start browse". The OPC UA Connector lists all available tags.

  4. Select the checkboxes for the tags you want to import from the IE Device via OPC UA Connector.

  5. Click "Add to Data Source". OPC UA Connector adds the tags.

    Click the checkboxes for the tags you wish to import from the IE Device via the OPC UA Connector. Click "Add to Data Source".

  6. To return to the "Tags" tab, click "Back".

Configuring tags for OPC UA Connector

  1. In the OPC UA Connector page of the device UI, click the "Tags" tab. The "Tags" page opens.
  2. Click the pencil icon in the "Actions" column for a tag. The tag becomes editable.

    Click on the pencil icon in the column "Actions" of a tag.

  3. Under "Acquisition cycle", select the preferred acquisition cycle. Siemens recommends an acquisition cycle of 1 second.

    Under "Acquisition cycle", select your preferred acquisition cycle. Siemens recommends using an acquisition cycle of 1 second.

    Publish to the Databus

    OPC UA Connector always publishes to Databus. Therefore, you do not need to select this option like with other connectors.

  4. Click the green tick icon to confirm.

    Click the green tick icon to confirm.

  5. Repeat steps 2-4 to configure more tags.

    Bulk edit

    Use the "Bulk edit" button to apply the same settings to multiple tags at once.

    tags_bulk_edit.png

  6. Click "Deploy". OPC UA Connector activates the configuration with the selected tags.

OPC UA Connector displays the pop-up "Deployment was successful" to indicate that the tags were configured successfully.

OPC UA Connector displays the pop-up box "Deployment was successful" to indicate the tags were successfully configured.

Validating the outcome

Review the log messages for any errors.

You have now connected Industrial Edge to your environment.

What's next?

Proceed to Creating an asset model.