FabyaVisionUser Manual
/

Siemens S7 driver

17 min readCommunication

PLC settings, connection steps, automatic switchover to the backup PLC and common errors for connecting to S7-1500, S7-1200 and S7-300 / 400 CPUs via PUT/GET and reading and writing tags with absolute addresses (DB, M, I, Q).

When to use it

Three drivers (Siemens S7-1500, Siemens S7-1200, Siemens S7-300 / 400) use the same protocol: S7 communication, PUT/GET, TCP port 102. Tags are given with an absolute address (DB1.DBX0.0, MW20). The S7-1500 and S7-1200 drivers carry the same set of parameters, addresses and data types; only their IDs differ (s7-1500, s7-1200). The S7-300 / 400 driver has no LReal and SInt types, and its default slot is 2.

In redundant systems with two CPUs, the connection can be set up to communicate with the CPU that is master (Automatic switchover to the backup PLC).

If the data block has Optimized block access enabled (symbolic) or if you need secure communication, this driver is not suitable; use the OPC UA driver.

Prerequisites on the PLC side

  1. Allow PUT/GET access

    The CPU properties must allow access by a remote partner through PUT/GET communication (in TIA Portal: CPU properties › Protection and security › Connection mechanisms; menu names may vary depending on the TIA version). If it is off, the CPU rejects the requests and Live reports a PUT/GET error.

  2. Turn off "Optimized block access" in the data block

    Optimized block access must be cleared in the properties of every data block you want to read, so that the byte addresses of the variables are fixed. Recompile the block and load it to the CPU. Take the bit, byte and word addresses from the Offset column of the block.

  3. Find out the rack and slot number

    On the S7-1200 / 1500, the CPU is in rack 0, slot 1. On the S7-300 it is in slot 2. On the S7-400, take the rack and slot number in which the CPU is installed from the hardware configuration.

  4. Network access

    The Live computer and the PLC must be on the same network, and any firewall between them must allow TCP port 102.

Setting up a connection

  1. Add a connection

    In the Connections section, click Add and, as the Communication driver, select the S7 driver that matches your CPU.

  2. Address and port

    Enter the IP address of the CPU in the IP address / computer name cell. The port remains 102.

  3. Rack and slot

    In the Inspector, enter the Rack (0 – 7) and Slot (0 – 31) fields. Slot tooltip: The slot the CPU is plugged into: 2 for S7-300, 1 for S7-1200 / 1500.

  4. Add a tag

    In the HMI tags section, create tags bound to this connection. The address cell validates the address as you type and shows its resolution below the cell (Tag addresses).

    Tags of the PLC_Proses connection: bit, word and double word addresses are written according to the type; the address resolution of the selected tag is shown in the Inspector.1234
    Tags of the PLC_Proses connection: bit, word and double word addresses are written according to the type; the address resolution of the selected tag is shown in the Inspector.
    1. Connection — the PLC connection the tag is bound to.
    2. Data type — determines the size letter of the address.
    3. Address — absolute S7 address (DB30.DBD2).
    4. Address resolution — the resolution of the address or an error.
  5. Test

    Online›Test connections… only shows that TCP port 102 is open; the S7 session and the PUT/GET permission are tried only in Live, when a tag is read (Connection diagnostics).

Address and data type notes

  • The size letter must match the type: Bool → DBX / M10.3, Byte and SInt → DBB / MB, Int and UInt → DBW / MW, DInt, UDInt and Real → DBD / MD.
  • Long types (LReal, String, WString, DateTime) take no size letter; the start byte is given in the form DB1.DBX24.0 (DBB is also accepted). These types can be held only in a data block and in the bit memory area.
  • String has the STRING[n] format of the PLC (2 byte header + n characters, Windows-1254 encoding). The Length field of the tag is the maximum number of characters to read (default 32, maximum 254); it must be the same as the definition in the PLC. A text longer than the maximum length in the PLC cannot be written.
  • WString occupies 2n + 4 bytes as UTF-16.
  • DateTime is read as DTL (12 bytes) on S7-1200 / 1500 and as DATE_AND_TIME (8 bytes) on S7-300 / 400.
  • The address is not case-sensitive and may start with %; the German notations E (input) and A (output) are also accepted.
  • Tags that are close to each other (with a gap of at most 32 bytes in the same area) are read in a single request; the read is split into multi-variable requests according to the PDU size negotiated with the PLC.

Automatic switchover to the backup PLC

