🔌

PLC TCP Connection Setup

Aug 9, 2025

Overview

This lecture explains how to establish a TCP connection between two PLCs using the TCON (transmission connection) block, focusing on setting up the connection without transferring data.

Introduction to PLC Communication

  • PLCs (Programmable Logic Controllers) can connect to other devices using network protocols like TCP, ISO, or UDP.
  • Open user communication lets PLCs connect to non-Siemens devices (e.g., PCs, printers, servers).

Setting Up the TCON Block

  • Use the TCON block to establish the communication connection between devices.
  • Each connection requires an instance data block to store the connection parameters.
  • The parameterization window configures connection parameters (partner type, IP address, connection type, etc.).
  • Possible partner types: broadcast (all devices on network), multicast (specific group), or unspecified/single partner (with given address).
  • Each new connection needs a unique data block containing remote address, port, and other info.

Connection Configuration Steps

  • Set remote IP address and select connection type (typically TCP for stability).
  • Assign a unique connection ID to each connection for later data transfers.
  • Choose active or passive connection establishment: one PLC must be active, the other passive.
  • Specify local port only for the passive (not active) partner; active partner selects a free port automatically.

Understanding Ports

  • Ports are logical communication endpoints, similar to gates at an airport.
  • Only the passive PLC needs a designated open port (e.g., port 2000) for the connection.
  • Active PLC sends data to the passive partner's open port; port selection on active side is optional.

Testing and Monitoring the Connection

  • Use a memory bit (e.g., "connect") as a trigger to attempt connection on each PLC.
  • The passive PLC should open its port and wait for the active PLC to connect.
  • Status codes (e.g., 7002 = waiting, 7000 = no job) indicate connection states and help with troubleshooting.
  • Set a "connected" memory bit when the connection is successfully established for easy monitoring.
  • Use memory reset (MRES) to clear connection data during testing.

Key Terms & Definitions

  • PLC (Programmable Logic Controller) — a digital computer used for automation of electromechanical processes.
  • TCON block — a communication block to establish network connections between devices.
  • Instance data block — storage for function block parameters and data, unique per connection.
  • TCP (Transmission Control Protocol) — a reliable, stable network protocol for data transmission.
  • Port — a logical endpoint for network communication on a device.
  • Passive/Active Partner — passive opens a port and waits; active initiates the connection.

Action Items / Next Steps

  • Practice configuring TCON blocks on two PLCs and assign correct roles (active/passive).
  • Set up and test memory bit triggers to confirm the connection establishment.
  • Review status/error codes for troubleshooting connection issues.
  • Prepare for the next lesson, which will cover exchanging data after connection is established.