LogoLogo
Contact Uscybus.io
Connectware 1.11.0
Connectware 1.11.0
  • Getting Started
    • Introduction
    • System Requirements
    • Connectware Admin UI
    • Basic Components of Connectware
    • Connecting your First Machine
      • Your First Service Commissioning File
  • Documentation
    • Installation and Upgrades
      • Installing Connectware
        • Installing Connectware (Kubernetes)
        • Installing Connectware (Docker)
      • Upgrading Connectware
        • Upgrading Connectware (Kubernetes)
          • Version-Specific Upgrades (Kubernetes)
        • Upgrading Connectware (Docker)
          • Version-Specific Upgrades (Docker)
      • Uninstalling Connectware
        • Uninstalling Connectware (Kubernetes)
        • Uninstalling Connectware (Docker)
      • Licensing
      • Restarting Connectware
    • User Management
      • Users and Roles View
      • Users
      • Roles
      • Permissions
      • Password Policy Rules
      • Default Admin User
      • MQTT Users
      • Adding a MQTT Publish Prefix for Users
      • Multi-Factor Authentication
      • Single Sign-On (SS0)
        • Single Sign-On with Microsoft Entra ID
        • Single Sign-On with LDAP
      • JSON Web Tokens
      • Access Permissions for Admin-UI
        • UI Access
        • Minimum Access Role Pages
    • Services
      • Service Overview
      • Service Resources View
        • Service Links View
        • Servers View
        • Containers View
        • Volumes View
        • Connections View
        • Endpoints View
        • Mappings View
      • Service Details View
      • Service Commissioning Files
        • Version
        • Description
        • Metadata
        • Parameters
        • Definitions
        • Resources
          • Cybus::Connection
          • Cybus::Container
            • Docker Problem with Network Changes
          • Cybus::Endpoint
          • Cybus::File
          • Cybus::IngressRoute
          • Cybus::Link
          • Cybus:Mapping
          • Cybus::Node
          • Cybus::Role
          • Cybus::Server
          • Cybus::User
          • Cybus::Volume
      • Setting Up and Configuring Services
        • Installing Services
        • Enabling Services
        • Updating Services
        • Disabling Services
        • Deleting Services
      • FlowSync
        • Example 1 - Node with Transaction Mode (HTTP)
        • Example 2 - Node Responds (HTTP)
        • Example 3 - Node with Error (HTTP)
        • Example 4 - Node with Timeout Error Code and Error Message (HTTP)
        • Example 5 - Full Transactional Data Flow (HTTP)
        • Example 6 - Full Transactional Data Flow (OPC UA)
      • ServiceID
      • Inter-Service Referencing
      • Deviations
      • Service Logs
        • Logs of Individual Services
        • Logs of All Services
      • Rule Engine
        • Data Processing Rules
        • Rule Sandbox
      • Shared Subscriptions
        • Setting Up Shared Subscriptions
    • Agents
      • Agents View
      • Installing Agents
        • Installing Agents via Docker
        • Installing Agents via Docker Compose
        • Installing Agents via Kubernetes
        • Using Mutual TLS for Agents
      • Registering Agents in Connectware
      • Using Agents
      • Monitoring Agents
      • Agents in Kubernetes
        • Adding Agents Inside your Connectware Installation
        • Remote Agents with the connectware-agent Helm Chart
        • Kubernetes Cluster Requirements for the connectware-agent Helm Chart
        • Installing Connectware Agents using the connectware-agent Helm Chart
        • Installing Connectware Agents without a License Key Using the connectware-agent Helm Chart
        • Upgrading the connectware-agent Helm Chart
        • Uninstalling Connectware agents with the connectware-agent Helm chart
        • Configuration Principles for the connectware-agent Helm Chart
        • Configuring Agents with the connectware-agent Helm Chart
          • Configuring Target Connectware for the connectware-agent Helm Chart
          • Configuring Agent Persistence for the connectware-agent Helm Chart
          • Configuring Compute Resources for the connectware-agent Helm Chart
          • Using a Custom Image Registry for the connectware-agent Helm Chart
          • Configuring Image Pull Policy for the connectware-agent Helm Chart
          • Using Mutual Transport Layer Security (mTLS) for agents with the connectware-agent Helm chart
          • Configuring image name and version for the connectware-agent Helm chart
          • Configuring Environment Variables for the connectware-agent Helm Chart
          • Configuring Labels and Annotations for the connectware-agent Helm Chart
          • Configuring podAntiAffinity for the connectware-agent Helm Chart
          • Assigning Agents to Kubernetes Nodes for the connectware-agent Helm Chart
          • Configuring Security Context for the connectware-agent Helm Chart
          • Controlling the Name of Kubernetes Objects for the connectware-agent Helm Chart
      • Troubleshooting Agents
    • Client Registry
      • Implicit Flow
      • Explicit Flow
      • Granting Access
    • Certificates
      • Certificates View
      • Adding Certificates
      • Removing Certificates
    • Monitoring
      • Data Explorer
      • Live Data
    • Node-RED Workbench
    • System Status
      • Info
      • Metrics
      • Status
      • Retrieving More System Information
      • System Health
    • Backup and Restore
      • Volumes
      • User Database
    • CybusMQ
      • Configuring CybusMQ
    • Connectware on Kubernetes
      • Connectware Helm Chart
      • Resizing Broker Volumes in Kubernetes
      • Configuring Core Services
      • LDAP Authentication
        • Configuring LDAP Authentication
        • Enabling TLS for LDAP Authentication
        • Manual Kubernetes Secret for LDAP Authentication Bind User
        • Customizing the Search Filter for LDAP Authentication
        • Customizing the User RDN for LDAP Authentication
      • Troubleshooting Connectware on Kubernetes
    • Environment Variables
    • Industry Protocol Details
      • ADS
        • ADS Connection Properties
        • ADS Endpoint Properties
      • BACnet
        • BACnet Connection Properties
        • BACnet Endpoint Properties
      • Custom Connectors
        • Developing Custom Connectors
        • Deploying Custom Connectors
        • Using Custom Connectors
      • EtherNet/IP
        • EtherNet/Ip Connection Properties
        • EtherNet/Ip Endpoint Properties
      • FOCAS
        • FOCAS Connection Properties
        • FOCAS Endpoint Properties
      • Hottinger Baldwin Messtechnik (HBM)
        • HBM Connection Properties
        • HBM Endpoint Properties
      • Heidenhain DNC
        • Heidenhain DNC Connection Properties
        • Heidenhain DNC Endpoint Properties
      • HTTP/REST
        • HTTP/REST Connection Properties
        • HTTP/REST Endpoint Properties
      • HTTP Server/Node
        • HTTP Server Properties
        • HTTP Node Properties
      • InfluxDB
        • InfluxDB Connection Properties
        • InfluxDB Endpoint Properties
      • Kafka
        • Kafka Connection Properties
        • Kafka Endpoint Properties
      • Modbus/TCP
        • Modbus/TCP Connection Properties
        • Modbus/TCP Endpoint Properties
      • MQTT
        • MQTT Connection Properties
        • MQTT Endpoint Properties
      • MSSQL
        • Mssql Connection Properties
        • Mssql Endpoint Properties
      • OPC DA
        • OPC DA Connection Properties
        • OPC DA Endpoint Properties
      • OPC UA
        • OPC UA Client
          • OPC UA Client Connection Properties
          • OPC UA Client Endpoint Properties
        • OPC UA Server
          • OPC UA Server Properties
          • OPC UA Node Properties
        • OPC UA Object Types
        • OPC UA Server References
          • OPC UA Reference Node
          • OPC UA Object Node
      • Siemens SIMATIC S7
        • Siemens S7 Connection Properties
        • Siemens S7 Endpoint Properties
      • Shdr
        • Shdr Connection Properties
        • Shdr Endpoint Properties
      • SINUMERIK
        • SINUMERIK Connection Properties
        • SINUMERIK Endpoint Properties
      • SOPAS
        • SOPAS Connection Properties
        • SOPAS Endpoint Properties
      • SQL
        • SQL Connection Properties
        • SQL Endpoint Properties
      • Werma WIN Ethernet
        • Werma WIN Ethernet Connection Properties
        • Werma WIN Ethernet Endpoint Properties
      • Systemstate
        • Systemstate Endpoint Properties
    • API Reference
      • User Management (API)
      • Client Registry (API)
      • Services (API)
      • Resources (API)
      • System Status (API)
      • Resource Status Tracking (HTTP API)
      • Industry Protocol Details (API)
    • Changelog