In the three S7 drivers, a second CPU address can be given to a connection. Live connects to both CPUs, reads and writes only with the CPU that is master, and switches to the other CPU automatically when the master changes or the connection to the active CPU is lost. Use: redundant systems in which each CPU has its own IP address (S7-1500R/H), or two separate PLCs kept in sync by the PLC program. This feature is not available in other drivers. Redundancy of the Live computer is a separate topic: Redundant server pair.

Prerequisites

  • Both CPUs must have the same data blocks at the same addresses; in both, PUT/GET access must be permitted and optimized block access must be off.
  • Port, rack, slot and CPU type are the same for both CPUs (the values of the connection are used).
  • Live writes only to the master CPU. Keeping the data of the backup CPU in sync is the job of the PLC: on an S7-1500R/H the operating system does this; with two separate PLCs your PLC program must do it.

Settings

  1. Enable the backup PLC

    With the connection selected, switch on Backup PLC (automatic switchover) on the parameter card in the Inspector.

  2. Enter the address of the backup CPU

    Backup PLC IP address: the IP address or computer name of the second CPU. It cannot be the same as the main address.

  3. Select how the master information is read

    Master detection and Master information address (default DB1.DBX0.0); the options are in the table below.

  4. Enter the check interval

    Master check interval (s) 1 – 60 (default 2): the master information is read again at this interval, and reconnecting to an unreachable CPU is retried.

    An S7-1500 connection with the backup PLC on: backup address, master bit and two addresses on the Target card.123456
    An S7-1500 connection with the backup PLC on: backup address, master bit and two addresses on the Target card.
    1. Backup PLC (automatic switchover) — when enabled, connections are made to both CPUs.
    2. Backup PLC IP address — the second CPU; port, rack and slot are the same as for the main PLC.
    3. Master detection — how the master CPU is determined.
    4. Master information address — Bool in bit mode, Int in number mode.
    5. Master check interval (s) — interval at which the master information is read again.
    6. Target — main address and backup address together.
Master detectionHow it works
Master bit (read from both PLCs)The Bool at the same address is read in both CPUs; the one with value 1 is master. If both are 1, Live stays on the current CPU (both PLCs report master); if both are 0, it also stays on the current CPU (no PLC is master).
Primary CPU number (1 = main, 2 = backup)An Int is read: if it is 1, the CPU at the connection's address (main) is master; if it is 2, the CPU at the backup address is master. On S7-1500R/H, write the output of the RH_GetPrimaryID instruction to this address in the PLC program and check that the CPU numbers match the IP addresses. The value is read from the active CPU first and, if it cannot be read there, from the other one; a value other than 1 and 2 counts as invalid master number.
Reachability only (main PLC preferred)No master information is read and the address is not used. As long as the main CPU can be reached, it is used; if it cannot be reached, Live switches to the backup. While on the backup, if the main CPU responds in two consecutive checks, Live switches back to the main CPU.

What happens during the switchover

  • The connections to both CPUs are kept open; a closed one is reopened in the background and does not delay reading from the active CPU.
  • If the master changes while both CPUs are reachable, Live starts reading from the other CPU without dropping the connection. If the PDU sizes of the two CPUs differ, the connection is briefly re-established.
  • If the connection to the active CPU is lost, the connection briefly shows No connection; the normal reconnection (after 1 s) selects the CPU that can be reached. Writes waiting in the queue at that moment are rejected, and the tags briefly have bad quality.
  • If the master is unknown or the master CPU cannot be reached, Live stays on the current CPU (if there is none, on the main one, and if that is not available either, on the backup) and writes the reason in the information line (— the master PLC cannot be reached, — master information could not be read).

Monitoring in Live

In the Connections section of the system menu, the CPU being communicated with is shown below the connected redundant connection. This information appears only in Live's own system menu; it is not available in the browser viewer or in the PLC connection status object.

System menu: PLC_Proses is communicating with the backup CPU, PLC_Hammadde with the main CPU (example state).
System menu: PLC_Proses is communicating with the backup CPU, PLC_Hammadde with the main CPU (example state).

When the CPU changes, a system entry is written to the event log: PLC_Proses: switched to the backup PLC (192.168.10.22) or … switched to the main PLC (…); if a warning occurs on the same CPU (such as both PLCs report master), it is written as well. Lines S7 yedek PLC (PLC_Proses): … are written to the program log (logs\Live_yyyyMMdd.log).

In Studio, the Target card shows both addresses together. Online›Test connections… tests only the main address.

