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

Поділитися
Вставка
  • Опубліковано 21 січ 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 6 місяців тому +1

    Thank you so much for this helpful video

  • @chaukeoscar4295
    @chaukeoscar4295 Рік тому +1

    Very helpful video. Good job!

  • @NattapasPhongthananikorn
    @NattapasPhongthananikorn 7 місяців тому +1

    do you have an example about db_write (string) ?

  • @ptecheducation8200
    @ptecheducation8200 2 місяці тому

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

  • @walidajakkaf7678
    @walidajakkaf7678 22 дні тому

    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  19 днів тому

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

  • @kanishgakathiravan3574
    @kanishgakathiravan3574 2 роки тому

    Thank you very much for sharing details

  • @MacTeslucas
    @MacTeslucas Рік тому

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

  • @mustaphaelboukhari5124
    @mustaphaelboukhari5124 7 місяців тому

    THANK YOU SO MUCH

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

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

  • @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: ua-cam.com/video/Eo8NyNE1bRY/v-deo.html

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

  • @dogukanurkmez2154
    @dogukanurkmez2154 Рік тому

    ı have connection refused error. how can ı solve it

    • @dabrosz9404
      @dabrosz9404 8 місяців тому

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

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

  • @vanbinh1221
    @vanbinh1221 Рік тому +1

    tks Sir

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

  • @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.
      ua-cam.com/video/Eo8NyNE1bRY/v-deo.html

  • @juniorberard9611
    @juniorberard9611 Рік тому

    Did you make vidéo Tuto again?

    • @plcwars
      @plcwars  Рік тому

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

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

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

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

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

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