Skip to content

Connecting a PLC using S7 Connector

In this tutorial, use S7 Connector to connect a PLC to your Industrial Edge environment.

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

  • The SIMATIC S7 Connector to read data from your PLC and translate it to MQTT.
  • The Databus App to run on your IE Device and act as a central data broker and stores 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 your convenience:

  • The Databus Configurator App in the IEM instance.
  • The Common Configurator App which provides a UI for IIH Essentials and to add data sources to S7 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 S7 Connector

Software requirements

Hardware requirements

  • A device which supports data transfer via the S7 protocol, such as:
    • SIMATIC S7-300
    • SIMATIC S7-400
    • SIMATIC S7-1200
    • SIMATIC S7-1500

Here we are showcasing the S7 Optimized protocol, which only is supported by S7-1200 and S7-1500.

Configuring the network interfaces for IE Devices to connect to S7 Connector

The network interfaces for physical IE Devices were 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 S7 data source.

To configure a virtual IE Device, follow the conditional steps based on the hypervisor.

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 your IEvD.

    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 dropdown menu appears.
  9. Select the network adapter you want to use.
  10. Check the box for "Allow management operating system to share this network adapter".
  11. Click "Apply".
  12. Click "OK".

    Configure virtual switch

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

    Warning message

Applying the virtual network adapter to the virtual machine

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

    configure_network_interface_hyper-v_select_vm.png

  3. Select the newly created switch.

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

    Apply newly created switch

Hyper-V displays the virtual network adapters when successfully connected.

Hyper-V displays the virtual network adapters when successfully connected.

What's next?

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

Using an Ethernet cable, bridge the physical network adaptor directly to the virtual machine with VMware.

  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 menu 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. Check the box for "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". A popup for "Automatic Bridging Settings" appears.

  9. Check the box for "Intel® Ethernet Connection (10) 12L9-LM". Uncheck all other options.
  10. Click "OK" to confirm changes.

    NOTICE

    The virtual machine's 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.

What's next?

Proceed to Setting up the network connection for the virtual IE Device and S7 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 S7 Connector

  1. Open the web browser on your local computer.
  2. Enter the IP address of the IE Device with the HTTPS protocol, i.e. 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 on 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 changes.

Adding your PLC as an S7 data source

Use the Common Configurator App to configure an Ethernet IP Connector data source and set up the Ethernet IP communication channel to the PLCs for data acquisition.

To add a data source to the Ethernet IP Connector:

  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", select "S7 Connector".

    Under "Installed Connectors", select "S7 Connector".

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

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

    NOTICE

    The S7 connector is the interface between the PLC and the IE Device. It must be configured with information about the IP address and other data of your PLC. Once configured, the S7 connector is able to browse the data points of the PLC.

  7. Select the protocol "Optimized S7-Protocol".

    Select the protocol "Optimized S7-Protocol".

  8. Define the following information:

    • Communication Protocol: Optimized S7-Protocol
    • Communication Protocol: Select "Add manually"
    • Name: Can be freely chosen
    • PLC-Type: Choose the hardware you are using
    • IPv4 address: Enter the IP address of the PLC
    • Password: If required, enter the corresponding password for connecting to the PLC.
    • Certificate files: If required, add the corresponding certificate files.

    Define the following information about the data source.

    NOTICE

    More information about the settings is available in the S7 Connector documentation.

  9. Click "Save" to activate the configuration.

  10. Click the "Log Messages" tab. The S7 Connector logs open.
  11. Check the logs for the following messages to ensure the connection is properly established:

    • The [Name of Configuration] connection is up. Device is in running state.
    • Connector is running, connections to underlying device(s) are established. Everything is fine.

    Go to the "Log Messages" tab to check if the connection is established.

Configuring the S7 Connector data source tags

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

Adding a tag to S7 Connector

  1. In the Ethernet IP 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". The S7 Connector lists all available tags.

    Click "Start browse". The S7 Connector lists all available tags.

  4. Click the checkboxes for the tags you wish to import from the IE Device via the S7 Connector.

  5. Click "Add to Data Source".

    Click "Add to Data Source".

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

Configuring a tag for S7 Connector

  1. In the S7 Connector page of the Device UI, click the "Tags" tab. The "Tags" page opens.
  2. Click on the pencil icon in the column "Actions" of a tag. The tag becomes editable.

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

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

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

  4. Check the "Publish on the Databus" checkbox.

  5. Click the green tick icon to confirm.

    Click the green tick icon to confirm.

  6. Repeat steps 2–5 to configure more tags.

    Bulk edit

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

    Bulk edit

  7. Click "Deploy". S7 Connector activates the configuration with the selected tags.

    Click "Deploy".

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

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

Validating the outcome of connecting a PLC using S7 Connector

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.