python-snap7

Getting Started

  • Introduction
  • Installation
  • PLC Support Matrix

User Guide

  • Connecting to PLCs
  • Reading & Writing Data
  • Multi-Variable Read
  • Server Setup for Testing
  • Command-Line Interface
  • TIA Portal Configuration

Troubleshooting

  • Error Message Reference
  • Connection Issues
  • Thread Safety
  • Protocol Limitations and FAQ

Development

  • Development

API Reference

  • Client
  • Server
  • Partner
  • Logo
    • Logo
      • Logo.__init__()
      • Logo.connect()
      • Logo.read()
      • Logo.write()
  • Util
  • Tags
  • Optimizer
  • Logging
  • Types

Internals

  • Connection
  • S7 Protocol
  • Data Types
  • Discovery
python-snap7
  • Logo
  • View page source

Logo

class snap7.logo.Logo(**kwargs: object)[source]

A snap7 Siemens Logo client.

There are two main comfort functions available: Logo.read() and Logo.write(). This function offers high-level access to the VM addresses of the Siemens Logo just use the form:

Notes

V10.3 for bit values V10 for the complete byte VW12 for a word (used for analog values) For more information see examples for Siemens Logo 7 and 8

__init__(**kwargs: object) → None[source]

Initialize Logo client.

Parameters:

**kwargs – Ignored. Kept for backwards compatibility.

connect(ip_address: str, tsap_snap7: int, tsap_logo: int, tcp_port: int = 102) → Logo[source]

Connect to a Siemens LOGO server.

Notes

Howto setup Logo communication configuration see: https://snap7.sourceforge.net/logo.html

Parameters:
  • ip_address – IP ip_address of server

  • tsap_snap7 – TSAP SNAP7 Client (e.g. 10.00 = 0x1000)

  • tsap_logo – TSAP Logo Server (e.g. 20.00 = 0x2000)

  • tcp_port – TCP port of server

Returns:

The snap7 Logo instance

read(vm_address: str) → int[source]

Reads from VM addresses of Siemens Logo.

Examples

read(“V40”) / read(“VW64”) / read(“V10.2”)

Parameters:

vm_address – of Logo memory (e.g. V30.1, VW32, V24)

Returns:

integer

write(vm_address: str, value: int) → int[source]

Writes to VM addresses of Siemens Logo.

Parameters:
  • vm_address – write offset

  • value – integer

Returns:

0 on success

Examples

>>> Logo().write("VW10", 200) or Logo().write("V10.3", 1)
Previous Next

© Copyright 2013-2026, Gijs Molenaar, Stephan Preeker.

Built with Sphinx using a theme provided by Read the Docs.