Powered by GitBook
LogoLogo

Cybus

  • Terms and Condition
  • Imprint
  • Data Privacy

© Copyright 2025, Cybus GmbH

On this page
  • Configuring the connection
  • Hardware specific values
  • Service Commissioning File Example

Was this helpful?

  1. Documentation
  2. Industry Protocol Details

Siemens SIMATIC S7

PreviousOPC UA Object NodeNextSiemens S7 Connection Properties

Last updated 2 months ago

Was this helpful?

The Simatic S7 is a product line of PLCs (S7-200, S7-300, S7-400, S7-1200, S7-1500) by Siemens that are widely used in industrial automation. The S7 is capable of connecting several sensors and actuators through digital or analog IOs which can be modular extended.

The S7 PLC can be projected and programmed with STEP7 (TIA Portal) software from Siemens.

The read and write access to data on the PLC can be realized through the S7 Communication Services based on ISO-on-TCP (RFC1006). In this case the PLC acts as a server allowing communication partners to access PLC data without the need of projecting the incoming connections during PLC programming.

To activate the S7 Communication Services you need to enable PUT/GET access in PLC Settings! You should keep in mind that this opens up the controller access by other applications as well.

Configuring the connection

The S7 protocol driver behaves differently from other protocol drivers when polling, because it only allows a single polling interval to be set for all mappings. The reason for this is that the driver optimizes the request as it groups multiple readings into as few block reads as possible. For this reason the interval is set in the connection details, and not in the mappings for this protocol. If multiple different polling rates are required, you should consider using multiple commissioning files. Support for different polling rates in a single commissioning file may be added in the future.

