Panasonic KT7 Instruction Manual page 7

Hide thumbs Also See for KT7:
Table of Contents

Advertisement

Function code is used to discern whether the response is normal (acknowledgement) or if any error
(negative acknowledgement) is occurred when the slave returns the response message to the master.
When acknowledgement is returned, the slave simply returns the original function code.
When negative acknowledgement is returned, the MSB of the original function code is set as 1 for
the response.
(For example, when the master sends request message setting 10H to function code by mistake,
slave returns 90H by setting the MSB to 1, because the former is an illegal function.)
For negative acknowledgement, exception code (Table 6.4-2) below is set to the data of response
message and returned to the master in order to inform it that what kind of error has occurred.
(Table 6.4-2)
Exception code
1 (01H)
2 (02H)
3 (03H)
17 (11H)
18 (12H)
(4) Data
Data differs depending on the function code.
A request message from the master side is composed of data item, number of data and setting data.
A response message from the slave side is composed of number of bytes, data and exception code
in negative acknowledgement. Effective range of data is –32768 to 32767 (8000H to 7FFFH).
(5) Error check of RTU mode
After calculating CRC-16 (Cyclic Redundancy Check) from the slave address to the end of data, the
calculated 16-bit data is appended to the end of message in sequence from low order to high order.
How CRC is calculated
In the CRC system, the information is divided by the polynomial series. The remainder is added to
the end of the information and transmitted. The generation of the polynomial series is as follows.
(Generation of the polynomial series: X
1
Initialize the CRC-16 data (assumed as X) (FFFFH).
2
Calculate exclusive OR (XOR) with the 1st data and X. This is assumed as X.
3
Shift X one bit to the right. This is assumed as X.
4
When a carry is generated as a result of the shift, XOR is calculated by X of
value (A001H). This is assumed as X.
If a carry is not generated, go to step
5
3
Repeat steps
6
XOR is calculated with the next data and X. This is assumed as X.
7
Repeat steps
3
8
3
Repeat steps
9
Set X as CRC-16 to the end of message in sequence from low order to high order.
(6) Message example of RTU mode
1
Reading (Instrument number 1, SV)
• A request message from the master
3.5 idle
Slave
characters
address
(01H)
1
The number of data means the data item to be read, and it is fixed as 0001H.
• Response message from the slave in normal status (When SV=100 )
3.5 idle
Slave
characters
address
(01H)
1
The number of response bytes means the number of bytes of the data which has been read,
and it is fixed as 02H.
Illegal function (Non-existent function)
Illegal data address (Non-existent data address)
Illegal data value (Value out of the setting range)
Illegal setting (Unsettable status)
Illegal setting (During setting mode by keypad operation, etc)
16
+ X
5
4
and
until shifting 8 times.
to
5
.
5
to
up to the last data.
Function
Data item
code
(03H)
(0001H)
1
2
(Fig. 6.4-2)
Function
Number of
response bytes
code
(03H)
(02H)
1
1
(Fig. 6.4-3)
Contents
15
2
+ X
+ 1)
.
Number of
Error check
data
CRC
(0001H)
(D5CAH)
2
2
Error check
Data
CRC
(0064H)
(B9AFH)
2
2
7
3
and the fixed
3.5 idle
characters
Number of
characters
3.5 idle
characters
Number of
characters

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Kt4Kt8Kt9

Table of Contents