Lantronix XPort Pro XPort Pro - User Guide - Page 98

: Modbus, CP Control via Modbus

Page 98 highlights

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 Transaction ID (2 bytes) Identification of request/response transaction - copied by slave Protocol ID (2 bytes) 0 - Modbus protocol Length (2 bytes) Address (1 byte) Number of following bytes includes the unit identifier Identification of remove slave 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. Name Read Coils Read Input status Read Holding Registers Read Input Registers Table 11-2 Modbus Local Slave Functions - Query Number 0x01 0x02 0x03 0x04 Address Hi [0] 0x00 0x00 0x00 0x00 Address Lo [1] 0x00-0x02 Starting CP CP1 - CP3 0x00-0x02 Starting CP CP1 - CP3 0x00-0x02 Starting CP CP1 - CP3 0x00-0x02 Starting CP CP1 - CP3 Data Hi [2] 0x00 0x00 0x00 0x00 Data Lo [3] 0x01-0x03 No of CPs to output 0x01-0x03 No of CPs to output 0x01-0x03 No of CPs to output 0x01-0x03 No of CPs to output Bytes Count [4] N/A N/A N/A N/A Value [5] N/A N/A N/A N/A XPort Pro User Guide 98

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154

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