Modbus TCP Server

Introduction

Modbus TCP is not based on a hierarchical structure, but on a client/server model.

Without any configuration, the embedded Ethernet port of the bus coupler supports Modbus server.

Modbus TCP Server

The Modbus server supports the Modbus requests:

Function Code

Dec (Hex)

Subfunction

Dec (Hex)

Function

3 (3)

Read holding register (%MW)

6 (6)

Write single register (%MW)

16 (10)

Write multiple registers (%MW)

22 (16)

-

Mask write register

23 (17)

Read/write multiple registers (%MW)

43 (2B)

14 (E)

Read device identification

Modbus TCP Configuration

To configure your TM3 Ethernet bus coupler as a Modbus TCP slave device, add the bus coupler and select Modbus TCP IO Scanner > TM3BCEIP.

Diagnostic Request

This table contains the data selection code list:

Data Selection Code (hex)

Description

00

Reserved

01

Basic Network Diagnostics

02

Ethernet Port Diagnostic

03

Modbus TCP/Port 502 Diagnostics

04

Modbus TCP/Port 502 Connection Table

05 - 7E

Reserved for other public codes

7F

Data Structure Offsets

TM3 Bus Coupler Modbus TCP Registers

Zone

Access

Registers

Function

Diagnostic Zone

RO

900 - 901

Bus coupler diagnostics

RO

930 - 931

TM2/TM3 bus status

RO

932

System state

RO

991 - 992

Communication diagnostics

RO

1058...1066

Ethernet communication parameters

RO

1100...1115

TM3 bus coupler product information

RO

2512 - 2513

TM3 bus coupler product serial number

IO Scanner Zone

RO

1...99

Subset of bus coupler module input values (first 7 modules)(1)

RW

101...199

Subset of bus coupler module output values (first 7 modules)(1)

RO

3001...3499

Bus coupler module input values (all modules)(1)

RW

3501...3999

Bus coupler module output values (all modules)(1)

RO

13001...13499

Bus coupler module input values (all modules) for use with HMI devices.

RO

13501...13999

Bus coupler module output values (all modules) for use with HMI devices.

(1)   Access to those registers return an error when System State (register 932) is not 5 (TM3 bus controlled by modbus TCP).

Bus Coupler Diagnostics

Registers

Function

Description

900

Island status

Bits (0...8]): Not used

Bit (9): I/O bus runtime error

Bits (10-11): Not used

Bit (13): I/O bus not configured or bus configuration error

Bits (14-15): Not used

901

I/O modules status

Bit (0...13): Status of first expansion module to status of 14th expansion module

Bits (14-15): Not used

0: No error detected

1: Error detected

TM2/TM3 Bus Status

Registers

Function

Description

930-931

TM2/TM3 bus status

Bits (0...27) module status (2 bits by module):

o0x0: Module OK

o0x1: Module configuration error detected

o0x2: Module runtime error detected

o0x3: Module not present but it is optional module

Bits (30-31) bus status:

o0x0: Bus OK

o0x1: Bus configuration error detected

o0x2: Bus runtime error detected

o0x3: Bus not configured

System State

Registers

Function

Description

932

State of the system

o0x0: System is booting.

o0x: TM3 bus is not configured.

o0x: A TM3 configuration is being transferred.

o0x3: A valid TM3 configuration has been applied successfully. The outputs are set to 0.

o0x4: TM3 bus is controlled by EIP.

o0x5: TM3 bus is controlled by ModbusTCP IO scanner.

o0x6: TM3 bus is controlled by Web server.

o0x7: Timeout on fieldbus refresh

o0x8: Firmware update in progress

o0xA: System state transition in progress.

Communication Diagnostic

Registers

Function

Description

991

Number of received messages

Number of messages received.

992

Number of sent messages

Number of messages sent.

Ethernet Communication Parameters

Registers

Function

1058

MAC address

1059

1060

1061

IP address currently used

1062

1063

Subnet mask currently used

1064

1065

Gateway currently used

1066

TM3 Bus Coupler Bus Coupler Product Information

Registers

Function

1100

TM3 bus coupler product code

2507-2508

TM3 bus coupler product firmware version

2512-2513

TM3 bus coupler product serial number

2601

Rotary switch ONEs position

2602

Rotary switch TENs position