×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 88781327, Entry date: 07/03/2014
(7)
Rate

How do you simulate S7 Communication between two S7-1500 CPUs using S7-PLCSIM V13?

  • Entry
  • Associated product(s)

Instructions
In STEP 7 V13 (TIA Portal) you can use S7-PLCSIM to simulate the S7-1500 CPUs.

The instructions below describe how to simulate S7 Communication and Open user communication between two S7-1500 CPUs using S7-PLCSIM.

Requirements

  1. In STEP 7 V13 (TIA Portal), you have created a project in which two S7-1500 CPUs are configured and networked.
  2. You have configured an S7 connection and a communication connection (ISO-on-TCP connection, for example) for the Open user communication between the S7-1500 CPUs.
  3. In the user program of the active S7-1500 CPU you call the "PUT" instruction to send data to the passive S7-1500 CPU.
  4. In the user program of the active S7-1500 CPU you call the "TSEND" instruction to send data to the passive S7-1500 CPU. In the passive S7-1500 CPU you call the "TRCV" instruction to receive data from the activeS7-1500 CPU.

Note
The project supplied with this entry contains the configuration of two S7-1500 CPUs including connection configuration and user program.

Procedure

  1. In the Windows Control Panel you open the "Set PG/PC interface" program.
    Select the access point "S7ONLINE (STEP 7) -> PLCSIM S7-1200/S7-1500.TCPIP.1".
    This ensures the automatic start of the download procedure when the PLCSIM starts.


    Fig. 01
     
  2. In STEP 7 V13 (TIA Portal) you open the supplied project.
  3. In the Project Tree you mark the device folder "PLC_1 [CPU 1516-3 PN/DP]". Then click the "Start simulation" button in the toolbar.


    Fig. 02
     
  4. Acknowledge the message shown below with "OK".
    All the connections to other PCs in the productive network are disconnected.


    Fig. 03
  5. S7-PLCSIM V13 opens automatically and a new project is also created automatically.
  6. Downloading to the PLC starts automatically, in other words, after creating the project, the "Extended download to device" or "Load preview" dialog opens automatically.
  7. The "Extended download to device" dialog opens automatically only if the access path to the S7-PLCSIM V13 has to be set.
    Make the following settings in the "Extended download to device" dialog to download the configuration into S7-PLCSIM V13:
    - Type of the PG/PC interface: PN/IE
    - PG/PC interface: PLCSIM S7-1200/S7-1500
    Click the "Start search" button. Under "Compatible devices in target subnet" you get a display of the S7-1500 CPU with its IP address.
    Mark the S7-1500 CPU and click the "Load" button.


    Fig. 04
     
  8. In the "Load preview" button you click the "Load" button to start the loading procedure.


    Fig. 05

    In the "Load results" dialog you click the "Finish" button to complete the load procedure.


    Fig. 06
  9. In the Project Tree you mark the device folder "PLC_2 [CPU 1516-3 PN/DP]". Then click the "Start simulation" button in the toolbar.


    Fig. 07
     
  10. Another instance of S7-PLCSIM V13 opens automatically and a new project is also created automatically.
  11. Downloading to the PLC starts automatically, in other words, after creating the project, "Load preview" dialog opens automatically.
  12. In the "Load preview" button you click the "Load" button to start the loading procedure.


    Fig. 08
     
  13. In the "Load results" dialog you click the "Finish" button to complete the load procedure.


    Fig. 09
     
  14. The PLC_1 [CPU 1516-3 PN/DP] is simulated in S7-PLCSIM in the project "Project1".


    Fig. 10
     
  15. The PLC_2 [CPU 1516-3 PN/DP] is simulated in S7-PLCSIM in the project "Project2".


    Fig. 11
     
  16. In STEP 7 V13 (TIA Portal) you set up an online connection to PLC_1 [CPU 1516-3 PN/DP]. For this you mark PLC_1 [CPU 1516-3 PN/DP] in the Project Tree. In the toolbar you click the "Go online" button.


    Fig. 12
     
  17. In a monitoring table of the active PLC_1 [CPU 1516-3 PN/DP] you monitor the value 15 in the variable "SD_Daten".Static_1 (DB2.DBW0). This value is transferred to the passive PLC_2 [CPU 1516-3 PN/DP] with the "PUT" instruction.
    In a monitoring table of the active PLC_1 [CPU 1516-3 PN/DP] you monitor the value 63.50 cm the variable "SD_Daten".Static_2 (DB2.DBW2). This value is transferred to the passive PLC_2 [CPU 1516-3 PN/DP] with the "TSEND" instruction.


    Fig. 13
     
  18. In STEP 7 V13 (TIA Portal) you set up an online connection to PLC_2 [CPU 1516-3 PN/DP]. For this you mark PLC_2 [CPU 1516-3 PN/DP] in the Project Tree. In the toolbar you click the "Go online" button.


    Fig. 14
     
  19. In a monitoring table of the passive PLC_2 [CPU 1516-3 PN/DP] you monitor the value of the the variable "ADDR_Daten".Static_1 (DB2.DBW0). If this variable also has the value 15, then the "PUT" instruction was performed successfully. The data has been transferred successfully from the active PLC_1 [CPU 1516-3 PN/DP] to the passive PLC_2 [CPU 1516-3 PN/DP].
    In a monitoring table of the passive PLC_2 [CPU 1516-3 PN/DP] you monitor the value of the the variable "ADDR_Daten".Static_2 (DB2.DBW2). If this variable also has the value 25, then the "TSEND" and TRCV" instructions were performed successfully. The data has been transferred successfully from the active PLC_1 [CPU 1516-3 PN/DP] to the passive PLC_2 [CPU 1516-3 PN/DP].


    Fig. 15

Note

  1. In the case of absolute access you disable the "Optimized block access" option in the Attributes of the data block concerned.


    Fig. 16
     
  2.  In the case of S7-1500 CPUs you must go to the device configuration and in the Properties of the CPU under Protection you enable the option "Permit access with PUT/GET communication from remote partner (PLC, HMI, OPC, ...).


    Fig. 17

Download
The download contains the project "Simulation_PUT_Get_S7_1500.zip".
Copy the "Simulation_PUT_Get_S7_1500.zip" file into a separate folder and then start the file with a double-click. You can then use STEP 7 to open and process the extracted project data.

Simulation_PUT_Get_S7_1500.zip ( 2729 KB )

Further Information
Detailed information about STEP 7 Professional V13 (TIA Portal) is available in Entry ID 89515142.

Creation environment
The screens and downloads in this FAQ were created with STEP 7 Professional V13 (TIA Portal).

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
https://www.siemens.com/cybersecurity#Ouraspiration.