Panasonic KT2 Communication Instruction Manual page 7

Hide thumbs Also See for KT2:
Table of Contents

Advertisement

6.4 RTU mode
8-bit binary data in command is transmitted as it is.
Data format
Start bit
Data bit
Parity
Stop bit
Error detection : CRC-16 (Cyclic Redundancy Check)
Data interval
(1) Message configuration
RTU mode is configured to start after idle time is processed for more than 3.5 characters transmission
and end after idle time is processed for more than 3.5 characters transmission. (See Fig. 6.4-1)
Slave
3.5 idle
characters
address
(2) Slave address
Slave address is an individual instrument number on the slave side and is set within the range
00H to 5FH (0 to 95).
The master identifies slaves by the slave address of the requested message.
The slave informs the master which slave is responding to the master by placing its own address
in the response message.
[Slave address 00H (broadcast address) can identify all the slaves. However slaves do not respond.]
(3) Function code
The function code is the command code that makes the slave undertake the following action types(Table 6.4-1).
(Table 6.4-1)
Function code
03 (03H)
06 (06H)
A function code is used to discern whether the response is normal (acknowledgement) or if any error
(negative acknowledgement) has 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) RTU mode error check
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 a polynomial series. The remainder is added to the
end of the information and then 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
Repeat steps
: 1 bit
: 8 bits
: No parity
: 1 bit
: 3.5 characters transmission time or less
Function
code
(Fig. 6.4-1)
Reading the set value and information from slaves
Setting to slaves
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, etc)
16
3
and
4
until shifting 8 times.
Error check
Data
CRC
Contents
Contents
15
2
+ X
+ X
+ 1)
7
3.5 idle
characters
3
and the fixed
5
.

Advertisement

Table of Contents
loading

Table of Contents