Python PLC Siemens Communication using Snap7 Protocol
ฝัง
- เผยแพร่เมื่อ 21 ก.ย. 2024
- Software:
Tia V15
PLCSiM Advanced V3.0
Python 3.7 (32bit)
make sure to use snap7 1.0
copy snap7.dll and snap7.lib to python folder sourceforge.ne...
Question contact to my email or my Instagram:
endrikamarcel@gmail.com
@marcel_endrika
Support:
paypal.me/Endr...
if possible please look into this whenever i am trying to run my code its giving me this error
if area not in Areas:
File "C:\Users\bhrat\AppData\Local\Programs\Python\Python38\lib\enum.py", line 310, in __contains__
raise TypeError(
TypeError: unsupported operand type(s) for 'in': 'int' and 'EnumMeta'
what's your snap 7 version?
@@endrikamarsel version 1.1
@@Abhishek_Raturi change to version 1.0
@@endrikamarsel thanks. Now it's done
@@Abhishek_Raturi you'r welcome
Thanks for your video and your enthusiasm. I will always support your videos.😀
I have an another question. In your code you’re using the “import time” library to get ever 1 second the data’s. Is there an other way not to run a code every 1 second but instead just get the new data’s if the data’s got changed?
Really thanks for the video, you open a world to me
Siemens have a tools with name is PLCSIM Advanced, in PLCSIM Advanced you can open TCP/IP port but only in local PC
I try to read data but I got the error : TypeError: unsupported operand type(s) for 'in': 'int' and 'EnumType' . My version of snap7 is 1.0
Thanks for your video a lots, can you explain where you copy snap7.dll and snap7.lib to python folder, I see in your python_program have .idea and venv, but I don't know exactly file u put. Thank you
Oh, this is just what I'm looking for! Does SNAP7 protocol work in S7-300? Thank you :)
Yes, that's working. You can see snap 7 protocol compatible in website
snap7.sourceforge.net/
Hello good evening, I would like to ask if the snap 7 works only with communication via tcp / ip? I have a s7-300 plc with a 312c cpu but it doesn't have the ip port, just a serial port with rs-485 to USB converter. Thanks in advance
Yes, snap7 only work with tcp/ip communication. You can see on snap7 website
Hello help!
i'm wrong "ReadyMemmory(plc,byte,bit,datatype): then the word "bit" is not in the library.
You can send your error to my email endrikamarcel@gmail.com
Thanks for your video but it doesn't work for me. my mistake is
ValueError: 131 is not implemented in snap7.types
how can i solve it, thanks
What your snap7 version?
@@endrikamarsel snap7 1.0
@@ucduyvo4552 can you share you'r python via email?
Thanks for the Video. But unfortunately it doesn't work for me. Is it because I use "optimized block access"? Thanks for the help!
you already to enable protection block in project properties TIA Portal?
@@endrikamarsel I think it’s because of the optimized block access. Snap7 doesn’t have implemented access data block addressed in symbolic form and “optimizes block access” gives the address a symbolic form :(
Hi, Could you please let me know if it is possible to use Snap7 for updating PLC program (I have existing program running on PLC. I have made some changes to it on another machine and i created archive of the project in another machine. Now i want to upload the archive project to PLC, is this possible using Snap7 library)
Hi, you can’t updating program using snap7. Snap7 just to take data from plc same like modbus protocol
@@endrikamarsel is there any way other than using Simatic manager or Tia Portal for updating Siemens PLC program
I want to send a data from python code to Tia portal, what should I do?
what type of data do you want to send?
I want to send rasperry pi and opencv datas with tcpıp to the plc what should ı do
You can use python with snap7 on raspberry pi to transfer opencv datas
@@endrikamarsel Yes ı find it but ı cant found how can ı do this can you pls help me
@@osmancalskan3927 try this simplyautomationized.blogspot.com/2014/12/raspberry-pi-getting-data-from-s7-1200.html
@@endrikamarsel it helps to receive data from plc, send the data I need to plc in string form
Is it possible to communicate do this with the same python script but on ubuntu?
Sure
@@endrikamarsel i was able to implement i t today, thanks for the answer
Is it possible to convert plc program to python language?
I think possible if you’r use plc for remote I/O
Can I use the visual studio code?
Sure, you can
Halo ka boleh training personal ga ?
Bisa ka
Hi, ¿What's 'MK'?
Hi, ‘MK’ is server areas
is this script working on s7300?
Sure, if you’r s7 300 have ethernet communication port
Sound?
I mute my video sound
When I launch file python, I meet a error that snap7.exceptions.Snap7Exception: b' TCP : Unreachable peer'. Could you solute for me, please?
are you have connection with real plc or plcsim advanced?
@@endrikamarsel i connect with PLC Sim
@@DatNguyenVanNV PLC SIM or PLC SIM ADVANCED?
@@endrikamarsel I use PLC SIM
Is there the difference?
please check your email I sent an information request, I'm waiting for your response