Skip to content

S7

Classic S7 talks to Siemens PLCs by byte: a memory area, a start address and offsets within that range. It is the only option for an S7-300 or S7-400; it works on an S7-1200/1500 too, but there S7 Plus needs less upkeep.

Port 102, client role only.

  • Siemens S7-300
  • Siemens S7-400
  • Siemens S7-1200
  • Siemens S7-1500
Connection (IP, port, rack, slot) Device / Frame (Data Block — S7 memory area) / Variable (address + data type) Connection (IP, port, rack, slot) Device Frame (Data Block — S7 memory area) Variable (address + data type)
ParameterExampleDescription
ProtocolS7Protocol selection
IP Address192.168.1.1PLC IP address
Port102S7 port (default: 102)
Rack0PLC rack number (default: 0)
Slot0PLC slot number (0 for S7-1200/1500, 2 for S7-300/400)
Timeout5000 msConnection timeout duration
Connection TypeS7_BASICConnection type
TypeDescription
PGProgramming device connection
OPOperator panel connection
S7_BASICStandard S7 connection (default)
ParameterExampleDescription
Scan Time1000 msScan period
Scan TypePERIODICPERIODIC or FIXED_DELAY
ParameterExampleDescription
TypeDBMemory area type (see below)
Start Address0Starting byte address
Quantity100Number of bytes to read
DB Number8Datablock number (for DB and DI types only)
TypeDescriptionUsage
DBDataBlock (Peripheral I/O) AreaMost common — Global Data Block
DIDataBlock AreaInstance Data Block
DB_LOCALDataBlock (local) AreaLocal Data Block
MKMarker (Flags) AreaMarker area (M)
PEPE (Inputs) Instance AreaInput area (I)
PAPA (Outputs) Instance AreaOutput area (Q)
TMS7 Timer AreaTimer
CT_INPUTSS7 Counter AreaCounter
SYS_INFOSystem InformationSystem information
SYSTEM_FLAGSS7 CountersSystem flags
TM_IECIEC Counters (200 Family)IEC counters
TM_VIEC Timers (200 Family)IEC timers
ANALOG_INPUTSAnalog Inputs (200 Family)Analog input
ANALOG_OUTPUTSAnalog Outputs (200 Family)Analog output
ParameterExampleDescription
Start Address0Byte offset within the frame
Bit Offset0Bit offset (for BIT type, 0-7)
TypeREALS7 data type
Max Len0Maximum length for string variables
Data TypeSizeDescription
BIT1 bitSingle bit (Bool) — accessed via Bit Offset
BYTE8 bitUnsigned 8-bit integer
WORD16 bitUnsigned 16-bit integer
INT16 bitSigned 16-bit integer
DWORD32 bitUnsigned 32-bit integer
DINT32 bitSigned 32-bit integer
REAL32 bit32-bit floating point (Float)
LREAL64 bit64-bit floating point (Double)
DATETIME8 byteDate and time
S7STRINGVariableS7 string format
S7WSTRINGVariableS7 wide string format

S7 addressing is byte and bit based. Variable addresses are calculated relative to the start address of the Frame:

Frame: DB8, Start Address: 0, Quantity: 100 DB8.DBX0.0 → Start: 0, Bit Offset: 0, Type: BIT (first bit) / DB8.DBX0.1 → Start: 0, Bit Offset: 1, Type: BIT (second bit) / DB8.DBB2 → Start: 2, Type: BYTE (3rd byte) / DB8.DBW4 → Start: 4, Type: WORD (5th-6th byte) / DB8.DBD8 → Start: 8, Type: REAL (9th-12th byte) / DB8.DBD12 → Start: 12, Type: DINT (13th-16th byte) Frame: DB8, Start Address: 0, Quantity: 100 Variable examples: DB8.DBX0.0 → Start: 0, Bit Offset: 0, Type: BIT (first bit) DB8.DBX0.1 → Start: 0, Bit Offset: 1, Type: BIT (second bit) DB8.DBB2 → Start: 2, Type: BYTE (3rd byte) DB8.DBW4 → Start: 4, Type: WORD (5th-6th byte) DB8.DBD8 → Start: 8, Type: REAL (9th-12th byte) DB8.DBD12 → Start: 12, Type: DINT (13th-16th byte)

Some settings need to be configured on the PLC side for communication with the S7 protocol. These settings apply to TIA Portal V12 and later versions.

The S7 protocol works with the PUT/GET mechanism, and this is the setting that decides everything: while the permission is off, the CPU accepts the connection and answers its identity, but refuses every data service, including reads and writes.

  1. Go to the CPU Properties section in TIA Portal
  2. In the Protection & Security tab
  3. Enable (check) the “Permit access with PUT/GET communication from remote partner” option

The PLC access level must be configured to allow external communication:

  1. Go to the CPU Properties section in TIA Portal
  2. Open the Protection & Security tab
  3. Set the Access Level to “Full access (no protection)”

On S7-1200 and S7-1500 PLCs, the optimized block access feature of Global DBs is enabled by default. In an optimized block the variables have no fixed byte offsets, so the S7 protocol’s byte-based addressing cannot reach them. This feature must be disabled on the DBs inSCADA will communicate with:

  1. Double-click the relevant DB (Data Block) in TIA Portal
  2. Open the DB’s Properties window
  3. In the Attributes tab, uncheck the “Optimized block access” option
  4. Save the DB and download to the PLC

The order matters — top to bottom:

#SettingLocationStatus
1PUT/GET permissionCPU Properties → Protection☐ Enabled
2Access LevelCPU Properties → Protection☐ Full access
3Optimized block accessDB Properties → Attributes☐ Disabled

The Minutes Offset parameter applies a minute-based offset to timestamps read from the PLC. For example, if the PLC runs in UTC time and inSCADA needs to display local time:

  • For UTC+3 (Turkey): 180 (3 hours × 60 minutes)
  • To set the time back, use a negative value: -60 (1 hour back)
  • Default: 0 (no offset)

The Frame’s scan period is calculated by multiplying the Device’s Scan Time value:

Frame Scan Time = Device Scan Time × Scan Time Factor

For example, if Device Scan Time = 1000 ms and Frame Scan Time Factor = 5, this frame is scanned every 5 seconds. For slow-changing data, increasing the factor reduces unnecessary communication overhead.