Skip to main content
Version: 2.0-beta.1

S7 Siemens S7 Integration Guide

MaestroHub integrates natively with Siemens S7 PLC families. Author reusable functions for deterministic reads and writes, manage security, and orchestrate PLC communication inside your pipelines.

Overview

The Siemens S7 connector provides:

  • Direct communication over the S7 protocol through Maestro Agents or secure network tunnels
  • Structured data access for Data Blocks, Inputs, Outputs, Markers, Timers, and Counters
  • Type-aware conversions for BOOL, INT, DINT, REAL, STRING, and custom structures
  • Session management with configurable rack/slot addressing and connection diagnostics

Connection Configuration

Creating a Siemens S7 Connection

Navigate to ConnectionsNew ConnectionSiemens S7 and configure the PLC endpoint with the following fields.

Siemens S7 Connection Creation Fields

1. Profile Information
FieldDefaultDescription
Profile Name-A descriptive name for this connection profile (required, max 100 characters)
Description-Optional description for this S7 connection
2. S7 Connection Settings
FieldDefaultDescription
PLC Address192.168.1.100:102PLC IP address and port (format: host:port) – required, port must be 1-65535
Rack0PLC rack number (0-7) – required
Slot1PLC slot number (0-31) – required
Connection TypeProgramming Device (PG)S7 connection mode – required

Connection Type Options

Connection TypeValueDescriptionTypical Use Cases
Programming Device (PG)1For programming and diagnosticsPLC programming and diagnostics
System monitoring and debugging
Configuration and maintenance
Operator Panel (OP)2For operator panels and HMIHMI and operator interfaces
Data visualization panels
Process monitoring applications
Basic Connection3Basic data exchangeSimple data exchange
Basic communication needs
Limited access scenarios
3. Timeout Configuration
FieldDefaultDescription
Request Timeout (ms)10000Maximum time to wait for S7 response (0-300000 ms, 0-5 minutes)
Idle Timeout (ms)30000Close connection after idle period (0-1800000 ms, 0-30 minutes, 0 = never)
Retry Count2Number of retries on communication failure (0-10)
Retry Delay (ms)1000Delay between retry attempts (0-60000 ms, 0-60 seconds)
4. Security Configuration
FieldDefaultDescription
Session Password-Optional password for protected PLCs (max 8 characters)
5. Connection Labels
FieldDefaultDescription
Labels-Key-value pairs to categorize and organize this S7 connection (max 10 labels)

Example Labels

  • environment: production – Deployment environment
  • line: line-1 – Production line
  • plc-type: s7-1200 – PLC model
  • location: factory-floor – Physical location
Notes
  • Standard Port: The default S7 communication port is 102 (ISO-on-TCP).
  • Rack and Slot: These values identify the CPU module location in the PLC rack (common combinations: rack = 0 with slot 1 or slot 2). Check your PLC hardware configuration for exact values.
  • Connection Type Selection: PG provides full access for development/diagnostics, OP is tailored for HMIs, and Basic is for minimal data exchange.
  • Password Protection: Only required if the PLC has password protection enabled in its security settings.
  • Timeout Recommendations: Use a 10000 ms request timeout for local networks (increase for remote) and set idle timeout to 30000 ms or higher depending on application needs.
  • Address Format: Must be host:port. Host can be an IP address or hostname and port must be 1-65535 (102 is typical for S7).
  • Security Note: Session passwords are stored securely and used for establishing authenticated connections to protected PLCs.

Function Builder

Creating Siemens S7 Functions

Once the connection is saved:

  1. Go to FunctionsNew Function
  2. Choose S7 Read or S7 Write
  3. Select the Siemens S7 connection profile
  4. Define addresses, data types, and optional scaling/structure metadata
Siemens S7 Function Creation

Author Siemens S7 read/write functions with address templates and data type mapping

Read DB Multi Function

Purpose: Read multiple data points from a Siemens S7 data block (DB) in a single operation. Allows efficient reading of various data types from different offsets within the same data block.

Configuration Fields

FieldTypeRequiredDefaultDescription
Data Block NumberNumberYes1The DB number to read from (e.g., DB100). Minimum: 0
Data PointsArrayYesSee belowList of data points to read from the data block (minimum 1 point)

Data Point Fields:

FieldTypeRequiredDefaultDescription
Point NameStringYespoint1Unique name for this data point (1-100 characters)
Start OffsetNumberYes0Byte offset within the data block (0-65535)
Size (bytes)NumberYes4Number of bytes to read (1-65536)
Data TypeStringYesREALS7 data type: BIT, BYTE, WORD, DWORD, CHAR, STRING, WSTRING, INT, DINT, REAL, LREAL, TIMER, TIME_OF_DAY, DATE_AND_TIME, COUNTER