Hardware specific values

CPU
Rack
Slot

S7-300

0

2

S7-400

see hardware configuration.

WinAC

see hardware configuration.

S7-1200

0

1

S7-1500

0

1

The address of a PLC variable is a string built like this:

<data block number>,<memory area><data type><byte offset>.<bit position>.<array length>

<data block number>

Name of the data block the value is stored in e.g. DB10. Only use this parameter if your value is part of a data block.

<memory area>

Memory area where the value is stored. Must not be defined if target is a data block!

Memory area
Address symbol

input

I

peripheral input

PI

output

Q

peripheral output

PQ

marker

M

counter

C

timer

T

<data type>

Data type of the addressed value. Data type “string” can only be used in data blocks.

Data type
Address symbol

bit

X (or empty)

byte

B

char

C

word

W

int16

I

dword

DW

int32

DI

real

R

int64

LI (S7-1200/1500 only)

lreal

LR (S7-1200/1500 only)

string

S (only in data blocks)

date_and_time

DT

date_and_time in UTC

DTZ

date_and_time (12 byte)

DTL (S7-1200/1500 only)

date_and_time in UTC (12 byte)

DTLZ (S7-1200/1500 only)

<byte offset>

The offset of the byte to address.

<bit position>

To address a bit position place it here. In case you are addressing a string data type this parameter is the string length.

<array length>

To address multiple values in a row define the length of the array here.

The minimum information any address must contain is <data block number> or <memory area>, <data type> and <byte offset>. <bit position> is only necessary for addressing bits. <array length> is always optional.

