6
(Table 6.2-2)
Abnormal code
Contents
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 key operation, etc)
(4) Data
Data depends 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 abnormal 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
(Fig.
6.2-2)
The number of data means the data item to be read, and it is fixed as (30H 30H 30H 31H).
• A response message from the slave in normal status (When SV=100 )
(Fig.6.2-3)
The number of response bytes means the number of bytes of the data which has been read, and
it is fixed as (30H 32H).
• A response message from the slave in abnormal status (When non-existent data item is sent)
(Fig.
6.2-4)
The function code MSB is set to 1 for the response message in abnormal status (83H).
The abnormal code (02H: Non-existent data address) is returned as contents of error.
2
Setting (Instrument number 1, SV=100 )
• A request message from the master
(Fig.
6.2-5)
• A response message from the slave in normal status
(Fig.
6.2-6)
Slave
address
Function
code
Data item
Error check
LRC
Delimiter
Header
(30H 31H)
Number of
data
(3AH)
1
2
2
4
4
2
2
(30H 33H)
(30H 30H 30H 31H)
(30H 30H 30H 31H)
(46H 41H)
(0DH 0AH)
Number of
characters
Slave
address
Function
code
Number of
response bytes
Error check
LRC
Delimiter
Header
Data
1
2
2
2
4
2
2
(3AH)
(30H 31H)
(30H 33H)
(30H 32H)
(30H 30H 36H 34H)
(39H 36H)
(0DH 0AH)
Number of
characters
(0DH 0AH)
Slave
address
Function
code
Abnormal
code
Error check
LRC
Delimiter
Header
1
2
2
2
2
2
Number of
characters
(3AH)
(30H 31H)
(38H 33H)
(30H 32H)
(37H 41H)
Slave
address
Function
code
Data item
Error check
LRC
Delimiter
Header
(30H 31H)
Data
(3AH)
1
2
2
4
4
2
2
Number of
characters
(30H 36H)
(30H 30H 30H 31H) (30H 30H 36H 34H)
(39H 34H)
(0DH 0AH)
Slave
address
Function
code
Data item
Error check
LRC
Delimiter
Header
Data
1
2
2
4
4
2
2
Number of
characters
(3AH)
(30H 31H)
(30H 36H)
(30H 30H 30H 31H)(30H 30H 36H 34H)
(39H 34H)
(0DH 0AH)