Snap7

Snap7 is an open-source, 32/64 bit, multi-platform Ethernet communication suite for interfacing natively with Siemens S7 PLCs (Programmable Logic Controllers). PLCs are widely used in industrial and infrastructure automation.

Installing Snap7

pip install python-snap7

There are other ways of installing Snap7, check out here

Using Snap

In the Ubuntu Server terminal, use the command sudo Python3 to start an elevated Python interpreter.

Enter:

import snap7
s7 = snap7.server.Server()
s7.create()
s7.start()
s7.get_status()

to start a Siemens S7 simulation.