Modbus, Cp control via modbus, Chapter 11: modbus – Lantronix XPORT PROTM 900-560 User Manual

Page 98

Advertising
background image

XPort Pro User Guide

98

11: Modbus

Modbus ASCII/RTU based serial slave devices can be connected via the ethernet through an
existing Modbus TCP/IP network. Any device having access to a given Modbus implementation
will be able to perform full range of operations that the implementation supports. Modbus/TCP
use a reserved TCP port of 502 and include a single byte function code (1=255) preceded by a 6
byte header:

Table 11-1

6 Byte Header of Modbus Application Protocol

CP Control via Modbus

Default groups are mapped to Modbus registers. CPs added to groups will result in the CP being
read and written based on the reading or writing to the register which maps to that CP group.
Default Modbus group names include:

Modbus_Ctl_In

Modbus_Ctl_Out

Note:

Refer to

Chapter 8: CPM: Groups on page 62

for instructions on adding a CP to a

Group.

When the Modbus slave address is set to 0xFF, the message is addressed to the internal default
groups and thus processed by the XPort Pro. The Modbus 'local slave' supported functions are
listed in the table below.

Table 11-2

Modbus Local Slave Functions - Query

Transaction ID (2 bytes)

Identification of request/response transaction - copied by slave

Protocol ID (2 bytes)

0 - Modbus protocol

Length (2 bytes)

Number of following bytes includes the unit identifier

Address (1 byte)

Identification of remove slave

Name

Number

Address
Hi [0]

Address
Lo [1]

Data Hi
[2]

Data Lo
[3]

Bytes
Count [4]

Value [5]

Read Coils

0x01

0x00

0x00-0x02

Starting CP

CP1 – CP3

0x00

0x01-0x03

No of CPs to
output

N/A

N/A

Read Input
status

0x02

0x00

0x00-0x02

Starting CP

CP1 – CP3

0x00

0x01-0x03

No of CPs to
output

N/A

N/A

Read Holding
Registers

0x03

0x00

0x00-0x02

Starting CP

CP1 – CP3

0x00

0x01-0x03

No of CPs to
output

N/A

N/A

Read Input
Registers

0x04

0x00

0x00-0x02

Starting CP

CP1 – CP3

0x00

0x01-0x03

No of CPs to
output

N/A

N/A

Advertising