Driver reference

The parameter, address format and example tables below are generated from the driver definition in Studio. For S7-1200, the S7-1500 section applies.

Siemens S7-1500

"Permit access with PUT/GET" must be enabled on the CPU; "Optimized block access" must be disabled in the data block. Optimized (symbolic) blocks are accessed with the OPC UA driver.

Driver ID
s7-1500 (name in the project file)
Connection
An IP address / computer name and a port are required (default port 102)
Data types
Bool Byte SInt Int UInt DInt UDInt Real LReal String WString DateTime

Connection parameters

Appears in the Inspector window when a connection is selected.

ParameterTypeDefaultDescription
Racknumber (0 – 7)0
Slotnumber (0 – 31)1The slot the CPU is plugged into: 2 for S7-300, 1 for S7-1200 / 1500.
Backup PLC (automatic switchover)on / offoffBoth CPUs are connected; communication runs with whichever one is master. When the master changes or the connection drops, it switches to the other one automatically.
Backup PLC IP addresstext—IP address of the second CPU. Port, rack and slot are the same as for the main PLC.
Master detectionchoiceMaster bit (read from both PLCs)Master bit: the bit at the same address in both PLCs; the one with value 1 is the master. Primary CPU number: the Int to which the output of RH_GetPrimaryID is written on the S7-1500R/H. Reachability only: Live connects to the main PLC, to the backup if the main PLC cannot be reached, and switches back when the main PLC returns.
Master bit (read from both PLCs) · Primary CPU number (1 = main, 2 = backup) · Reachability only (main PLC preferred)
Master information addresstextDB1.DBX0.0Bool for the master bit (DB1.DBX0.0, M10.0), Int for the primary CPU number (DB1.DBW0). Not used when "Reachability only" is selected.
Master check interval (s)number (1 – 60)2The master information is read again at this interval; reconnecting to an unreachable CPU is retried.
Arbiter address (Int)text—In a redundant server pair the master writes an incrementing counter to this address every second. It must be a writable Int address not used for anything else in the PLC program. Empty = this PLC is not an arbiter.

Address formats

FormatMeaning
DBn.DBXb.iData block bit — Bool
DBn.DBBbByte — Byte, SInt
DBn.DBWbWord — Int, UInt
DBn.DBDbDouble word — DInt, UDInt, Real
DBn.DBXb.0Long types (LReal, String, WString, DateTime): start byte
Mb.i MBb MWb MDbMemory
Ib.i IBb IWb IDbInput (E can also be written)
Qb.i QBb QWb QDbOutput (A can also be written)

Sample addresses

Data typeExamples
BoolDB1.DBX0.0   M10.3   I0.0   Q4.1
ByteDB1.DBB2   MB10   IB0   QB4
SIntDB1.DBB3   MB11
IntDB1.DBW4   MW20   IW64   QW80
UIntDB1.DBW4   MW20   IW64   QW80
DIntDB1.DBD8   MD30
UDIntDB1.DBD8   MD30
RealDB1.DBD12   MD40
LRealDB1.DBX16.0
StringDB1.DBX24.0
WStringDB1.DBX280.0
DateTimeDB1.DBX60.0

Siemens S7-300 / 400

The S7-300 / 400 family has no LReal type.

Driver ID
s7-300 (name in the project file)
Connection
An IP address / computer name and a port are required (default port 102)
Data types
Bool Byte Int UInt DInt UDInt Real String DateTime

Connection parameters

Appears in the Inspector window when a connection is selected.

ParameterTypeDefaultDescription
Racknumber (0 – 7)0
Slotnumber (0 – 31)2The slot the CPU is plugged into: 2 for S7-300, 1 for S7-1200 / 1500.
Backup PLC (automatic switchover)on / offoffBoth CPUs are connected; communication runs with whichever one is master. When the master changes or the connection drops, it switches to the other one automatically.
Backup PLC IP addresstext—IP address of the second CPU. Port, rack and slot are the same as for the main PLC.
Master detectionchoiceMaster bit (read from both PLCs)Master bit: the bit at the same address in both PLCs; the one with value 1 is the master. Primary CPU number: the Int to which the output of RH_GetPrimaryID is written on the S7-1500R/H. Reachability only: Live connects to the main PLC, to the backup if the main PLC cannot be reached, and switches back when the main PLC returns.
Master bit (read from both PLCs) · Primary CPU number (1 = main, 2 = backup) · Reachability only (main PLC preferred)
Master information addresstextDB1.DBX0.0Bool for the master bit (DB1.DBX0.0, M10.0), Int for the primary CPU number (DB1.DBW0). Not used when "Reachability only" is selected.
Master check interval (s)number (1 – 60)2The master information is read again at this interval; reconnecting to an unreachable CPU is retried.
Arbiter address (Int)text—In a redundant server pair the master writes an incrementing counter to this address every second. It must be a writable Int address not used for anything else in the PLC program. Empty = this PLC is not an arbiter.

