Siemens S7-1200 and S7-1500 PLC Data Communication via S7 Protocol: GET and PUT Instructions Explained

Learn how to configure and use GET and PUT instructions for Siemens S7-1200 and S7-1500 PLCs to read and write data using the S7 protocol. Detailed examples and best practices.

Siemens S7-1200 and S7-1500 PLC Communication via S7 Protocol

In industrial automation, the Siemens S7-1200 and S7-1500 PLCs are widely used for data exchange through the S7 Protocol. The GET and PUT instructions are essential for transferring data between these PLCs. These instructions facilitate the reading and writing of data blocks between different PLCs in a network. In this article, we’ll explore how these instructions work, using detailed examples to guide you through their configuration and usage within Siemens TIA Portal.

1. Understanding GET and PUT Instructions

The GET and PUT instructions are integral to Siemens PLC communication. They enable data to be read (GET) or written (PUT) between S7-1200 and S7-1500 PLCs, which are typically used in networked automation systems.

  • GET Instruction: The GET instruction is used to read data from a remote PLC (server) and transfer it to the local PLC (client).
  • PUT Instruction: The PUT instruction is used to send data from the local PLC (client) to a remote PLC (server).

2. Example Setup: S7-1500 as Client, S7-1200 as Server

For this example, we will configure a communication between an S7-1500 PLC (acting as a client) and an S7-1200 PLC (acting as a server).

2.1 Hardware and Software Setup

  • Hardware:
    • S7-1500 CPU (as client)
    • S7-1200 CPU (as server)
  • Software:
    • TIA Portal (used for programming and configuring the PLCs)
  • Communication Objective:
    • S7-1500 will send 2 bytes of data from DB2 to S7-1200‘s QB data block.
    • S7-1500 will read 2 bytes of data from S7-1200‘s VB data block into its own DB3.

3. PUT Instruction Configuration and Example

3.1 Configuring the Network Connection

To begin, you must configure the network connection between the S7-1500 and S7-1200 in TIA Portal:

  • Define the IP addresses, subnet mask, and other necessary parameters for both PLCs.
  • Create an S7 connection that designates the S7-1500 as the client and S7-1200 as the server.

3.2 Adding the PUT Function Block

In TIA Portal, add the PUT function block to the S7-1500’s program:

  • Assign the connection ID, target address (i.e., the QB data block in S7-1200), and specify the data length.

3.3 Writing the Logic

Within the main program (OB1) of the S7-1500:

  • Use the CALL instruction to trigger the PUT function block.
  • Set up a trigger condition, such as a timer or counter, to initiate the data transfer.
  • Monitor the status of the PUT function block to ensure that the data is successfully written to the S7-1200.

4. GET Instruction Configuration and Example

4.1 Configuring the Network Connection

Just like the PUT instruction, ensure that the network connection is correctly configured between the S7-1500 and S7-1200 PLCs.

4.2 Adding the GET Function Block

In the S7-1500’s program:

  • Add a GET function block.
  • Configure the parameters such as the connection ID, source address (i.e., the VB data block in S7-1200), and the data length.

4.3 Writing the Logic

Within the main program (OB1) of the S7-1500:

  • Use the CALL instruction to trigger the GET function block.
  • Set a trigger condition, which could either match or differ from the PUT function block.
  • Monitor the status of the GET function block to ensure that data is correctly retrieved from S7-1200 and stored in DB3 of the S7-1500.

5. Important Considerations

When working with the GET and PUT instructions, it’s crucial to keep several considerations in mind to ensure smooth communication:

5.1 Correct Connection IDs and Addressing

Ensure that the connection ID is accurately configured and that the target and source addresses are valid within the respective PLCs’ memory.

5.2 Real-time Data Communication

PLC communication, especially in industrial settings, needs to be real-time and reliable. Ensure that the system is configured to handle any potential latency or data loss issues.

5.3 Error Handling and Status Monitoring

Adding error handling routines and status monitoring logic is essential. This can help identify and address any issues that arise during the communication process.

6. Optimizing Data Communication in S7-1200 and S7-1500

While configuring GET and PUT instructions, you may also consider the following optimization strategies:

  • Buffering: Use buffering techniques to reduce communication delays and ensure data integrity.
  • Optimized Data Types: When transferring data, choose the most efficient data types (e.g., use byte rather than word when possible) to minimize communication load.
  • Network Configuration: Ensure that the network topology and devices are optimized for maximum throughput and minimal delays.

Efficient Data Communication Between S7-1200 and S7-1500

By following the steps outlined above for GET and PUT instructions, you can successfully establish data communication between Siemens S7-1200 and S7-1500 PLCs using the S7 Protocol. Whether you’re writing data to remote PLCs or reading data from them, this setup offers a reliable and efficient way to handle inter-PLC communication in industrial automation systems.

With careful configuration, monitoring, and error handling, you can ensure that your Siemens PLC communication is both stable and effective. Whether you’re setting up for simple data transfers or more complex control logic, mastering the GET and PUT instructions in TIA Portal is a critical step in optimizing your automation network.