Questions tagged [snap7]

Snap7 is an open source, 32/64 bit, multi-platform Ethernet communication suite for interfacing natively with Siemens S7 PLCs. The new CPUs 1200/1500, the old S7200, the small LOGO 0BA7/0BA8 and SINAMICS Drives are also partially supported.

Although it has been designed to overcome the limitations of OPC servers when transferring large amounts of high speed data in industrial facilities, it scales well down to small Linux based arm or mips boards such as Raspberry PI (1 and 2) , BeagleBone Black, pcDuino, CubieBoard, UDOO and ARDUINO YUN.

Three specialized components, Client, Server and Partner, allow you to definitively integrate your PC based systems into a PLC automation chain.

See also its homepage here.

33 questions
0
votes
1 answer

Snap7 module not found with python .exe

I'm using Pycharm to create a simple program that uses snap7 lib. to read a S7-1200 PLC, it works correctly when i run it with Pycharm but when i try to run it with an .exe file it prompts this error message: Traceback (most recent call last): File…
0
votes
0 answers

Why does the Snap7 library for Python work inside the terminal but not when I try to use it in PyCharm or another IDE?

So I've been trying to install the snap7 library on a Raspberry Pi 4(buster) in order to work with it in python. However, it seems that when I try to run some commands inside the terminal: python3 import snap7 plc = snap7.client.Client() everything…
0
votes
0 answers

why does my app generated with pynsist using snap 7 dont open

Hi im trying to make a nsis installer via pynsist but i dont know how to add the snap7 library it makes the file but when i try to run my script generated by pynsist dont open the file. here is my cfg file. [Application] name=JIG Sensor…
0
votes
1 answer

Snap7 get_real command not working, how to fix?

client = snap.client.Client() client.connect('XXX.XXX.X.XXX', 0, 2) #IP address, rack, slot db = client.db_get(20) print(db) intDB = [] for i in range(1, 122): reading = client.db_read(20, i, 1) realReading = snap.util.get_real(reading,…
Zeyad
  • 1
  • 2
0
votes
2 answers

Splitting a String from byte array

I am completely new to python and PLC. I received a String from a particular tag of Siemens PLC in the byte array format like this (b'\xfe\x07Testing\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')I need to take only the String "Testing" and…
0
votes
1 answer

Siemens LOGO! PLC data in the wrong order

So I'm accessing an Siemens LOGO! PLC to extract some data from. I managed to do that with my work partner but we're stuck on how the data is being saved. The data is being timestamped in a dictionary with the output and input bytes from the PLC.…
0
votes
1 answer

Converting From a list of bits to a byte array

I am really struggling here as a new programming with a process using the snap7 library connected to a siemens PLC using Python3 on a raspberry PI. Basically I am reading in data as a byte array then modifying it and sending it back to the PLC. I am…
Kevin Lay
  • 23
  • 4
0
votes
1 answer

python snap7 on Anaconda for windows 10 - can't find snap7 library

I try to use snap7 (to read from a S7-1200) python 3.8 on Anaconda for Windows 10 .I have followed many suggestions on this issue. However, I cannot solve this problem. import snap7 plc = snap7.client.Client() Snap7Exception: can't find snap7…
titis
  • 1
  • 2
0
votes
1 answer

communciation with Fluke endurance pyrometer (profinet/RS485) via python

I have a Fluke Endurance pyrometer (and a pretty flimsy user guide) which has output via an ethernet cable which I'm then connecting to my computer via a USB3.0 to Gigabit ethernet adaptor (windows control panel tells me it's working). According to…
0
votes
3 answers

How to communicate Python with Siemens PLC using Python-snap7?

I am trying to communicate Python with the CPU1212C PLC (using PLCSIM), but an error always occurs. Code: IP = '192.168.100.100' RACK = 0 SLOT = 1 plc = snap7.client.Client() plc.connect(IP, RACK, SLOT) print(plc.get_cpu_state()) No handlers…
0
votes
1 answer

Job Pending Exception During Snap7-Python Data Read / Write to PLC

During reading and writing data to Siemens s7 1200 PLC with Python- Snap7, I get an Exception as follows: Exception in thread Thread-2: Traceback (most recent call last): File…
Mattvers
  • 46
  • 7
0
votes
0 answers

how to fix module errors in snap7

I'm trying to build a communication between a plc s7 1200 and an rpi 3, I have installed snap7 but when executing this code I get the following error: no module named snap7 This is my code: from time import sleep import snap7 from snap7.util…
0
votes
1 answer

Can't use python-snap7 on Windows

I can get Snap7 working on Linux but not on Windows using Pycharm. I get: WindowsError: [Error 193] %1 is not a valid Win32 application. I have tried Python 32 and 64 bit version using all combinations of the snap7.dll, the ones in the archives…
M.Mazur
  • 1
  • 2
0
votes
1 answer

Read string from plc using moka7

How to read string from PLC from DB560 with offset 0.0 and size 12 bytes. Garbage value is coming at the output. S7Client client = new S7Client(); client.SetConnectionType (S7.S7_BASIC); int res = client.ConnectTo("192.168.0.1", 0, 1); byte[]…
sridhar
  • 83
  • 1
  • 10
0
votes
0 answers

WRITING FROM Raspberry Pi(python program) to S7-1200 plc

I would like to request your help in writing the following variables(strings) from a Raspberry Pi(python program) to CPU S7-1200 . I have compiled and installed Snap7 python.What are the changes I need to do for writing the variables (pc, prob,Xi,…
Aravind
  • 1
  • 1