Connect a S7 device to the IoTHub

Connecting an S7 device to the IoTHub requires a running agent. There are two ways to install and start an agent. The first way (recommended) is to use the agent controller (see more). The second way is to start the agent as a standalone process manually (see moreopen in new window).

Step-by-step guide using the agent controller

  1. Connect an agent controller to the IoTHub (see more).

  2. Add an S7 agent to the IoTHub by clicking the icon at the top of the agent list.

Agent Page
Agent Page
  1. Fill out the dialog with a unique name, a human-readable title, and an optional description.
Add S7 agent
Add S7 agent
  1. Select Siemens Simatic S7 from the Third Party Agents group as Agent Type and Confirm the data.

  2. Select the agent from the list at the left and assign the agent controller by clicking at the Assign Controller button at the top of the details view.

Assign Controller
Assign Controller
  1. Install the agent by clicking the icon in the Controller Actions and State frame
Controller State assigned
Controller State assigned
  1. Start the agent by clicking the icon.
Agent state installed
Agent state installed
  1. Confirm that the agent is connected to the IoTHub. It might be required to click the refresh icon () to see the latest state of the agent.
Agent state connected
Agent state connected

Step-by-step guide installing the agent manually

  1. Download the agent binary for the target system:
Latestv3.0.0
Linux x86open in new windowLinux x86open in new window
Linux amd64open in new windowLinux amd64open in new window
Linux armopen in new windowLinux armopen in new window
Linux arm64open in new windowLinux arm64open in new window
Windows x86open in new windowWindows x86open in new window
Windows amd64open in new windowWindows amd64open in new window
Darwinopen in new windowDarwinopen in new window
  1. Unpack it to a destination folder and open a terminal there

  2. Start the agent with the command line

./siemens-s7 --id ${id} \
  --gateway${url} \
  --token ${token}

with

  • id: ID of the agent, can be found at the General Info box
  • url: The IoTHub URL with the gateway port
  • token: Security token of the agent, can be found and copied at the General Info box
  1. Find more options at the agent manualopen in new window

Step-by-step guide connecting a S7 thing

  1. Add a S7 thing to the IoTHub by clicking the icon in top of the thing list at the Thing page.
Thing page
Thing page
  1. Select the type Siemens Simatic S7 and click Next
Select Thing Type
Select Thing Type
  1. Fill out the dialog with a unique name, a human-readable title, and an optional description.
Descriptive attributes of the thing
Descriptive attributes of the thing
  1. Scroll down to the configuration section and provide the device's endpoint (address and port) and a different Rack or Slot number if required. Then click Next.
Configuration of the S7 thing
Configuration of the S7 thing
  1. Install the thing by clicking the Install button.
Install the S7 thing
Install the S7 thing
  1. Navigate to the Agents page and select the S7 agent.

  2. Enable editing the agent by clicking Edit Agent

Edit Agent
Edit Agent
  1. Scroll to the Thing Assignment box and select the previously created thing.
Assign thing
Assign thing
  1. Save the assignement by clicking on the Save Changes button at the bottom.

  2. Switch back to the Things page and select the S7 thing

Thing view
Thing view
  1. Clicking at the TRIGGER ACTIONS button at the top of the detail view.

  2. Clicking at the CONNECT DEVICE action

Action selection
Action selection
  1. Create properties to observe data items at the PLC. Use the below the Info box
Add a property
Add a property
  1. Give the property a unique name, specify its S7 addressing, and select the correct data type for it. Optionally, add a description and a human-readable title.
Define the property
Define the property
  1. If the property was correctly created, it will be immediately visible. Moreover, if the Thing is connected, the property will automatically get values updates from the agent.
Property view
Property view
Last Updated: