114
If the slave receives the query without a communication error, but cannot handle it (for
example, if the request is to read a non existent register the slave will return an exception
response informing the master of the nature of the error.
Available Exception codes:
Code
Meaning
01H
Illegal
Function:
The command received in the query is not defined.
02H
Illegal
Address:
The address received in the query is not defined for the slave.
04H
Slave
Device
Failure:
Internal slave device error.
E.4.
MODBUS Modes in the CS121 M (ASCII and RTU)
MODBUS Command
The following tables contain the general command descriptions and examples with ASCII and
RTU framing.
Read Words (Functions 03h and 04h)
For the CS121 there is normally no difference between these two functions.
Query:
slave no function code address of first word
to read
word count
Checksum
LRC or CRC
1 byte
1 byte
High byte
Low byte High byte
Low byte
1 or 2 byte(s)
Answer:
slave no function code Byte count high byte
of
first
word
low byte of
first word
bytes
with
contents of n
words
Checksum
LRC or CRC
1 byte
1 byte
1 byte
1 byte
1 byte
n * 2 bytes
1 or 2 byte(s)
Example: Read Words, Function 04h, ASCII Mode
Read one word at address 63h (= 99 decimal):
Query:
Byte
1
2, 3
4, 5
6, 7
8, 9
10, 11 12, 13 14, 15 16
17
Mea-
ning
Lead-
ing
colon
Slave
num-
ber
Func-
tion
code
address of first
word to read
word count to
read
LRC
Carria
ge
return
line
feed
LF
high
byte
low
byte
high
byte
low
byte
ASCII :
0 1
0 4
0 0
6 3
0 0
0 1
9 7
<CR> <LF>
HEX
[3A]
[30][31] [30][34] [30][30] [36][33] [30][30] [30][31] [39][37] [0D]
[0A]
Answer:
Byte
1
2, 3
4, 5
6, 7
8, 9
10, 11 12, 13 14
15
Mea-
ning
leadin
g
colon
Slave
number
function
code
byte
count
content
s of the
word
LRC
carriag
e return
line
feed
LF
high
byte
low
byte
ASCII :
0 1
0 4
0 2
1 2
3 4
B 3
<CR>
<LF>
HEX
[3A]
[30][31] [30][34] [30][32] [31][32] [33][34] [42][33] [0D]
[0A]