ModbusTCP/UDP protocol

The Ethernet protocol is addressed by means of the MAC-ID. The user does not normally need to be concerned about this address. The IP number has a length of 4 bytes, and must be parameterized by the user on the Bus Coupler and in the application. In ModbusTCP, the TCP port is set to 502. The UNIT can be freely selected under ModbusTCP, and does not have to be configured by the user.

ModbusTCP/UDP protocol 1:
ModbusTCP/UDP protocol stack

ModbusUDP

Modbus UDP can also be used instead of ModbusTCP with some products. The port number usually remains the same. Very little changes for the user.

The advantages of ModbusUDP are that it is in most cases simpler to use and usually somewhat faster than a TCP/IP connection.

The advantages of ModbusTCP are the more secure data transmission with repetitions already built in as well as further typical advantages that a TCP/IP connection features.

TCP port number

The TCP port number for ModbusTCP has been standardised to 502.

Modbus-Unit

The unit is returned by the slave.

ModbusTCP Protocol

Byte

Name

Description

0

Transaction identifier

Is returned by the slave

1

Transaction identifier

Is returned by the slave

2

Protocol identifier

always 0

3

Protocol identifier

always 0

4

Length field

0 (if the message is less than 256 bytes in length)

5

Length field

Number of following bytes

6

UNIT identifier

returned by the slave

7

Modbus

Modbus protocol with the function follows