12: M
ODBUS
ASCII/RTU C
OMMUNICATION
FC5A M
ICRO
S
MART
U
SER
’
S
M
ANUAL
FC9Y-B1268
12-15
Communication Protocol
This section describes the communication frame format used for Modbus communication. ASCII mode and RTU mode
use different communication frame formats.
Communication Frame Format
ASCII Mode
Request from Modbus Master
“:”
Slave No.
Function Code
Data
LRC
CR LF
1 byte
2 bytes
2 bytes
2 bytes
2 bytes
ACK Reply from Modbus Slave
“:”
Slave No.
Function Code
Data
LRC
CR LF
1 byte
2 bytes
2 bytes
2 bytes
2 bytes
NAK Reply from Modbus Slave
“:”
Slave No.
Function Code
+ 80H
Error Code
LRC
CR LF
1 byte
2 bytes
2 bytes
2 bytes
2 bytes
2 bytes
RTU Mode
Request from Modbus Master
Idle
3.5 characters
Slave No.
Function Code
Data
CRC
Idle
3.5 characters
1 byte
1 byte
2 bytes
ACK Reply from Modbus Slave
Idle
3.5 characters
Slave No.
Function Code
Data
CRC
Idle
3.5 characters
1 byte
1 byte
2 bytes
NAK Reply from Modbus Slave
Idle
3.5 characters
Slave No.
Function Code
+ 80H
Error Code
CRC
Idle
3.5 characters
1 byte
1 byte
1 byte
2 bytes
Note:
Idle means no data flowing on the communication line.
Communication Frame Format
ASCII mode finds the beginning of a frame by the “:” code. While the MicroSmart is receiving an incoming request mes-
sage and at the same time receives a “:” code, the MicroSmart discards the received data and waits for a slave number.
RTU mode requires a minimum of 3.5-character-long idle time between frames to determine the beginning of a frame.
The MicroSmart Modbus master sends requests at idle intervals of 5 ms, which can be changed by storing a required
value to special data register D8054.
Slave No.
The MicroSmart can be assigned slave numbers 1 through 31 (or 247 on CPU modules with system program version 110
or higher). In the 1:1 communication using RS232C, the same slave number must be set in the master and the
MicroSmart.
Slave No. 0 is reserved for broadcast slave number and is used to clear all device data in the slave, or the MicroSmart. In
this case, the MicroSmart does not send a reply to the master.
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]