snap7-full-1.4.2 examples 里面自带c++、c、c#、delphi等例子。
pip install python-snap7
import snap7 import struct from snap7 import util # 连接 client = snap7.client.Client() client.connect('192.168.2.1', 0, 1) # 读取 # DB1.DBD100 data = client.db_read(1, 100, 4) snap7Real = util.get_real(data, 0) print(snap7Real) # 关闭 client.disconnect()