Profinet-Modbus Communication

Modbus Communication Between Profinet and a Modbus device!!!!!!

Thank you for reading this post, don't forget to subscribe!

After selecting and configuring the CPU, create Data Blocks as:

  • MB_Data_Read
  • MB_Data_Write

Here’s the Data Types for the parameters needed.

DATA:  (TCON_IP_v4)

This data type structure includes:

  • InterfaceID: (HW_ANY)
  • ID: (CONN_OUC)
  • ConnectionType: (Byte)
  • ActiveEstablished: (Bool)

RemoteAddress: (IP_V4)

This data type structure includes:

  • ADDR: (Array[1..4] of Byte           NOTE: we are reading 4 Byte
    • ADDR[1]: 
    • ADDR[2]:
    • ADDR[3]:
    • ADDR[4]:

Remote Port: (UInt)

LocalPort: (UInt)


Create a network for Client DB to read the data:

Search for MB_CLIENT, or

This is in: 

Communication Tab, Others, MODBUS TCP, MB_CLIENT

Set the parameters:

REQ: Desired clock frequency

Disconnect: A Tag to disconnect the client

MB MODE: (0 for Reading)

MB_DATA_ADDR: (Register address to read, 40001)

MB_DATA_LEN: (10 words)       NOTE: Specify as much as you need

MB_DATA_PTR: (P#M200.0 BYTE 20)            NOTE: Pointer for M address of 200.0 for 20 byes

CONNECT: (“MB_DATA_READ”.DATA)           NOTE: Select the Read DB from dropdown