Reading Complex Data from Siemens S7
This example shows following aspects:
- Configuring a complex data reading based on Siemens S7 memory
Preconditions
-
HumanOS IoT Designer installed on development client (Check Installation Manual)
-
Connectivity to a Siemens Control or S7 Simulator.
-
OPC-UA Client installed on the development client
Examples work with UAExpert from Unified Automation. Download UAExpert here
Step 1: Create a Designer Project for S7
-
Create an IoT project with HumanOS IoT Designer. Check Tutorial 1 Example for details about OPC-UA Bridges.
-
Add a new device template for S7 PLC.
In this example we use the empty device template.
Step 2: Create an Entity Type
-
Add a new entity type node to the S7 device template
-
Declare the data fields of your complex data type.
Step 3: Declaration of DataNode
The following steps are required to create a data node for complex data reading:
-
Add a new data node to your device template
-
The type of data node must be declared as
HumanOS.Kernel.DataModel.Entity.TGenericEntity, HumanOS.Kernel.Base
orHumanOS.Kernel.DataModel.Entity.TGenericEntity[], HumanOS.Kernel.Base
. -
The complex data type must be specified as a property
SelectedEntityType
. -
Set the correct memory address to read/receive data from the controller.
-
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.