KROHNE C95 CI EN User Manual
Page 30
S
2 bytes
CRC 16
Slave
number
1 byte
1 byte
2 bytes
Function
3 or 4
CRC 16
1st word
MSB
address
LSB
Number
MSB
of words
LSB
2 bytes
2 bytes
Slave
number
1 byte
1 byte
1 byte
2 bytes
Function
3 or 4
CRC 16
Number
of bytes
read
Response pattern
:
1st word
MSB
value
LSB
2 bytes
2nd word
MSB
value
LSB
2 bytes
Slave
number
1 byte
1 byte
2 bytes
Function
16
CRC 16
1st word
address
Nbr of
words to
be enfor.
Writing of N words : Function N°16 :
Request pattern :
Value of the words
to be enforced
2 bytes
2 bytes
Number
of words
to be enf.
2 bytes
Nbr of
bytes to
be enfor.
1 byte
n bytes
Slave
number
1 byte
1 byte
1 byte
Function
16
1st word
address
Response pattern :
2 bytes
CRC 16
Slave
number
1 byte
1 byte
2 bytes
Function
6
CRC 16
Word
address
Writing of 1 word : Function N°6 :
Request pattern :
2 bytes
Value of
word to
be enfor.
2 bytes
Value of
word to
be enfor.
2 bytes
Slave
number
1 byte
1 byte
2 bytes
Function
6
Word
address
2 bytes
CRC 16
Slave
number
1 byte
1 byte
1 byte
Function
reques-
ted with
MSB=1
Error
code
Response pattern :
Exception pattern :
Values of the error codes :
1 : Function code unknown
2 : Address incorrect
3 : Data incorrect
9 : Writing impossible
Request pattern :
254
03
0 0 0 0 0 0 0 0
CRC 16
0
206
9.3 Reading in double integer format :
Example : Reading of the displayed measure
Request :
0
2
Address
Reading
of n words
Slave
number
byte 3
0 0 0 0 0 0 0 0
byte 4
0 0 0 1 0 0 11
byte 1
1 0 0 0 1 0 0 0
byte 2
0
Sign : 0 positive
1 negative
0
19
136
Number of words
254
3
4
19
•• Response with a positive measure :
136
0
CRC 16
0
Measure value :
measure
byte 1
byte 2
byte 3
byte 4
2 bytes
11111111
byte 3
11111111
byte 4
111 0 11 0 0
byte 1
0 1111 0 0 0
byte 2
Sign : 1 negative : inverting of bits and adding of 1.
Measure = byte 3 x 2563 + byte 4 x 2562+ byte 1 x 256 + byte 2
= 0 x 2563
+ 0 x 2562
+ 19 x 256
+ 136
= 5000
Reading of address 120 => decimal point = 2 => displayed meas. 50.00
254
3
4
236
•• Response with a negative measure :
120
255
CRC 16
255
measure
byte 1
byte 2
byte 3
byte 4
2 bytes
9.2 Description of born Modbus functions :
Reading of N words : Function n°3