Modbus Rtu Protocol PDF
Modbus Rtu Protocol PDF
U p d a t e d: February 1, 2011
file_V1.0
Update 12.2015
[email protected]
Communication protocol between xLogic and
HMI
1. Communication Mode
RTU mode
Addres Functio Data Data 1 ... Data CRC low-order CRC high-order
s n code Numb n byte byte
er
Baud rates:9600
Data bit:8
Stop bit:1
Checkout mode: Non parity checking
RTU Framing
When the slave responds to the master, it uses the function code field to
indicate either a normal (error–free) response or that some kind of error
occurred (called an exception response). For a normal response, the
slave simply echoes the original function code. For an exception
response, the slave returns a code that is equivalent to the original
function code with its most–significant bit set to logic 1.
Data Field
The data field is constructed using sets of two hexadecimal digits, in the
range of 00 to FF hexadecimal. These can be made from a pair of ASCII
characters, or from one RTU character, according to the network’s serial
transmission mode.
The data field of messages sent from a master to slave devices contains
additional information which the slave must use to take the action
defined by the function code. This can include items like discrete and
register addresses, the quantity of items to be handled, and the count of
actual data bytes in the field.
The data field can be nonexistent (of zero length) in certain kinds of
messages. For example, in a request from a master device for a slave to
respond with its communications event log (function code 0B
hexadecimal), the slave does not require any additional information.
Bit Order(RTU)
PR-24(CPU):0~13
PR-E-16(EXT1):16~23
PR-E-16(EXT2):24~31
PR-E-16(EXT3):32~39
∙
∙
PR-E-16(EXT9):80~87
PR-E-16(EXT10):88~95
∙
∙
PR-E-16(EXT15):128~135
PR-E-16(EXT16):136~143
4 cursors
(Cursor key) BIT R
C1-C4: 256~259
Type:(1x)
MODBUS code:
02
Digital outputs BIT R/W
EXM-12/ELC-12(CPU):0~7
EXM-E-8(EXT1):8~15
EXM-E-8(EXT2):16~23
(0x) EXM-E-8(EXT3):24~31
∙
MODBUS code: ∙
01(read) EXM-E-8(EXT7):56~63
05 EXM-E-8(EXT8):64~71
(single Write)
PR-6(CPU):0~1
15
PR-12(CPU):0~3
(Multiple Write)
PR-18(CPU):0~5
PR-E-16(EXT1):8~15
PR-E-16(EXT2):16~23
PR-E-16(EXT3):24~31
∙
∙
PR-E-16(EXT9):72~79
PR-E-16(EXT10):80~87
PR-E-16(EXT11):88~95
PR-E-16(EXT12):96~103
∙
∙
PR-E-16(EXT15):120~127
PR-E-16(EXT16):128~135
PR-24(CPU):0~9
PR-E-16(EXT1):10~17
PR-E-16(EXT2):18~25
PR-E-16(EXT3):26~33
∙
∙
PR-E-16(EXT9):74~81
PR-E-16(EXT10):82~89
∙
∙
PR-E-16(EXT15):122~129
PR-E-16(EXT16):130~137
Middle coil PR-6&Economic PR-12 BIT R
Series:256~319
Standard EXM-12/
ELC-12 Series:256~767
(0x)
(0x)
PR-12/ELC-22 Series:256~767
MODBUS code: PR-18/PR-24 Series:256~1279
01(read)
PR-12-E series:
1536~1567
15
(Multiple Write)
REG LONG R/W
PR-18/PR-24 Series:0~1023
Holding register(timer、
counter value) PR-6/Economic PR-12 Series:
0~63
(4x)
(4x)
MODBUS code:
03(read)
16(Multiple Write)
Analog input EXM-12/ELC-12 Series: Signed R
(1024~1279) short
CPU:1024~1031
EXT1:1032~1039
(4x) EXT2:1040~1047
…………
ELC-22/26 Series
CPU :1024~1031
EXT1:1032~1039
EXT2:1040~1047
…..
EXT9:1096~1103
PR-6 Series:
1024~1027
PR-12 Series:
1024~1027
PR-18/24 Series:
CPU:1024~1031
EXT1:1032~1039
EXT2:1040~1047
…..
EXT9:1096~1103
…..
EXT15:1144~1151
EXT16:1152~1159
Analog output Signed R/W
ELC-22/PR-18/PR-24 Series: short
CPU:1280~1281
EXT1:1282~1283
EXT2:1284~1285
(4x)
…..
EXT9:1298~1299
…..
MODBUS code: EXT15:1310~1311
03(read) EXT16:1312~1313
16(Multiple Write)
Analog quantity buffer PR-6&Economic PR-12 Signed R
Series:1536~1599 short
EXM-12/ELC-12 Series:
1536~2047
PR-12 Series:1536~2047
PR-18/PR-24
Series:1536~2559
(4x)
MODBUS code:
03(read)
EXM-12/ELC-12 Series
(4x) PR-12/PR-18/PR-24Series:
3072~3327
MODBUS code:
03(read)
06
(Single Write)
16(Multiple Write)
HEG for block Word R
EXM-12/ELC-12 Series:
The frequency value 2560~3071
buffer of threshold
trigger
PR-12 Series:2560~3071
PR-18/PR-24 Series:
HEG0-HEG511:2560--3071
Data latching Relay
HEG512 - HEG1023:
19456--19967
(4x)
MODBUS code: PR-6 Series:
03(read) 2560--2623
16(Multiple Write)
RTC All ELC series CPU Signed R/W
(4x) short
Year:3328
MODBUS code: Month:3329
03(read) Day:3330
Hour:3331
Minute:3332
16(Multiple Write) Second:3333
On the upper table host address range and xLogic Max address range are
the same, and also different series plc has different address range, hence
user shall voluntarily pay more attention to host address range of the
PLC being used. In case host address of communication order/command
exceeds the address range of PLC being used, then such PLC would
respond to ERROR 4 (illegal address), and simultaneously such
command/order would not be executed by PLC being used.
Note:
1. 10 milliseconds would be regarded as the unit of Time for writing
to the HMI.
2. One second would be regarded as the unit of Time for reading
from the HMI.
3. The default address of xLogic is 1.
4. The total number of address being accessed should less than the
above table showing .
Length of
Order
message(one
code(Hex Function description Remarks
frame order can
)
deal with)
01 Read one group coil status -- Read Coil Status
(00000~0XXXX) (Output relay)
02 Fetch one group data of the -- Read input Status
status of switch input (input relay)
(10000~1XXXX)
03 Read data of multi-holding -- Read Holding
register(40000~4XXXX) Registers
(Output
register)
05 Force the switch status of single 1 Force Single Coil
coil(00000~0XXXX)
06 Pre-set the data of single 80 Set single output
register register
(40000~4XXXX)
15 Force multi-coils on/off data many
(00000~0XXXX)
16 Write multi-holding registers
data(40000~4XXXX)
19~4F Reserve
RTU Format
Note1:In data field, one byte stands for BIT (1 means ON, 0 means OFF). One
byte (00 ~FF) would be used to represent “char” type register parameters. The
“int” type register parameter can be expressed with two bytes (0000~FFFF). 4
bytes (00 00 00 00 ~ FF FF FF FF) can stand for “long” type register parameter.
The high-order byte is appended first, followed by the low-order byte.
Note2: The Max length of command/order message sent to PLC by host can not
exceed 80 bytes, otherwise PLC will not execute such order, also without
responding to such command/order message, furthermore, host cannot allow
the Max length of responding message from PLC to exceed 80 bytes, otherwise,
PLC would return to ERROR 3 (command/order cannot be executed.)status.