Panasonic KT2 Communication Instruction Manual page 5

Hide thumbs Also See for KT2:
Table of Contents

Advertisement

(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 to undertake the following action types (Table 6.3-1).
(Table 6.3-1)
Function code
03 (03H)
Reading the set value and information from slaves
06 (06H)
Setting to slaves
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 a 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.3-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.3-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 is composed of data item, number of data and setting data.
A response message from the slave 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) ASCII mode error check
After calculating LRC (Longitudinal Redundancy Check) from the slave address to the end of data, the
calculated 8-bit data is converted to two ASCII characters and is appended to the end of the message.
How LRC is calculated
1
Create a message in RTU mode.
2
Add all the values from the slave address to the end of data. This is assumed as X.
3
Make a complement for X (bit reverse). This is assumed as X.
4
Add a value of 1 to X. This is assumed as X.
5
Set X as an LRC to the end of the message.
6
Convert the whole message to ASCII characters.
(6) ASCII mode message example
1
Reading (Address 1, PV)
• A request message from the master
The number of data indicates the data item to be read and it is fixed as (30H 30H 30H 31H).
Slave
Header
address
(3AH)
(30H 31H)
1
2
• A response message from the slave in normal status [When PV=600
The number of response bytes indicates the number of bytes of the data which has been read, and
it is fixed as (30H 32H).
Slave
Header
address
(3AH)
(30H 31H)
1
2
Contents
Contents
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)
Function
Data item
code
(30H 33H)
(30H 30H 38H 30H)
2
(Fig. 6.3-2)
Function
Number of
code
response bytes
(30H 33H)
(30H 32H)
2
(Fig.6.3-3)
Number of data
(30H 30H 30H 31H)
4
4
Data
(30H 32H 35H 38H)
2
4
5
Error check
Delimiter
LRC
(37H 42H) (0DH 0AH)
2
2
(0258H)]
Error check
Delimiter
LRC
(41H 30H)
(0DH 0AH)
2
2
Number of
characters
Number of
characters

Advertisement

Table of Contents
loading

Table of Contents