Panasonic KT7 Instruction Manual page 5

Hide thumbs Also See for KT7:
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 for the slave to undertake the following action types (Table 6.3-1).
(Table 6.3-1)
Function code
03 (03H)
06 (06H)
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.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)
Illegal function (Non-existent function)
2 (02H)
Illegal data address (Non-existent data address)
3 (03H)
Illegal data value (Value out of the setting range)
17 (11H)
Illegal setting (Unsettable status)
18 (12H)
Illegal setting (During setting mode by keypad operation, etc)
(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) Error check of ASCII mode
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 are appended to the
end of 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) Message example of ASCII mode
1
Reading (Instrument number 1, SV)
• A request message from the master
Slave
Header
address
(3AH)
(30H 31H)
1
2
The number of data means the data item to be read, and it is fixed as (30H 30H 30H 31H).
• Response message from the slave in normal status (When SV=100 )
Slave
Header
address
(3AH)
(30H 31H)
1
2
The number of response bytes means the number of bytes of the data which has been read,
and it is fixed as (30H 32H).
Reading the set value and information from slaves
Setting to slaves
Function
Data item
code
(30H 33H)
(30H 30H 30H 31H)
2
4
(Fig. 6.3-2)
Function
Number of
response bytes
code
(30H 33H)
(30H 32H)
2
2
(Fig.6.3-3)
Contents
Contents
Number of
Error check
data
LRC
(46H 41H)
(30H 30H 30H 31H)
4
2
Error check
Data
LRC
(39H 36H)
(30H 30H 36H 34H)
4
2
5
Delimiter
(0DH 0AH)
Number of
2
characters
Delimiter
(0DH 0AH)
Number of
characters
2

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Kt4Kt8Kt9

Table of Contents