Skip to main content
Version: 2.8

Reading Complex Data from Siemens S7

This example shows following aspects:

  1. Configuring a complex data reading based on Siemens S7 memory

Preconditions

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

  2. Connectivity to a Siemens Control or S7 Simulator.

  3. OPC-UA Client installed on the development client

RECOMMENDATION

Examples work with UAExpert from Unified Automation. Download UAExpert here

Step 1: Create a Designer Project for S7

  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 S7 PLC.
    In this example we use the empty device template.

    Create Template

Step 2: Create an Entity Type

  1. Add a new entity type node to the S7 device template

    Create EntityTypeNode

  2. Declare the data fields of your complex data type.

    Define EntityTypeNode

Step 3: Declaration of DataNode

The following steps are required to create a data node for complex data reading:

  1. Add a new data node to your device template

  2. The type of data node must be declared as HumanOS.Kernel.DataModel.Entity.TGenericEntity, HumanOS.Kernel.Base or HumanOS.Kernel.DataModel.Entity.TGenericEntity[], HumanOS.Kernel.Base.

  3. The complex data type must be specified as a property SelectedEntityType.

  4. Set the correct memory address to read/receive data from the controller.

  5. Add the property InvertByteOrder since Siemens S7 uses an inverted byte order memory.

Check the manual of the specific control in order to choose the right data types.