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...

ความคิดเห็น • 61

  • @Abhishek_Raturi
    @Abhishek_Raturi 2 ปีที่แล้ว

    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'

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว +1

      what's your snap 7 version?

    • @Abhishek_Raturi
      @Abhishek_Raturi 2 ปีที่แล้ว

      @@endrikamarsel version 1.1

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว +1

      @@Abhishek_Raturi change to version 1.0

    • @Abhishek_Raturi
      @Abhishek_Raturi 2 ปีที่แล้ว

      @@endrikamarsel thanks. Now it's done

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว +1

      @@Abhishek_Raturi you'r welcome

  • @tainmoun2207
    @tainmoun2207 2 ปีที่แล้ว

    Thanks for your video and your enthusiasm. I will always support your videos.😀

  • @nicowalter3186
    @nicowalter3186 2 ปีที่แล้ว +2

    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?

  • @MrFabioocha
    @MrFabioocha 2 ปีที่แล้ว

    Really thanks for the video, you open a world to me

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว +2

      Siemens have a tools with name is PLCSIM Advanced, in PLCSIM Advanced you can open TCP/IP port but only in local PC

  • @theobrulux6872
    @theobrulux6872 ปีที่แล้ว

    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

  • @ucduyvo4552
    @ucduyvo4552 2 ปีที่แล้ว

    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

  • @barthollomu
    @barthollomu 3 ปีที่แล้ว

    Oh, this is just what I'm looking for! Does SNAP7 protocol work in S7-300? Thank you :)

    • @endrikamarsel
      @endrikamarsel  3 ปีที่แล้ว

      Yes, that's working. You can see snap 7 protocol compatible in website
      snap7.sourceforge.net/

  • @leonelrondon8037
    @leonelrondon8037 2 ปีที่แล้ว

    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

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว

      Yes, snap7 only work with tcp/ip communication. You can see on snap7 website

  • @taiho7504
    @taiho7504 3 ปีที่แล้ว

    Hello help!
    i'm wrong "ReadyMemmory(plc,byte,bit,datatype): then the word "bit" is not in the library.

    • @endrikamarsel
      @endrikamarsel  3 ปีที่แล้ว

      You can send your error to my email endrikamarcel@gmail.com

  • @ucduyvo4552
    @ucduyvo4552 2 ปีที่แล้ว

    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

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว

      What your snap7 version?

    • @ucduyvo4552
      @ucduyvo4552 2 ปีที่แล้ว

      @@endrikamarsel snap7 1.0

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว

      @@ucduyvo4552 can you share you'r python via email?

  • @nicowalter3186
    @nicowalter3186 2 ปีที่แล้ว

    Thanks for the Video. But unfortunately it doesn't work for me. Is it because I use "optimized block access"? Thanks for the help!

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว

      you already to enable protection block in project properties TIA Portal?

    • @nicowalter3186
      @nicowalter3186 2 ปีที่แล้ว

      @@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 :(

  • @cvg4057
    @cvg4057 2 ปีที่แล้ว

    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)

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว +1

      Hi, you can’t updating program using snap7. Snap7 just to take data from plc same like modbus protocol

    • @cvg4057
      @cvg4057 2 ปีที่แล้ว

      @@endrikamarsel is there any way other than using Simatic manager or Tia Portal for updating Siemens PLC program

  • @tainmoun2207
    @tainmoun2207 2 ปีที่แล้ว

    I want to send a data from python code to Tia portal, what should I do?

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว

      what type of data do you want to send?

  • @osmancalskan3927
    @osmancalskan3927 2 ปีที่แล้ว

    I want to send rasperry pi and opencv datas with tcpıp to the plc what should ı do

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว

      You can use python with snap7 on raspberry pi to transfer opencv datas

    • @osmancalskan3927
      @osmancalskan3927 2 ปีที่แล้ว

      @@endrikamarsel Yes ı find it but ı cant found how can ı do this can you pls help me

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว

      @@osmancalskan3927 try this simplyautomationized.blogspot.com/2014/12/raspberry-pi-getting-data-from-s7-1200.html

    • @osmancalskan3927
      @osmancalskan3927 2 ปีที่แล้ว

      @@endrikamarsel it helps to receive data from plc, send the data I need to plc in string form

  • @rostod4442
    @rostod4442 ปีที่แล้ว

    Is it possible to communicate do this with the same python script but on ubuntu?

    • @endrikamarsel
      @endrikamarsel  ปีที่แล้ว +1

      Sure

    • @rostod4442
      @rostod4442 ปีที่แล้ว

      @@endrikamarsel i was able to implement i t today, thanks for the answer

  • @sugengraharjo522
    @sugengraharjo522 2 ปีที่แล้ว

    Is it possible to convert plc program to python language?

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว

      I think possible if you’r use plc for remote I/O

  • @huyle44346
    @huyle44346 5 หลายเดือนก่อน

    Can I use the visual studio code?

  • @sherlyprastica
    @sherlyprastica ปีที่แล้ว

    Halo ka boleh training personal ga ?

  • @danteramiro9393
    @danteramiro9393 2 ปีที่แล้ว

    Hi, ¿What's 'MK'?

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว

      Hi, ‘MK’ is server areas

  • @braincrackz
    @braincrackz ปีที่แล้ว

    is this script working on s7300?

    • @endrikamarsel
      @endrikamarsel  ปีที่แล้ว

      Sure, if you’r s7 300 have ethernet communication port

  • @ABHISHEKKUMAR-wt1pw
    @ABHISHEKKUMAR-wt1pw 3 ปีที่แล้ว

    Sound?

  • @DatNguyenVanNV
    @DatNguyenVanNV 2 ปีที่แล้ว

    When I launch file python, I meet a error that snap7.exceptions.Snap7Exception: b' TCP : Unreachable peer'. Could you solute for me, please?

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว

      are you have connection with real plc or plcsim advanced?

    • @DatNguyenVanNV
      @DatNguyenVanNV 2 ปีที่แล้ว

      @@endrikamarsel i connect with PLC Sim

    • @endrikamarsel
      @endrikamarsel  2 ปีที่แล้ว

      @@DatNguyenVanNV PLC SIM or PLC SIM ADVANCED?

    • @DatNguyenVanNV
      @DatNguyenVanNV 2 ปีที่แล้ว

      @@endrikamarsel I use PLC SIM

    • @DatNguyenVanNV
      @DatNguyenVanNV 2 ปีที่แล้ว

      Is there the difference?

  • @Emili457
    @Emili457 2 ปีที่แล้ว

    please check your email I sent an information request, I'm waiting for your response