Python Snap7 S7 Communication with PUT/GET with Siemens PLC TIA Portal

Поделиться
HTML-код
  • Опубликовано: 18 янв 2025

Комментарии • 43

  • @plcwars
    @plcwars  2 месяца назад

    Hi plcwars Community!
    I’d love your help in planning future content! Please take a moment to fill out this quick form.
    Fill out the form here: forms.gle/BBsFx7XRf7wUVEda8
    As a thank you, you’ll get a link at the end of the form to download my OPC UA Cheat Sheet - a useful guide for working with OPC UA in Python. Just complete the form, and the download link will be yours!
    I’m really proud of this OPC UA cheat sheet and excited to share it with you - creating these resources is something I genuinely enjoy!
    If you notice any mistakes or have suggestions, please let me know - your feedback helps me improve!
    Thanks for being part of the community!

  • @rezabizeh2084
    @rezabizeh2084 5 месяцев назад +1

    Thank you so much for this helpful video

  • @chaukeoscar4295
    @chaukeoscar4295 Год назад +1

    Very helpful video. Good job!

  • @kanishgakathiravan3574
    @kanishgakathiravan3574 2 года назад

    Thank you very much for sharing details

  • @NattapasPhongthananikorn
    @NattapasPhongthananikorn 7 месяцев назад +1

    do you have an example about db_write (string) ?

  • @mustaphaelboukhari5124
    @mustaphaelboukhari5124 7 месяцев назад

    THANK YOU SO MUCH

  • @vanbinh1221
    @vanbinh1221 Год назад +1

    tks Sir

  • @rjb-y4v
    @rjb-y4v Год назад

    nice tuto!! did you think make a video with siemens logo 8.3 and snap7.?

    • @plcwars
      @plcwars  Год назад

      thanks! unfortunately, I do not have access to the siemens logo

  • @juniorberard9611
    @juniorberard9611 Год назад

    Did you make vidéo Tuto again?

    • @plcwars
      @plcwars  Год назад

      What do you mean by that? I did not do it again?

  • @maxwelmagoi
    @maxwelmagoi 2 года назад

    can you do a video for larger data types such as intergers

    • @plcwars
      @plcwars  2 года назад

      Hi Maxwel, please have a look here, I hope it will be helpful.
      ruclips.net/video/Eo8NyNE1bRY/видео.html

  • @walidajakkaf7678
    @walidajakkaf7678 18 дней назад

    I have a DB that I wish to read using this code I don't have a previous knowledge in programming in python (only PLC Programming languages) i only want to read data the DATABLOCK is composed of 31 elements all of them are booleen can tou help me please

    • @plcwars
      @plcwars  16 дней назад

      for more specific support requests please write on our discord channel, it is easier to communicate there.

  • @ptecheducation8200
    @ptecheducation8200 2 месяца назад

    hi , how to get HMI active with Put/ Get . pls help

  • @MacTeslucas
    @MacTeslucas Год назад

    Do you know how I can get firmware version or software version from the plc using snap7?

  • @sigmadews5403
    @sigmadews5403 2 года назад

    Thank you for this tutorial. Can you describe the difference between snap7 and OPC UA when connecting to Siemens PLC? Is snap7 for Siemens something like ADS protocol for Beckhoff PLCs?

    • @plcwars
      @plcwars  2 года назад

      Hi! Thanks for your feedback. OPC UA is industrial standard for data exchange. (en.wikipedia.org/wiki/OPC_Unified_Architecture)
      Snap7 is something to interface directly with the S7 communication protocol which Siemens uses in theirs PLCs. (snap7.sourceforge.net/)
      I am not familiar with Beckhoff and ADS so I am not able to compare it and tell you if it is something similar.

  • @BartHoevenaars1
    @BartHoevenaars1 3 месяца назад

    does this work with a cpu ET200SP also ??

    • @plcwars
      @plcwars  3 месяца назад

      I do not know really, I do not have any experience with CPU ET200SP, but if it supports PUT/GET it might be possible

  • @rezazaimzadeh4276
    @rezazaimzadeh4276 2 года назад

    Hello. Very good video but I couldn't connect with plcsim (cpu 1200). If possible, post a video about transferring webcam video (if there is such a thing) to hmi in TIA or wincc and connecting it to s7-1200. Thank you

  • @pravinshinde640
    @pravinshinde640 2 года назад

    Thanks for the tutorial.
    Can you please tell how to write string values?

    • @radoslavklein662
      @radoslavklein662 Год назад

      def WriteMemoryChar(start_address, length, value):
      writing = plc.mb_write(start_address, length, bytearray(value.encode('utf-8')))
      print(writing)
      print('Start Address: ' + str(start_address) + ' Value: ' + value)
      ............
      charlength = 10
      chars = 'HelloWorld'
      ChartStartAddress = 104
      for i in range(charlength):
      char = chars[i]
      WriteMemoryChar(ChartStartAddress + i, 1, char)
      ...............
      In TIAPortal create smt function for moving CHARs from memory to STRING in DB..
      ...............
      Youre welcome :)

    • @obatochukwu2675
      @obatochukwu2675 Год назад

      I acn tell you how to write string send me an email

  • @tinhuynh6582
    @tinhuynh6582 2 года назад

    hi sir
    how i can contact you directly?

    • @plcwars
      @plcwars  2 года назад

      Hi Tin, you can contact me on this email: plcwarsyt@gmail.com

    • @tinhuynh6582
      @tinhuynh6582 2 года назад

      i can do it the same on s7 1200?

  • @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)

  • @alierdemkurnaz9899
    @alierdemkurnaz9899 2 года назад

    Hi.
    What should I do to change real or int instead of bool ? could you help me ?

    • @plcwars
      @plcwars  2 года назад

      Hi Ali,
      You can take a look at this link: github.com/gijzelaerr/python-snap7/blob/master/example/write_multi.py
      It is an example of reading and writing different types than boolean.
      I hope it will be helpful. Let me know how did it go!

  • @engineermahmoud4017
    @engineermahmoud4017 2 года назад

    could I use this method to communicate with s71200 DC/DC/AC?

    • @plcwars
      @plcwars  2 года назад

      Hi Mahmoud, I believe you should be able to.

  • @thatguyfromravenclaw
    @thatguyfromravenclaw 2 года назад

    Hello. Could you please tell me how to read M bit registers/addresses (Like M2.0). Thanks.

    • @plcwars
      @plcwars  2 года назад

      Hi Abhishek, please have a look at my new video: ruclips.net/video/Eo8NyNE1bRY/видео.html

  • @dogukanurkmez2154
    @dogukanurkmez2154 Год назад

    ı have connection refused error. how can ı solve it

    • @dabrosz9404
      @dabrosz9404 8 месяцев назад

      Were you able to solve it, currently having the same problem

  • @ulyssesperezii
    @ulyssesperezii 2 года назад

    Thanks or the tutorial. Any Idea why I get the error 'function refused by CPU (unknown error)'? Thanks in advance :) :)

    • @plcwars
      @plcwars  2 года назад

      Hi! thanks for your feedback!
      There could be several reasons, did you check if "optimized block access" property is turned off? Is the PUT/GET enabled? Access level should be set to full. You can have a look in the following links for some more description.
      stackoverflow.com/questions/47979438/s7-1200-snap7-exception-cli-function-refused-by-cpu-unknown-error
      sourceforge.net/p/snap7/discussion/general/thread/c9ec5278/
      I hope you will find your issue. Please let me know how it goes! ;)

  • @rjb-y4v
    @rjb-y4v Год назад

    i can buy you on for the tuto

    • @plcwars
      @plcwars  Год назад

      you can contact me here: plcwarsyt@gmail.com

  • @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)

    • @plcwars
      @plcwars  2 года назад +1

      Hi, I believe that for the downloading plc program you need dedicated software which in this case will be TIA Portal.