Address Examples:

  • MR4 // REAL starting at marker byte 4 (MD4 in STEP 7)

  • M32.2 // Bit at marker byte 32 bit 2

  • PIW30 // WORD starting at peripheral input byte 30

  • PII30 // INT starting at peripheral input byte 30

  • DB1,R0.20 // Array of 20 REAL values in DB1 starting at byte 0

  • DB1,R4 // Single REAL value

  • DB1,REAL8 // Another single REAL value

  • DB1,I12.2 // Two INT value array

  • DB10,INT6 // DB10.DBW6 as INT

  • DB10,I6 // same as above

  • DB10,I6.2 // DB10.DBW6 and DB10.DBW8 in an array with length 2

  • DB10,S20.30 // String at offset 20 with length of 30 (actual array length 32 due to format of String type, length byte will be read/written)

  • DB10,S20.30.3 // Array of 3 strings at offset 20, each with length of 30 (actual array length 32 due to format of String type, length byte will be read/written)

  • DB10,C22.30 // Character array at offset 22 with length of 30 (best to not use this with strings as length byte is ignored)

  • DB10,X6.0.1 // Bit at DB10.DBX6.0 as array with length 1

  • DB10,DT0 // Date and time

  • DB10,DTZ0 // Date and time in UTC

To access data from data blocks you need to disable “Optimized Block Access” in data block attributes!

Service Commissioning File Example

s7-example.yml
---
# ----------------------------------------------------------------------------#
# Commissioning File
# ----------------------------------------------------------------------------#
# Copyright: Cybus GmbH (2020)
# Contact: support@cybus.io
# ----------------------------------------------------------------------------#
# Source Interface Definition - Siemens S7 PLC
# ----------------------------------------------------------------------------#
# ----------------------------------------------------------------------------#
description: |
    Sample commissioning file for Siemens S7 PLC connectivity and data mapping

metadata:
    name: S7 Protocol Connectivity
    icon: https://www.cybus.io/wp-content/uploads/2019/03/Cybus-logo-Claim-lang.svg
    provider: cybus
    homepage: https://www.cybus.io
    version: 0.0.1

parameters:
    IP_Address:
        type: string
        default: 192.168.10.60

    Port_Number:
        type: integer
        default: 102

    Rack_Number:
        type: integer
        default: 102

    Slot_Number:
        type: integer
        default: 102

    Poll_Interval:
        type: integer
        default: 1000

resources:
    s7Connection:
        type: Cybus::Connection
        properties:
            protocol: S7
            targetState: connected
            connection:
                host: !ref IP_Address
                port: !ref Port_Number
                rack: !ref Rack_Number
                slot: !ref Slot_Number
                pollInterval: !ref Poll_Interval

    s7EndpointQX00:
        type: Cybus::Endpoint
        properties:
            protocol: S7
            connection: !ref s7Connection
            subscribe:
                address: QX0.0

    s7EndpointAIB0:
        type: Cybus::Endpoint
        properties:
            protocol: S7
            connection: !ref s7Connection
            subscribe:
                address: IB0

    mapping:
        type: Cybus::Mapping
        properties:
            mappings:
                - subscribe:
                      endpoint: !ref s7EndpointQX00
                  publish:
                      topic: !sub '${Cybus::MqttRoot}/QX00'
                - subscribe:
                      endpoint: !ref s7EndpointAIB0
                  publish:
                      topic: !sub '${Cybus::MqttRoot}/AIB0'

Output Format on Write

When data is written to a S7 endpoint, you will get the result of the operation over the /res topic like this:

{ 'id': 29194, 'timestamp': 1629351968526, 'result': 0 }

Output Format on Read

If data is read from Siemens SIMATIC S7 the output will be provided as JSON object, with the actual S7 data in the property value, and the reception timestamp in the property timestamp.

{ 'value': '<value>', 'timestamp': '<msSinceEpoch>' }

Input Format on Write

If data is written to Siemens SIMATIC S7 it must be provided as JSON object, with the actual S7 data in the property value:

{ 'value': '<value>' }

Additionally an id property can be provided in the published message to use as a correlation value for the response of the write operation.

{ 'value': '<value>', 'id': '<your correlation id>' }

The result of a write operation is published on the /res topic for the Endpoint see for more details on writing operations

Connection Properties
Endpoint Properties
2KB
s7-example.yml
../../_images/s7_put_get_access.PNG
../../_images/s7_data_block_attributes.PNG
Operation results