Use Cases: Read sensor data from DB, get process variables, monitor PLC states, bulk data acquisition

Read Memory Multi Function

Purpose: Read multiple data points from Siemens S7 memory areas (M, I, Q) in a single operation. Allows efficient reading of various data types from different memory areas such as merkers, inputs, and outputs.

Configuration Fields

FieldTypeRequiredDefaultDescription
Memory AreaStringYesMS7 memory area to read from: M (Merkers), I (Process Inputs), Q (Process Outputs)
Data PointsArrayYesSee belowList of data points to read from the memory area (minimum 1 point)

Data Point Fields:

FieldTypeRequiredDefaultDescription
Point NameStringYespoint1Unique name for this data point (1-100 characters)
Start AddressNumberYes0Memory address/offset (0-65535)
Size (bytes)NumberYes1Number of bytes to read (1-65536)
Data TypeStringYesBITS7 data type: BIT, BYTE, WORD, DWORD, CHAR, STRING, WSTRING, INT, DINT, REAL, LREAL, TIMER, TIME_OF_DAY, DATE_AND_TIME, COUNTER

Use Cases: Read input/output states, monitor memory flags, get process I/O data, system status monitoring

Write DB Function

Purpose: Write a single data point to a Siemens S7 data block (DB). Allows writing various data types to specific offsets within a data block for control and configuration operations.

Configuration Fields

FieldTypeRequiredDefaultDescription
Data Block NumberNumberYes1The DB number to write to (e.g., DB100). Minimum: 0
Start OffsetNumberYes0Byte offset within the data block (0-65535)
Bit PositionNumberNo0Bit position (0-7, only required for BIT data type)
Size (bytes)NumberNo4Number of bytes (auto-calculated based on data type) (1-65536)
Data TypeStringYesREALS7 data type: BIT, BYTE, WORD, DWORD, CHAR, STRING, WSTRING, INT, DINT, REAL, LREAL, TIMER, TIME_OF_DAY, DATE_AND_TIME, COUNTER
ValueStringYes-Value to write (format depends on data type). Examples: true (BIT), 255 (BYTE), 25.5 (REAL), Hello (STRING)

Use Cases: Set configuration values, update setpoints, write control commands, configuration management

Write Memory Function

Purpose: Write a single data point to Siemens S7 memory areas (M, Q). Allows writing various data types to different memory areas for control and status operations. Note: Process Inputs (I) are read-only.

Configuration Fields

FieldTypeRequiredDefaultDescription
Memory AreaStringYesMS7 memory area to write to: M (Merkers), Q (Process Outputs). Note: Process Inputs (I) are read-only
Start AddressNumberYes0Memory address/offset (0-65535)
Bit PositionNumberNo0Bit position (0-7, only required for BIT data type)
Size (bytes)NumberNo1Number of bytes (auto-calculated based on data type) (1-65536)
Data TypeStringYesBITS7 data type: BIT, BYTE, WORD, DWORD, CHAR, STRING, WSTRING, INT, DINT, REAL, LREAL, TIMER, TIME_OF_DAY, DATE_AND_TIME, COUNTER
ValueStringYes-Value to write (format depends on data type). Examples: true (BIT), 255 (BYTE), 25.5 (REAL), Hello (STRING)

Use Cases: Set output states, write memory flags, control I/O operations, system control commands

Using Parameters

Enclose dynamic values within ((parameterName)) to expose them for validation and runtime binding.

ConfigurationDescriptionExample
TypeEnsure proper coercionnumber, boolean, string, datetime
RequiredMark critical parametersRequired / Optional
Default ValueProvide safe baseline values20.0, false
DescriptionDocument usage for collaborators"Mixing temperature in °C", "Enable discharge gate"
Siemens S7 Function Parameters

Parameter validation, defaults, and helper text for Siemens S7 functions

Pipeline Integration

Use the Siemens S7 connection functions you configure here as nodes inside the Pipeline Designer to coordinate PLC reads and writes with downstream logic. Drag in the read or write node, bind parameters to upstream outputs or constants, and fine-tune retries or operator guidance without leaving the canvas.

For orchestration blueprints that combine S7 with analytics, SQL, or notification steps, review the Connector Nodes page to understand how these nodes fit into broader automation strategies.

Siemens S7 node in pipeline designer

S7 node with connection binding and parameter configuration

Common Use Cases

Production Data Acquisition

Poll Data Blocks for production counts, cycle times, and recipe parameters, then push results to historians or ERP systems.

Supervisory Control

Deliver validated setpoints or mode changes to the PLC in response to business logic, alarms, or operator approvals.

Maintenance Diagnostics

Expose diagnostic bits, buffer alarms, or timer states to maintenance dashboards for rapid troubleshooting.