EasyManua.ls Logo

Generex CS121BL - MODBUS Modes in the CS121 M (ASCII and RTU)

Default Icon
141 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
106
If the slave device receives the query without a communication error, and can handle the query
normally, it returns a normal response.
If the slave does not receive the query due to a communication error, no response is returned.
The master program will eventually process a timeout condition for the query.
If the slave receives the query, but detects a communication error parity, LRC, or CRC, no
response is returned. The master program will eventually process a timeout condition for the
query.
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.
D.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-
leadin
Slave
function
byte
content
LRC
carriag
line

Table of Contents

Related product manuals