Jump to content
  • Sign in to follow this  

    PUT Command in Siemens SPS – TIA Portal Basics

       (0 reviews)

    leigehong

    In this article, we will discuss yet another way of communicating between two PLCs, whether they are in the same project or two different SPS projects. In this article, we will talk about the PUT command in Siemens SPS which can be used to send or put data from one SPS into a second SPS.

    What is the PUT Command?

    In general, the PUT command is a TIA Portal built-in function block FB that is used exclusively for S7-Family CPUs to put data from a local SPS to a remote partner SPS.

    When using the PUT command, I would have two PLCs, where I need to send data from one SPS called local to another SPS called partner.

    Some configurations must be done to the partner SPS, to enable it to be accessed by the other SPS. In addition to a Profinet connection between the PLCs.

    We will create a sample project to show how to use the PUT command.

    PUT Command in Siemens SPS

    We will assume a sample project where we have two PLCs in the same project, PLC_1 which will act as the local SPS and PLC_2 which is the partner SPS.

    We want to write an integer from the local to the partner SPS.

    Sample SPS project

    First, let’s create a new project and add the two PLCs. See picture 1.

    94-1.gif

    picture 1. Add the local and partner PLCs.

    What I need now is to configure PLC_2, the one that will receive the data to be able to receive this data. And PLC_1 will be used with the PUT command.

    The 1st thing I need to do is allow the access of the PUT command to the PLC_2 that will receive the data. See picture 2.

    94-2.gif

    picture 2. Allow PUT command access.

    As you see from the picture, we allow the PUT command to access the PLC_2 from the Properties of the PLC_2, in the Protection and Security option, click on the

    “Permit access with PUT/GET communication from the remote partner”

    Now, I am allowed to put data from any remote partner to PLC_2 using the PUT command.

    The 2nd thing is to prepare a space or memory in PLC_2 to the data that will be put in it. We will assume that we want to PUT an integer value into that SPS, so I will prepare a memory according to that. See picture 3.

    94-3.gif

    picture 3. Prepare area to receive data.

    And that is it; this is the entire configuration you need to prepare from the PLC_2 side to be able to receive data through PUT command.

    Next, we set up the data being sent from the PLC_1. We will create a data block to hold the data sent to PLC_2 and inside this data block, we will define an integer tag to be PUT into PLC_2. See picture 4.

    94-4.gif

    picture 4. Create a data block to hold the sent data.

    We defined an integer tag “SendMeToPLC_2” that we want to send to PLC_2. See picture 5.

    94-5.gif

    picture 5. Define the data to be sent.

    Note that, for PLC_1, we don’t need to allow the access with PUT command option. We activate this feature in the SPS that will receive data, not the SPS that will send it.

    Now, let’s use the PUT command in our programming, in the main OB1 we will drag and drop the PUT command FB. See picture 6.

    94-6.gif

    picture 6. Add the PUT command to OB1.

    Note that, the PUT command is found in the S7 communication folder, as it is an exclusive function for S7 family SPS, because it involves safety issues. Remember in picture 2 when we allowed the use of PUT command it was in the Security and Protection attribute of the SPS properties as it is related to SPS safety and protection.

    The PUT command is essentially a function block, so when adding it to my logic I will be asked to create a data instance. See picture 7.

    94-7.gif

    picture 7. Create a data instance for the PUT command.

    After you press OK, the PUT command is now added to your SPS logic. See picture 8.

    94-8.gif

    picture 8. PUT command

    After we added the PUT command, now we need to configure it, we have two parameters to configure for the PUT command.

    • The connection between PLCs
    • The block that will be PUT from PLC_1 to PLC_2

    To go to the configuration view of the PUT command, press the small blue icon shown in last picture.

    In the connection parameter, you will set the communication between the local (PLC_1) and partner (PLC_2) PLCs. See picture 9.

    94-9.gif

    picture 9. Connection parameter.

    As you can see, the Local PLC is set to PLC_1 which is the PLC where the PUT command is used. The partner side is still empty and that is where we should assign PLC_2.

    If you click on the drop-down list you will have two options for a partner. See picture 10.

    94-10.gif

    picture 10. Partner connection

    The partner is the SPS that will receive the data; you will find that you have two options to select from:

    • PLC_2 [CPU 1516-3 PN/DP]
    • Unspecified

    Because both PLCs are in the same project, when I choose the PLC_2 option, all connection parameters will be automatically filled in. see picture 11.

    94-11.gif

    picture 11. PLC_2 as a partner

    Wenn die Partner-SPS hingegen aus einem anderen Projekt stammt, wähle ich die Option „Nicht angegeben“ und muss in diesem Fall einige Daten wie die IP-Adresse der Partner-SPS eingeben. Siehe Abbildung 12.

    94-12.gif

    Abbildung 12. Nicht angegebener Partner

    Wie Sie sehen, muss ich in diesem Fall einige Daten wie die IP-Adresse eingeben und außerdem ein Subnetz für PLC_1 hinzufügen.

    Um ein Subnetz für PLC_1 hinzuzufügen, gehen wir zu den Profinet-Eigenschaften von PLC_1 und wählen die Option „Subnetz hinzufügen“. Siehe Abbildung 13.

    94-13.gif

    Abbildung 13. Subnetz hinzufügen.

    Sobald dies erledigt ist, ist die Konfiguration der Verbindungsparameter abgeschlossen. Siehe Abbildung 14.

    Der Verbindungsname sollte für jeden PUT-Befehl eindeutig sein. TIA Portal gibt ihm automatisch einen neuen Namen, aber es ist vielleicht besser, wenn Sie der Verbindung in Ihrem Projekt einen passenderen Namen zuweisen. Wir haben es hier so gelassen, wie es ist.

    94-14.gif

    Abbildung 14. Verbindungsparameter sind fertig

    Der nächste Schritt in der PUT-Befehlskonfiguration ist die Einrichtung der Blockparameter.

    In diesen Parametern geben wir den Auslöser für den PUT-Befehl an, d. h. welches Signal die PUT-Befehlsaktion startet. Und auch, welche Daten von PLC_1 gesendet werden und wo sie in PLC_2 gespeichert werden. Siehe Abbildung 15.

    94-15.gif

    Abbildung 15. Einrichtung der Blockparameter

    Für das Startanforderungssignal (REQ) haben wir ein Eingabetag (SendData %I0.0) definiert. Und wie bereits erwähnt, haben wir bereits das Tag definiert, das an PLC_2 gesendet wird und wo es in der SPS gespeichert wird.

    Mit dem Abschluss der Blockparameterkonfiguration wird die Konfiguration des PUT-Befehls abgeschlossen. Siehe Abbildung 16.

    94-16.gif

    Abbildung 16. Aufruf eines PUT-Befehls

    Zusammenfassend lässt sich also sagen, dass bei Auslösen des REQ-Signals die Daten in SD_1 an ADDR_1 gesendet werden.

    Sign in to follow this  


    User Feedback

    Create an account or sign in to leave a review

    You need to be a member in order to leave a review

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    There are no reviews to display.


Apply for friendship links:WhatsApp or E-mail: admin@plchmis.com
×
×
  • Create New...