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
3
votes
3 answers

can't find snap7 library - linux

I'm running Rapbian on a Raspberry Pi Revision B. I downloaded the module python-snap7 as instructed on this webpage: Snap7 Installation I tried it twice: One time using pip and another doing it manually. However, I installed it then via setup.py…
FlixMa
  • 944
  • 1
  • 7
  • 20
2
votes
4 answers

python snap7 windows - can't find snap7 library

i try to install snap7 (to read from a S7-1200) with it's python-snap7 0.4 wrapper but i get always a traceback with the following simple code. from time import sleep import snap7 from snap7.util import * import struct plc =…
Lavalu
  • 83
  • 1
  • 1
  • 8
1
vote
1 answer

Read the spindle speed in a SIEMENS PLC s7 300 with python snap7

I would like to read the spindle speed of a Siemens PLC 317-2DP with NCU 720.2. To do that, I use the python snap 7 library. I managed the connexion to the PLC, but I would like to read the spindle speed with the function read_area(area: Areas,…
Aux98
  • 23
  • 3
1
vote
1 answer

How to install snap7 in Python virtual environment and use Pyinstaller

I'm trying to create an executable file from my Python application with Pyinstaller, so I've created a virtual environment and I've installed all the required packages. I have also installed snap7 wrapper with the command pip install…
nicc96
  • 313
  • 2
  • 16
1
vote
2 answers

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

I used pycharm for writing my code and plcsim for simulatio. When I run my code and run plcsim I get an error. I used Tia portal V16 and s7-1200 and I want to communicate between S7-1200 and python-snap7 This is the error: PS…
bader
  • 11
  • 2
1
vote
0 answers

ROS CPP Snap7 Linux - CMake does not link against lib

I would like to use Snap7 ( Multi-platform Ethernet S7 PLC communication suite) to establish a communication between ROS and a Siemens S7 1500. I encountered a linker problem - Although I can find the includes and the library .so file itself,…
TwoBit01
  • 11
  • 2
1
vote
2 answers

How can I write data to int value in plc with Python

my code: import snap7.client as s7 ip = '192.168.0.7' rack = 0 slot = 1 data_blok = 100 start_adress = 0 size = 260 try: plc = s7.Client() plc.connect(ip, rack, slot) con = plc.get_connected() print(f"Bağlantı Durumu: {con}") …
Adem Ülker
  • 27
  • 1
  • 6
1
vote
0 answers

Write bit to PLC using DBWrite doesn't give the right result (result = 3145782)

I have a Siemens S7-1212 AC/DC/Rly PLC and i want communicate with a C# application using Snap7. I have successfully made a connection to the PLC in the UI and i can even successfully write values to the PLC. Sometimes however (1 in 3 times) the…
Theo Tromp
  • 23
  • 4
1
vote
0 answers

Snap7-python Windows 7 64 bit

I try to install snap7 to communicate with s7-1200. I downloaded latest package (1.4.1) I cannot find dll that specified for 64 bit windows OS. I used pip3 command to install it and everything was fine. I wrote this simple code with PyQt5 and snap7…
Dogan Cignakli
  • 77
  • 1
  • 10
1
vote
2 answers

Try to read data from plc s7 1200 with snap 7 and get the wrong string

I try to read data from datablock (DB60), but I get only ?5. So in data block should be JAMES17. private void button1_Click(object sender, EventArgs e) { if (button1.Text == "Connect PLC") { …
James Cass
  • 13
  • 1
  • 5
0
votes
1 answer

Troubles with python .exe file and snap7

OS: Windows 10 python: 3.11.3 snap7: vb6 i was triying to make a exe file with my python code,this code only take plc data base info and shows in a gui, the python code works fine, but when i run the exe file it shows the next message: …
0
votes
1 answer

I am trying to run an exe file generated by PyInstaller, but I am getting the following error:

I am creating an executable using pyinstaller. My project includes multiple python files, and I am trying to create a single executable that runs the main.py file. I am working with python snap7 to read data from PLC…
MG7702
  • 17
  • 3
0
votes
1 answer

Checking connection with PLC Snap7 Python

I made a program in Python with Snap7 library. I can read and write different variables without any problem. To finish it I need to check the communication with the PLC all the time. I checked I can use "get_connected()", but this works as I want…
0
votes
0 answers

byte array index out of range - python PLC

I am communicating data between PLCs using python snap7. the data in the PLC is byte.bit addressable. I am trying to read a boolean with an address of M110.7. M meaning internal memory byte=110 bit=7. I am using the mb_read function to get the byte…
MG7702
  • 17
  • 3
0
votes
0 answers

bytearray index out of range - Python snap7

I am using python snap7 to communicate data between PLCs and am having trouble reading from an integer. The snap7 get_int function works with the following parameters (byteArray, byteIndex). However, when I pass the bytearray into the function it…
MG7702
  • 17
  • 3
1
2 3