Professional Documents
Culture Documents
1 of 4
Home
About
MODBUS
fc01
fc02
fc03
fc04
fc05
fc06
fc15
fc16
ASCII
TCP
exceptions
http://www.simplymodbus.ca/ASCII.htm
Data formats
To review, we can see that each byte of data can be represented in different ways.
Binary (base2):
Decimal (base10):
10101110
2 characters 0 and 1
174
10 characters 0 through 9
16 characters 0 through F
Message Delimiting
About
Enron
MODBUS
In Modbus RTU, bytes are sent consecutively with no space in between them with a
3-1/2 character space between messages for a delimiter. This allows the software to
know when a new message is starting.
RTU Master
Any delay between bytes will cause Modbus RTU to interpret it as the start of a new
message. This keeps Modbus RTU from working properly with modems.
RTU Slave
Modbus ASCII marks the start of each message with a colon character " : " (hex 3A).
The end of each message is terminated with the carriage return and line feed
characters (hex 0D and 0A). This allows the space between bytes to be variable
making it suitable for transmission through some modems.
TCP Client
Download
Purchase
Contact
Byte Size
In Modbus RTU each byte is sent as a string of 8 binary characters framed with a
start bit, and a stop bit, making each byte 10 bits.
In Modbus ASCII, the number of data bits is reduced from 8 to 7. A parity bit is
added before the stop bit which keeps the actual byte size at 10 bits.
Split Data bytes
In Modbus ASCII, each data byte is split into the two bytes representing the two
ASCII characters in the Hexadecimal value. For example,
Modbus Mode
data (ASCII)
data (hex)
data (binary)
3/5/2015 8:56 PM
2 of 4
http://www.simplymodbus.ca/ASCII.htm
Modbus RTU
AE
1010 1110
Modbus ASCII
A,E
41 , 45
The range of data bytes in Modbus RTU can be any characters from 00 to FF.
The range of data bytes in Modbus ASCII represent only the 16 hexadecimal
characters. Therefore, every data byte in Modbus ASCII must be one of these 16:
ASCII
binary
011 0000
ASCII
hex
30
hex
38
binary
011 1000
31
011 0001
39
011 1001
32
011 0010
41
100 0001
33
011 0011
42
100 0010
34
011 0100
43
100 0011
35
011 0101
44
100 0100
36
011 0110
45
100 0101
37
011 0111
46
100 0110
hex
11
binary
0001 0001
3/5/2015 8:56 PM
3 of 4
http://www.simplymodbus.ca/ASCII.htm
03
0000 0011
00
0000 0000
107
6B
0110 1011
00
0000 0000
03
0000 0011
decimal
hex
82
binary
1000 0010
total:
130
hex
7E
-130
binary
0111 1110
hex
00
binary
0000 0000
0 3
0 0
6 B
0 0
0 3
7 E
CR LF
Each character is now treated as an ASCII character and replaced with it's hex value
to give the final message.
3A 3131 3033 3030 3642 3030 3033 3745 0D 0A
This Modbus ASCII request size is 17 bytes (170 bits)
...............
The equivalent Modbus RTU message would be:
3/5/2015 8:56 PM
4 of 4
http://www.simplymodbus.ca/ASCII.htm
11 03 00 6B 00 03 76 87
This Modbus RTU request size is 8 bytes (80 bits)
3/5/2015 8:56 PM