Siemens PLC and python communication over profinet

raghu_k

Member
Join Date
Feb 2024
Location
Metzingen
Posts
21
Hello Guys,
I want to establish profinet communication between siemens plc and my system using python programming. Which python lib can i use to have the communication or what is the way to do the following?

Note: I need profinet communication

Thank you in advance!
 
Not really, because I would like to first know which library or what is the method to have the profinet communication with plc using python script.
 
Not really, because I would like to first know which library or what is the method to have the profinet communication with plc using python script.
I would be willing to bet there is no profinet-capable module in the canonical Python ecosystem (e.g. PyPi, anaconda, etc.). So your best bet is to search Github, like I did, or ask The Google where to find such a module.

The first hit in that Github search appears to be such a module; whether it meets your needs, or even works at all, is another question entirely.
 
Hmm, I am way off base here.

First of all, there is a module that claims to talk Profinet available via Pypi and pip; see here.

Also, Profinet operates at the a MAC-address level, so I wonder if there is a Python library that actually talks Profinet (although that pnio-dcp does access a packet-capture facility, so maybe it does).

There is summat called python-snap7, but that's not using Profinet. Modbus would be another option, if you have access to the siemens plc.

[updated to add clarity and maybe correct a few (more) things ;)]
 
Last edited:
As drbitboy points out, pnio-dcp does some of the ProfiNet implementation; but it is only the DCP (Discovery and Configuration Protocol) request stuff which is the initial configuration of a ProfiNet device. There won't be a full implementation of Profinet as a library in python, you'd need to search github and then you likely won't find anything.
When I have wanted to setup stuff to a Siemens PLC I have looked to using Snap7 instead of ProfiNet. Otherwise if the Siemens PLC is new enough look to OPC/UA stuff.
 
So the short answer is no, the long answer is it's complicated. There's not many if any Python libraries out there that can talk profinet to begin with, and those libraries don't socket well at all really with other Python libraries that can communicate to PLCs, like Pycomm3, libplctag, OPC UA, and others.
that said, there's always a path to follow, you can get profinet/modbus/ethernet translators and hodge podge something together, but that sounds more like a cowboy solution than it does an engineering solution. I use Pycomm3 and Pylogix to do all of my communications between python and PLC, I'd look into their documentation to find out if they can change the network protocol, I know python-snap7 has some features that might be helpful
 
Siemens S7 plcs can have profinet communication using python-snap7, there's also the choice of switching languages and in C++'s realm, there's OpenProfinet, you could hodge podge together some weird code that switches between python's pylogix, pycomm3, python-snap7, and/or others and then translates information to C++ libraries to get the communication via OpenProfinet, this can be done with the many many C++ Python translation libraries out there, but that wildly effects your project scope
 
raghu_K. are you absolutely certain that you need real PROFINET communication ?
Is your side to be the PROFINET IO Controller, or the PROFINET IO Device ?
What are the exact requirements, other than 'it must be PROFINET' ?

Siemens S7 plcs can have profinet communication using python-snap7,
Pythons-Snap7 is S7-Protocol, not PROFINET.
 
yeah, I didn't know that, I'm not too familiar with Siemens, but it's the only one of the few PLC interactive libraries I know of, good questions though, I'm skeptical about how much profinet is really needed
 

Similar Topics

The past week we received a new piece of equipment from Germany which utilizes siemens controls. Typically in our company we use A.B. controls for...
Replies
12
Views
317
i have two plc 1. s7-1212dc/dc/dc ip; 192.168.0.1 2. s7-1500 1513-1pn ip; 192.168.3.2 i need to get data from plc1 to plc2. any idea how to do...
Replies
5
Views
127
Good morning fellow sea captains and wizards, I am being asked to do the above and obtain 4 values from each slave, I know about the MRX and MWX...
Replies
32
Views
857
Hey guys, I have to take an upload of a program on an S71200 PLC to change a hardware config option and then redownload the program with this...
Replies
3
Views
113
When you download a DB, the values get overwritten by what is in the "actual" column in offline DB. Does this happen at the start of the PLC...
Replies
6
Views
147
Back
Top Bottom