Skip to content

Autonomy-Logic/snap7-gui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snap7-gui

A Python desktop application for communicating with Siemens PLCs using the S7Comm protocol. Built with PySide6 and python-snap7.

Features

  • Variable Configuration: Define PLC variables with name, data type, DB number, and byte/bit offset
  • Live Monitoring: Poll and display variable values in real-time
  • Read/Write Support: Toggle BOOL values or write numeric values through a simple interface
  • Configuration Persistence: Save and load variable configurations to JSON files

Supported Data Types

Type Description
BOOL Single bit (with bit offset 0-7)
BYTE Unsigned 8-bit integer
INT Signed 16-bit integer
DINT Signed 32-bit integer
REAL 32-bit floating point

Supported PLCs

  • Siemens S7-300
  • Siemens S7-400
  • Siemens S7-1200
  • Siemens S7-1500

Requirements

  • Python 3.9+
  • PLC with PUT/GET communication enabled

Installation

macOS / Linux

./setup.sh

Windows

setup.bat

The setup script will:

  1. Check for Python 3.9+
  2. Create a virtual environment in venv/
  3. Install all dependencies

Usage

macOS / Linux

./run.sh

Windows

run.bat

Manual Activation

You can also activate the virtual environment manually:

# macOS / Linux
source venv/bin/activate
python main.py

# Windows
venv\Scripts\activate
python main.py
  1. Configure Variables: Add PLC variables specifying their data type, DB number, and offset
  2. Connect: Enter the PLC IP address, rack, and slot, then click Connect
  3. Monitor: View live values as they update from the PLC
  4. Write: Toggle BOOL values or click "Write..." to set new values

PLC Configuration (S7-1200/1500)

For S7-1200 and S7-1500 PLCs, you must enable PUT/GET communication in TIA Portal:

  1. Open PLC Properties → Protection & Security
  2. Set "Full access (no protection)"
  3. Check "Permit access with PUT/GET communication from remote partner"

Additionally, for each Data Block you want to access:

  1. Right-click the DB → Properties
  2. Uncheck "Optimized block access"

Rack and Slot Values

PLC Series Rack Slot
S7-1200 0 1
S7-1500 0 1
S7-300/400 0 2

Documentation

License

MIT

About

Simple Python-based GUI app to communicate with PLCs over Siemens S7Comm protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors