ELC500 Control unit
166
MODBUS(RTU) Communication
8.2
MODBUS(RTU) is serial communication protocol designed for programmable logic controller (PLC) by
Modicon in 1979.
●
Sends 8-bit binary data in command as is.
Data structure
Start bit
: 1 bit
Data length
: 8 bits * 7-bit data length is not available.
Parity bit
: Selectable from None, Odd, Even.
Stop bit
: 1 bit (Fixed)
Error detection
: CRC-16 (cyclic redundancy check) method
Data communication interval
: 3.5 character transmission time or more
●
Message construction
Message in RTU mode is constructed to be started from silent interval of at least 3.5 characters and
finished after silent interval of at least 3.5 characters.
Silent interval
3.5 characters
Slave
address
Function
code
Data
Error check
CRC-16
Idle
3.5 characters
8 bits
8 bits
** bits
16 bits
Data reception will be considered complete when no more data is received for the time of 4
characters, and command processing will be performed.
* Baud rate and Reception done judgment time
Baud rate (bps)
Reception done judgment time (ms.)
230400
Approx.0.20
115200
Approx.0.35
57600
Approx.0.70
38400
Approx.1.00
19200
Approx.2.00
9600
Approx.4.00
4800
Approx.8.00
2400
Approx.16.00
1200
Approx.32.00
600
Approx.64.00
300
Approx.128.00
●
Slave address
Slave addresses are device numbers for each slave unit. The setting range is 1 to 247 (01H to
F7H).
Master unit specifies slave units using each slave address of request messages.
●
Function code: Function code is code to instruct the type of operation for slave unit.
Function code
Name
Contents
01(01H)
Read Coil Status
Reads the status of coil
02(02H)
Read Input Status
Reads the input relay status.
03(03H)
Read Holding Registers
Reads holding registers.
04(04H)
Read Input Registers
Reads input registers.
05(05H)
Force Single Coil
Writes the status of single coil.
06(06H)
Preset Single Registers
Writes to holding register.
16(10H)
Preset Multiple Registers
Writes to multiple holding registers
Master unit sends an instruction (function code) to slave unit, and the slave unit responds according
to the instruction.
In case of acknowledgment, the original function code is set and returned.
In case of negative acknowledgment, 1 is set in the most significant bit of the original function code
and returned.
In case of negative acknowledgment, error codes as below are set in response message data to
inform master unit which type of error occurred.