Address formats

FormatMeaning
DBn.DBXb.iData block bit — Bool
DBn.DBBbByte — Byte, SInt
DBn.DBWbWord — Int, UInt
DBn.DBDbDouble word — DInt, UDInt, Real
DBn.DBXb.0Long types (LReal, String, WString, DateTime): start byte
Mb.i MBb MWb MDbMemory
Ib.i IBb IWb IDbInput (E can also be written)
Qb.i QBb QWb QDbOutput (A can also be written)

Sample addresses

Data typeExamples
BoolDB1.DBX0.0   M10.3   I0.0   Q4.1
ByteDB1.DBB2   MB10   IB0   QB4
SIntDB1.DBB3   MB11
IntDB1.DBW4   MW20   IW64   QW80
UIntDB1.DBW4   MW20   IW64   QW80
DIntDB1.DBD8   MD30
UDIntDB1.DBD8   MD30
RealDB1.DBD12   MD40
LRealDB1.DBX16.0
StringDB1.DBX24.0
WStringDB1.DBX280.0
DateTimeDB1.DBX60.0

Common errors

The marker at the start of each line tells where the message will appear in Live: [connection] in the Connections section of the system menu; [write] in the notification window of the operator who performed the write; [Studio] in the address cell in Studio. [tag] is a tag error during reading: the tag is left with bad quality, the text of the message is not shown in Live in this version (Tag errors); read the text to understand the cause.

MessageCause and solution
[connection] Cihaz 2000 ms içinde yanıt vermedi (192.168.10.20:102). IP adresini ve ağ bağlantısını kontrol edin.The TCP connection to the port cannot be established: IP address, network, cable or firewall.
[connection] S7 bağlantısı açılamadı (…, rack 0 / slot 1): … CPU tipini, rack / slot numarasını ve CPU'da PUT/GET erişim iznini kontrol edin.The CPU was reached but the S7 session did not open: wrong driver (CPU type), rack / slot or PUT/GET permission.
[connection] Ana PLC'ye de yedek PLC'ye de bağlanılamadı. Ana PLC: … Yedek PLC: …The backup PLC is on and neither CPU can be reached; the message states the reason for each CPU.
[connection] Yedek PLC: master bilgisi adresi "…" geçersiz. …The master information address does not match the mode (Bool in bit mode, Int in number mode).
[Studio] Backup PLC is on but the backup PLC's IP address is not entered (connection parameters › Backup PLC IP address). · Yedek PLC'nin IP adresi ana PLC ile aynı (…). İkinci CPU'nun adresini yazın.Problems list. In this case Live runs the connection as a single PLC.
[tag] The PLC rejected the request: "Permit access with PUT/GET communication from remote partner" is not enabled in the CPU. and The PLC rejected the request (PUT/GET access may be disabled in the CPU).PUT/GET permission is disabled. Enable the CPU setting and load it to the CPU.
[tag] The PLC denied access (PUT/GET access must be enabled in the CPU and "Optimized block access" must be disabled in the block).The data block uses optimized access. Turn off optimized access or use OPC UA.
[tag] The data block does not exist in the PLC.The DB number in the address does not exist in the PLC.
[tag] The address is outside the area (the data block in the PLC is shorter).The byte address is greater than the length of the data block.
[connection] The PLC did not respond (timeout). / Connection to the PLC lost (network, cable, or the PLC may be switched off).The connection was established but dropped; the driver retries automatically.
[write] Metin PLC'deki STRING[32] alanına sığmıyor (40 karakter).The text written is longer than the string in the PLC.
[Studio] Int tipi word (2 bayt) adresi ister; "DB1.DBX0.0" bir bit adresidir.In Studio the address does not match the type; the address cell shows this message and does not accept the value.

Tips

Related topics

FabyaVision 1.2.1 User Manual · 2 November 2026© Fabyatek Yazılım Bilişim Teknolojileri Ltd. Şti.