Table of Contents

Advertisement

12.6 Modbus protocol

12.6.1 Transmission mode
There are 2 transmission modes (ASCII and RTU) in Modbus protocol.
12.6.2 ASCII mode
Hexadecimal (0 to 9, A to F), which is divided into high order (4-bit) and low order (4-bit) out of 8-bit binary
data in command is transmitted as ASCII characters.
Data format
Error detection : LRC (Longitudinal Redundancy Check)
Data interval
(1) Message configuration
ASCII mode message is configured to start by Header [: (colon)(3AH)] and end by Delimiter [CR (carriage
return) (0DH) + LF (Line feed)(0AH)].
Header
(:)
address
Slave address
Slave address is an individual instrument number on the slave side and is set within the range 0 to 95
(00H to 5FH).
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 0 (00H, broadcast address) can identify all the slaves connected. However slaves do not
respond.
Function code
The function code is the command code for the slave to undertake the following action types.
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 the function code by mistake, slave
returns 90H by setting the MSB to 1, because the former is an illegal function.
For negative acknowledgement, the exception codes below are set to the data of the response message
and returned to the master in order to inform it of what kind of error has occurred.
Exception code
1 (01H)
2 (02H)
3 (03H)
17 (11H)
18 (12H)
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 a number of bytes, data and exception code in
negative acknowledgements.
The number of data to be dealt with in one message is "1". Therefore the number of data is fixed as
(30H)(30H)(30H)(31H).
Effective range of data is -32768 to 32767 (8000H to 7FFFH).
Error check: 2-character data to detect communication errors. Refer to "(2) Error check of ASCII mode".
Start bit : 1 bit
Data bit : 7 bits
Parity
: Even (No parity, Odd) Selectable
Stop bit : 1 bit (2 bits) Selectable
: 1 second or less
Slave
Function
code
Contents
Reading the set value and information from slaves
Setting to slaves
Contents
Illegal function (Non-existent function)
Illegal data address (Non-existent data address)
Illegal data value (Value out of the setting range)
Illegal setting [Status unable to be set (e.g. during AT)]
Illegal setting (During setting mode by key operation)
Error check
Data
LRC
47
Delimiter
Delimiter
(CR)
(LF)

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Kt4b

Table of Contents