MICROSMART COMMUNICATION PROTOCOL
This document describes communication commands for the MicroSmart micro programmable controller.
Table of Contents |
|
Communication Command List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
. 1 |
Communication Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
. 2 |
Message Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
2 |
Request Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
3 |
Receive Timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
4 |
Reply Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
5 |
Write User Program in ASCII Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
7 |
Write User Program in Binary Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
9 |
Read User Program in ASCII Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
11 |
Read User Program in Binary Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
13 |
Write N Bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
15 |
Read N Bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
18 |
Write 1 Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
21 |
Read 1 Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
23 |
Read Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
25 |
Clear Operand Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
29 |
Enable/Disable User Program Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
31 |
Read PLC Operating Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
33 |
Read Scan Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
34 |
Read PLC System Program Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
35 |
Read Timer Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
36 |
Read Counter Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
38 |
Read Timer Preset Value Change Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
40 |
Read Counter Preset Value Change Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
42 |
Read Timeout Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
44 |
Read Countout Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
45 |
Confirm Changed Timer/Counter Preset Values . . . . . . . . . . . . . . . . . . . . . . . . . . . |
46 |
NG Code and Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
47 |
Operand Allocation Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
48 |
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
49 |
www.idec.com
MICROSMART COMMUNICATION PROTOCOL
All communication commands available for the MicroSmart, OpenNet Controller (ONC), MICRO3, and MICRO3C are summarized in the table below. Some of the commands are the same as for different PLCs, with increased operands and operand number ranges.
Command Name |
MicroSmart |
ONC |
MICRO3C |
MICRO3 |
Write User Program in ASCII Format |
X |
X |
X |
X |
|
|
|
|
|
Write User Program in Binary Format |
X |
X |
X |
X |
|
|
|
|
|
Read User Program in ASCII Format |
X |
X |
X |
X |
|
|
|
|
|
Read User Program in Binary Format |
X |
X |
X |
X |
|
|
|
|
|
Write N Bytes |
X |
X |
X |
X |
|
|
|
|
|
Read N Bytes (Note) |
X |
X |
X |
X |
|
|
|
|
|
Write 1 Bit |
X |
X |
X |
X |
|
|
|
|
|
Read 1 Bit |
X |
X |
X |
X |
|
|
|
|
|
Read High-speed Counter Preset and Current Values |
|
X |
X |
X |
|
|
|
|
|
Read Error Code |
X |
X |
X |
X |
|
|
|
|
|
Clear Operand Data |
X |
X |
X |
X |
|
|
|
|
|
Enable/Disable User Program Protection |
X |
X |
X |
X |
|
|
|
|
|
Read PLC Operating Status |
X |
X |
X |
X |
|
|
|
|
|
Read Scan Time |
X |
X |
X |
X |
|
|
|
|
|
Read PLC System Program Version |
X |
X |
X |
X |
|
|
|
|
|
Read User Communication Transmit/Receive Buffer |
|
X |
X |
|
|
|
|
|
|
Clear and Start User Communication Data Monitor |
|
|
X |
|
|
|
|
|
|
Read User Communication Status |
|
X |
X |
|
|
|
|
|
|
Read Communication Mode |
|
X |
|
|
|
|
|
|
|
Select Word Operands for Monitor |
|
X |
|
|
|
|
|
|
|
Monitor Selected Word Operands |
|
X |
|
|
|
|
|
|
|
Read Timer Information |
X |
X |
|
|
|
|
|
|
|
Read Counter Information |
X |
X |
|
|
|
|
|
|
|
Read Timer Preset Value Change Status |
X |
X |
|
|
|
|
|
|
|
Read Counter Preset Value Change Status |
X |
X |
|
|
|
|
|
|
|
Read FUN Area Settings |
|
X |
|
|
|
|
|
|
|
Read Random Words |
|
X |
|
|
|
|
|
|
|
Read Timeout Status |
X |
|
|
|
|
|
|
|
|
Read Countout Status |
X |
|
|
|
|
|
|
|
|
Confirm Changed Timer/Counter Preset Values |
X |
|
|
|
|
|
|
|
|
Note: When timer/counter preset or current values are read out from the MicroSmart using the read N bytes command, the result is different from that read from the MICRO3 because the MicroSmart has different timer and counter internal codes to enable 16-bit timers and counters. The MicroSmart has new commands for timers and counters; Read Timeout Status and Read Countout Status.
MICROSMART |
1 |
MICROSMART COMMUNICATION PROTOCOL
The computer and the MicroSmart CPU module communicate data by sending and receiving communication messages, which consist of request messages and reply messages. The request message is sent from the computer to write data to, read or clear data from the MicroSmart. The reply message is sent from the MicroSmart in response to the request message from the computer.
Communication is always initiated by the computer by sending a request message to the MicroSmart, which then returns a reply message to the computer. The MicroSmart cannot initiate communication in the computer link system. The MicroSmart can initiate communication using the user communication function.
|
Request Message |
|
Computer |
MicroSmart |
|
CPU Module |
||
|
||
|
Reply Message |
Communi- |
|
|
|
|
|
|
|
BCC (Block Check Character) Calculation Range |
|
|
|
|
|
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cation |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Message |
|
(1) |
|
(2) |
|
|
|
|
|
|
|
|
|
(3) |
|
|
|
|
|
|
|
|
|
(4) |
(5) |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Communication |
|
|
|
|
|
|
ENQ (05h) |
|
Enquiry |
|
Request message |
||||||||||||||||
(1) |
control |
|
|
Message start |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
ACK (06h) |
|
Acknowledge |
|
|
|
|
|
||||||||||||||||||
character |
character |
|
|
|
Reply message |
|
||||||||||||||||||||||
|
|
NAK (15h) |
|
Negative acknowledge |
|
|
||||||||||||||||||||||
|
(1 byte) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
00 (0) |
|
|
Designates a PLC device number to which the com- |
|||||||||||||
|
|
|
|
|
|
|
Device number to |
|
through |
|
puter sends a request message in the 1:N communi- |
|||||||||||||||||
|
|
|
|
|
|
|
|
1F (31) |
|
cation computer link system. |
|
|
|
|
|
|||||||||||||
|
Communication |
send request to |
|
|
|
|
|
|
|
|||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
(2) |
|
FF (255) |
|
Used in the 1:1 communication computer link system. |
||||||||||||||||||||||||
device number |
|
|
|
|
|
|
|
|||||||||||||||||||||
|
|
|
|
|
|
|
PLC of any device number receives request message. |
|||||||||||||||||||||
|
(2 bytes) |
|
|
|
|
|
|
|
|
|
|
|||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
Device number to |
00 (0) |
|
|
Indicates the device number of the PLC which returns |
|||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
||||||||||||||||||||
|
|
|
|
|
|
|
|
through |
|
|||||||||||||||||||
|
|
|
|
|
|
|
send reply from |
|
|
the reply message. |
|
|
|
|
|
|||||||||||||
|
|
|
|
|
|
|
|
1F (31) |
|
|
|
|
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
Data |
|
|
Communication |
|
Depends on each command. |
|
|
|
|
|
|||||||||||||||||
|
|
command, |
|
See “Request Messages” on page 3. |
|
|
|
|
|
|||||||||||||||||||
(variable length) |
|
|
|
|
|
|
||||||||||||||||||||||
|
data type, etc. |
|
See “Reply Messages” on page 5. |
|
|
|
|
|
||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
BCC |
|
|
Block check |
|
Exclusive OR (XOR) of the BCC calculation range. |
|
|||||||||||||||||||||
(2 bytes) |
character |
|
|
|||||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
Terminator |
Message |
|
CR (0Dh) |
|
Default |
|
|
|
|
|
|||||||||||||||||
(1 byte) |
|
|
end code |
|
|
|
|
|
|
|
||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MICROSMART |
2 |
MICROSMART COMMUNICATION PROTOCOL
Like the ONC or MICRO3, request messages are available in request message 1 and request message 2 with different data structures.
Request Message 1
Request message 1 is a command message to be sent from the computer to the PLC, containing a command. The data type code included in the request message determines the function. The data structure of request message 1 is shown below.
Request |
|
ENQ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
05h |
Device |
(1) |
|
(2) |
(3) |
|
|
|
|
|
|
|
(4) |
|
|
|
|
|
|
|
|
|
|
BCC |
|
Termi- |
|
||
Message 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nator |
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
Continuation |
0 (30h) |
Discontinued (no message follows) |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||
(1 byte) |
1 (31h) |
Continued (another message follows) |
|
|
|
|
|
|
|
|
|
|||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Command |
W (57h) |
Write data to PLC |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||
(2) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
R (52h) |
Read data from PLC |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||||
(1 byte) |
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
C (43h) |
Clear data from PLC |
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
X (58h) |
Input |
|
|
|
|
|
|
t (74h) |
Timer |
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(current value) |
|
|
|
|
|||||||
|
|
|
|
|
|
Y (59h) |
Output |
|
|
|
|
|
|
|
|
|
|
N-byte |
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Counter |
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c (63h) |
|
designation |
|||||||||
|
|
|
|
|
|
M (4Dh) |
Internal relay |
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
(current value) |
|
|||||||||||||||||
|
|
|
|
|
|
|
N-byte |
|
|
|
|
|
|
|
|
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
R (52h) |
Shift register |
|
|
D (44h) |
Data register |
|
|
|
|
|||||||||||||||
|
|
|
|
|
|
|
designation |
|
|
|
|
|
||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
T (54h) |
Timer |
|
|
x (78h) |
Input |
|
|
|
|
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||
|
|
|
|
|
|
(preset value) |
|
|
|
|
|
|
y (79h) |
Output |
|
1-bit |
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||
|
|
|
|
|
|
C (43h) |
Counter |
|
|
|
|
|
|
m (6Dh) |
Internal relay |
|
designation |
|||||||||||||
|
|
|
|
|
|
(preset value) |
|
|
|
|
|
|
r (72h) |
Shift register |
|
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
E (45h) |
Error code (read/clear) |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
I (49h) |
Link formatting sequence (clear) |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
K (4Bh) |
Scan time (read) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
(3) |
Data type |
N (4Eh) |
PLC system program version (read) |
|
|
|
|
|
|
|
|
|
||||||||||||||||||
(1 byte) |
P (50h) |
User program in ASCII format (read/write) |
|
|
|
|
|
|
|
|
|
|||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
Q (51h) |
Changed timer/counter preset values (write) |
|
|
|
|
|
|
|
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
S (53h) |
PLC operating status (read) |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
V (56h) |
User program protection |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
W (57h) |
Calendar/clock (read/write) |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
Z (5Ah) |
System reset (clear) |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
_ (5Fh) |
Timer information (read) |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
` (60h) |
Counter information (read) |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
a (61h) |
Timer preset value change status (read) |
|
|
|
|
|
|
|
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
b (62h) |
Counter preset value change status (read) |
|
|
|
|
|
|
|
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
d (64h) |
Timer timeout status (read) |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
e (65h) |
Counter countout status (read) |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
p (70h) |
User program in binary format (read/write) |
|
|
|
|
|
|
|
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
Data |
Data (depends on command and data type) |
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
(variable length) |
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1)“Continued” is used in request message 1 for writing the user program to inform the PLC that another request message will be sent successively. In all other request messages, “discontinued” is used. When “continued” is specified, the computer sends a request message, receives a reply message, and sends another request message.
(2)The command code is available in three types; write data, read data, and clear data.
(3)The data type code selects an operand or function. Upperand lower-case characters have different functions.
(4)The data specifies the operand number, the quantity of bytes of the data for reading or writing, etc. depending on the command and data type.
MICROSMART |
3 |
MICROSMART COMMUNICATION PROTOCOL
Request Message 2
Request message 2 is a command message used for writing and reading user programs. The data structure of request message 2 is shown below:
Request |
|
ENQ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
05h |
Device |
(1) |
|
|
|
|
|
|
|
(2) |
|
|
|
|
|
|
|
|
BCC |
Termi- |
|
|
Message 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nator |
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
Continuation |
0 (30h) |
|
Discontinued (no message follows) |
|
|
|
||||||||||||||||
(1 byte) |
|
|
|
|
|||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Data
User program (write user program)
(variable length)
(2)
Data
R (52h) Read user program
(1 byte)
(1)“Discontinued” is used for both writing and reading user programs to inform the PLC that no request message will be sent successively.
(2)The data length is variable for writing user programs and is 1-byte long (“R”) for reading user programs.
When a request message contains an interval of 500 msec or more between onebyte character data and the next one-byte character data, the PLC understands that the communication is canceled and does not return a reply message.
When the interval is 500 msec or more, extend the receive timeout value using WindLDR. The receive timeout can be selected between 10 and 2540 msec in 10msec increments. To enable the optional communication mode, turn on the mode selection input designated on the Communication Parameters page in WindLDR.
|
Data |
|
Data |
|
|
|
|
|
|
≤ 500 msec
To access the Communication Parameters page from the WindLDR menu bar, select Configure > Function Area Settings. In the Function Area Setting dialog box, click the Communication tab, and select Maintenance Protocol in the Port 1 or 2 pull-down list.
Click the Configure button. The Communication Parameters dialog box appears. Change settings, if required.
Baud Rate (bps) |
1200, 2400, 4800, 9600, 19200 |
|
|
Data Bits |
7 or 8 |
|
|
Parity |
None, Odd, Even |
|
|
Stop Bits |
1 or 2 |
|
|
|
10 to 2540 (10-msec increments) |
Receive Timeout (ms) |
(Receive timeout is disabled when 2550 |
|
is selected.) |
|
|
Device Number |
0 to 31 |
|
|
Mode Selection Input |
Any input number |
|
|
Note: Only when the mode selection input is turned on, the selected communication parameters are enabled. Otherwise, default communication parameters take effect; 9600 bps, 7 data bits, even parity, 1 stop bit, receive timeout 500 msec.
For details, see the MicroSmart User’s Manual EM342, page 25-2.
MICROSMART |
4 |
MICROSMART COMMUNICATION PROTOCOL
Reply messages are available in ACK reply message and NAK reply message with different data structures.
ACK Reply Message
The ACK reply message is a reply or response to the request message and is sent from the PLC to the computer when communication is completed normally.
ACK |
|
ACK |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
Reply |
|
06h |
Device |
|
(1) |
|
|
|
|
|
|
|
|
|
|
(2) |
|
|
|
|
|
|
|
|
|
|
|
BCC |
Termi- |
|
|
|
|
Message |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nator |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 (30h) |
|
OK: Discontinued |
All communication is completed normally (end of processing). |
|||||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
1 (31h) |
|
OK: Continued |
|
|
|
Communication in reply to request is completed normally and |
||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
another reply message follows when reading a user program. |
||||||||||||||||||||||||
|
Command |
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||||||
(1) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
Communication device number, command, data type, data, or con- |
||||||||||||||||||||
(1 byte) |
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tinuation code is not within the range supported by the PLC or |
|||||||||||||||||||
|
|
|
|
|
2 (32h) |
|
NG: Error |
|
|
|
|||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
does not match its status. When this error occurs, communication |
||||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
is halted without regard to the continuation code. |
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OK |
|
When request command is W or C |
|
|
No data exists. (0 byte) |
|||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The data length depends on the request |
|||||||||||
|
|
|
|
|
|
|
|
|
reply |
|
When request command is R |
|
|
||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
command (variable length). |
|||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NG code (2 bytes) |
|
|
|
|
|
|
|
|
|
|
|
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NG |
|
|
|
|
Error |
|
|
|
|
|
|
|
Cause |
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
Code |
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
01 |
Program size error |
|
Improper write/read program size |
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
02 |
Protect error |
|
Protected against write/read in the PLC |
|
|
||||||||||||||||
|
|
|
|
|
0 (30h) |
|
|
|
|
03 |
RUN error |
|
Writing user program is attempted while the PLC |
|
|
||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
is running |
|
|
|
|
|||||||||
|
|
|
|
|
to |
|
|
|
|
04 |
CRC error |
|
User program CRC code does not match |
|
|
||||||||||||||||||
|
|
|
|
|
9 (39h) |
|
|
|
|
|
|
|
|||||||||||||||||||||
|
|
|
|
|
|
|
|
|
05 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
Data |
|
|
|
|
|
|
|
|
Protect code error |
|
Protect code in the request message does not |
|
|
|||||||||||||||||||
(2) |
(variable |
|
or |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
match that set in the PLC. Attempt was made to |
|
|
||||||||||||
|
length) |
|
A (41h) |
|
NG |
|
|
|
|
|
|
|
|
|
|
|
|
enable protection on a protected user program. |
|
|
|||||||||||||
|
|
|
|
|
|
reply |
|
06 |
Data range error |
|
Invalid data range designated |
|
|
||||||||||||||||||||
|
|
|
|
|
to |
|
|
|
|
07 |
Timer/counter preset |
|
Preset value change is attempted to timer or |
|
|
||||||||||||||||||
|
|
|
|
|
F (46h) |
|
|
|
|
|
|
|
|||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
value change error |
|
counter with preset value designated by data reg- |
|
|
||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ister |
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
08 |
Calendar/clock data error |
|
Invalid value written to calendar/clock |
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
09 |
Data clear error |
|
Designated data cannot be cleared |
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
10 |
Data error |
|
Invalid data other than 0 (30h) - 9 (39h) or |
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A (41h) - F (46h) |
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
11 |
Setting error |
|
Incorrect setting for user communication |
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
12 |
CPU module type code |
|
CPU module type code in the request message |
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error |
|
|
|
|
|
|
does not match the connected PLC. |
|
|
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1)The command code indicates whether the request command is completed normally or not and also whether another reply message will be sent successively.
When reading a user program from the PLC, reply message 1 is returned in response to request message 1 and reply message 2 is returned in response to request message 2. Reply message 1 contains command 1 (OK: continued) to inform the computer that another reply message follows. All other reply messages contain command 0 (OK: discontinued) to indicate that no reply message follows when communication is completed normally.
(2)When an OK reply is returned in response to request command R (read data), the read data is included in this place. When an NG reply is returned, the cause of error exists in the PLC. See page 47.
MICROSMART |
5 |
MICROSMART COMMUNICATION PROTOCOL
NAK Reply Message
When an error is found during communication, a NAK reply message is sent from the PLC to the computer.
NAK |
NAK |
|
|
|
|
|
|
|
|
|
|
|||
Reply |
|
15h |
Device |
(1) |
(2) |
|
BCC |
Termi- |
|
|
|
|
||
Message |
|
|
|
|
|
|
|
|
|
nator |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
Command |
|
|
0 (no meaning): dummy data for consistent communication format |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Depending on the communication error, an error code is set in this place. |
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Error |
|
|
Error Type |
Error Contents |
|
|
|
|
|
|
|
|
|
|
Code |
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
00 |
|
BCC error |
Appended BCC code does not match BCC calculated |
|
|
||
|
Communication |
|
|
|
|
|
|
|
value of received data. |
|
|
|||
|
|
|
01 |
|
Frame error |
Quantity of received bits differs from the preset |
|
|
||||||
(2) |
error code |
|
|
|
|
|
||||||||
|
(2 bytes) |
|
|
|
|
|
|
|
value (stop bit is 0 for example). |
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
02 |
|
Data send/receive error |
Parity error or overrun error occurred. |
|
|
||
|
|
|
|
|
|
|
03 |
|
Command error |
Unsupported request message is received. |
|
|
||
|
|
|
|
|
|
|
04 |
|
Procedure/data quantity error |
Received request message does not match the |
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
expected data (including quantity of data). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1)The command code in the NAK reply message is always 0.
(2)The next two bytes indicate the communication error code.
MICROSMART |
6 |
MICROSMART COMMUNICATION PROTOCOL
The user program can be written from a computer to the PLC. When transferring a user program through modem, this command is recommended to transfer the user program in ASCII format because modems understand ASCII codes.
When writing a user program from a computer, two request messages must be sent to the PLC.
Send request message 1 first. After confirming that the returned reply message is an OK reply, send request message 2.
Request Messages (Write User Program in ASCII Format)
Request Message 1
05h |
** |
|
** |
31h |
57h |
|
50h |
|
3*h |
|
** |
** |
|
** |
** |
** |
|
** |
** |
|
** |
|
** |
|
** |
0Dh |
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
(1) |
(2) |
(3) |
(4) |
|
(5) |
|
(6) |
|
|
|
|
|
(7) |
|
|
|
|
|
|
|
(8) |
(9) |
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
|
Communication control character |
|
1 byte |
|
|
|
|
|
ENQ (05h) |
|
Enquiry |
||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
|
Communication device number |
|
|
2 bytes |
|
|
|
|
00 - 1F |
|
|
|
Device number 0 through 31 |
||||||||||||||||||||
|
|
|
|
|
|
|
|
FF |
|
|
|
|
|
Device number 255 (all devices) |
|||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
|
Continuation |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
|
1 (31h) |
|
|
|
Continued |
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
|
|
Command |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
|
W (57h) |
|
|
|
Write data |
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
|
Data type |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
|
P (50h) |
|
|
|
User program in ASCII format |
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 (30h) |
|
|
|
10-I/O |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 (31h) |
|
|
|
16-I/O |
||||
(6) |
|
|
CPU module type code |
|
|
|
|
|
1 byte |
|
|
|
|
|
2 (32h) |
|
|
|
20-I/O transistor output |
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
3 (33h) |
|
|
|
24-I/O |
|||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 (34h) |
|
|
|
40-I/O |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 (36h) |
|
|
|
20-I/O relay output |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0000 0000 |
|
|
User program includes data of rung |
||||||
(7) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comments and tag comments plus |
|||||||
|
|
Program capacity |
|
|
|
|
|
|
|
8 bytes |
|
|
|
|
|
|
: |
|
|
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function area settings. The function |
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FFFF FFFF |
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
area occupies 94 bytes. |
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
(8) |
|
|
BCC |
|
|
|
|
|
|
|
|
|
|
|
|
2 bytes |
|
|
|
|
00 - 7F |
|
|
|
Block check character |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(9) |
|
|
Terminator |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
|
CR (0Dh) |
|
Message end code |
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
Request Message 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||
05h |
** |
|
** |
30h |
** |
|
** |
|
** |
|
** |
** |
|
** |
** |
|
|
|
|
** |
** |
|
** |
|
0Dh |
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
(1) |
(2) |
(3) |
|
|
|
|
|
|
(4) |
|
|
|
|
|
|
|
|
|
(5) |
|
(6) |
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
|
Communication control character |
|
1 byte |
|
|
|
|
|
|
|
ENQ (05h) |
|
Enquiry |
||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
|
Communication device number |
|
|
2 bytes |
|
|
|
|
|
|
00 - 1F |
|
Device number 0 through 31 |
||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
FF |
|
|
|
|
Device number 255 (all devices) |
||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
|
Continuation |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
|
|
|
0 (30h) |
|
Discontinued |
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
(4) |
|
|
User program |
|
|
|
|
|
|
|
|
|
Variable length |
|
|
|
|
0 (30h) - 9 (39h) |
User program (ASCII code file) |
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
64,336 bytes max. |
|
A (41h) - F (46h) |
|
|||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
(5) |
|
|
BCC |
|
|
|
|
|
|
|
|
|
|
|
|
2 bytes |
|
|
|
|
|
|
00 - 7F |
|
Block check character |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(6) |
|
|
Terminator |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
|
|
|
CR (0Dh) |
|
Message end code |
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note: The user program must be stored in a file of the ASCII code format. Ladder program files (.LDR) cannot be sent to the PLC using this request message.
MICROSMART |
7 |
MICROSMART COMMUNICATION PROTOCOL
Reply Messages (Write User Program in ASCII Format)
OK Reply (Reply to Request Messages 1 and 2)
06h |
** |
** |
30h |
|
** |
** |
0Dh |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
(2) |
(3) |
|
(4) |
(5) |
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
Communication control character |
1 byte |
ACK (06h) |
Acknowledge |
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
Communication device number |
2 bytes |
00 - 1F |
Device number 0 through 31 |
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
Command |
|
|
|
|
1 byte |
0 (30h) |
OK: Discontinued |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
|
BCC |
|
|
|
|
|
|
2 bytes |
00 - 7F |
Block check character |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
Terminator |
|
|
1 byte |
CR (0Dh) |
Message end code |
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
NG Reply (Reply to Request Message 1)
06h |
** |
** |
32h |
30h |
3*h |
** |
** |
0Dh |
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
(2) |
(3) |
|
(4) |
(5) |
(6) |
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
Communication control character |
1 byte |
ACK (06h) |
Acknowledge |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
Communication device number |
2 bytes |
00 |
- 1F |
Device number 0 through 31 |
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
Command |
|
|
|
|
|
|
1 byte |
2 (32h) |
NG |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
01 |
(30h 31h) |
Program capacity error |
(4) |
|
|
|
|
|
|
|
|
|
|
|
|
02 |
(30h 32h) |
Protect error |
|
NG code |
|
|
|
|
|
|
2 bytes |
03 |
(30h 33h) |
RUN error |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
04 |
(30h 34h) |
CRC error |
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
(31h 32h) |
CPU module type code error |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
BCC |
|
|
|
|
|
|
|
|
2 bytes |
00 |
- 7F |
Block check character |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(6) |
|
Terminator |
|
|
|
|
|
|
1 byte |
CR (0Dh) |
Message end code |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note: NG reply never occurs in response to reply message 2.
MICROSMART |
8 |
MICROSMART COMMUNICATION PROTOCOL
The user program can be written from a computer to the PLC. This command can send a user program faster than the Write User Program in ASCII format command.
When writing a user program from a computer, two request messages must be sent to the PLC.
Send request message 1 first. After confirming that the returned reply message is an OK reply, send request message 2.
Request Messages (Write User Program in Binary Format)
Request Message 1
05h |
** |
|
** |
31h |
57h |
|
70h |
|
3*h |
|
** |
** |
|
** |
|
** |
** |
|
** |
** |
** |
|
** |
** |
0Dh |
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
(1) |
(2) |
(3) |
(4) |
|
(5) |
|
(6) |
|
|
|
|
|
|
(7) |
|
|
|
|
|
|
(8) |
(9) |
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
|
Communication control character |
1 byte |
|
|
|
|
ENQ (05h) |
Enquiry |
|||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
|
Communication device number |
|
|
2 bytes |
|
|
|
|
00 - 1F |
|
|
Device number 0 through 31 |
|||||||||||||||||
|
|
|
|
|
|
|
|
FF |
|
|
Device number 255 (all devices) |
||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
|
Continuation |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
1 (31h) |
|
|
Continued |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
|
|
Command |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
W (57h) |
|
|
Write data |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
|
Data type |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
p (70h) |
|
|
User program in binary format |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 (30h) |
|
|
10-I/O |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 (31h) |
|
|
16-I/O |
||
(6) |
|
|
CPU module type code |
|
|
|
|
|
1 byte |
|
|
|
|
2 (32h) |
|
|
20-I/O transistor output |
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
3 (33h) |
|
|
24-I/O |
|||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 (34h) |
|
|
40-I/O |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 (36h) |
|
|
20-I/O relay output |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0000 0000 |
|
User program includes data of rung |
|||
(7) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comments and tag comments plus |
||||
|
|
Program capacity |
|
|
|
|
|
|
|
8 bytes |
|
|
|
|
: |
|
|
|
|||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function area settings. The function |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FFFF FFFF |
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
area occupies 94 bytes. |
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(8) |
|
|
BCC |
|
|
|
|
|
|
|
|
|
|
|
|
2 bytes |
|
|
|
|
00 - 7F |
|
|
Block check character |
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(9) |
|
|
Terminator |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
CR (0Dh) |
Message end code |
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
Request Message 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
05h |
** |
|
** |
30h |
** |
|
** |
|
** |
|
** |
** |
|
** |
|
** |
|
|
|
|
** |
** |
** |
|
0Dh |
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
(1) |
(2) |
(3) |
|
|
|
|
|
|
(4) |
|
|
|
|
|
|
|
|
|
(5) |
|
(6) |
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
|
Communication control character |
1 byte |
|
|
|
|
|
ENQ (05h) |
Enquiry |
||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
|
Communication device number |
|
|
2 bytes |
|
|
|
|
|
00 - 1F |
Device number 0 through 31 |
||||||||||||||||||
|
|
|
|
|
|
|
|
|
FF |
|
|
Device number 255 (all devices) |
|||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
|
Continuation |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
|
0 (30h) |
Discontinued |
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
|
|
User program |
|
|
|
|
|
|
|
|
|
Variable length |
|
|
|
(00h) - (FFh) |
User program (binary code file) |
|||||||||||||
|
|
|
|
|
|
|
|
|
|
|
32,168 bytes max. |
|
|||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
|
BCC |
|
|
|
|
|
|
|
|
|
|
|
|
2 bytes |
|
|
|
|
|
00 - FF |
Block check character |
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(6) |
|
|
Terminator |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
|
CR (0Dh) |
Message end code |
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note: The user program must be stored in a file of the binary code format. Ladder program files (.LDR) cannot be sent to the PLC using this request message.
MICROSMART |
9 |
MICROSMART COMMUNICATION PROTOCOL
Reply Messages (Write User Program in Binary Format)
OK Reply (Reply to Request Messages 1 and 2)
06h |
** |
** |
30h |
|
** |
** |
0Dh |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
(2) |
(3) |
|
(4) |
(5) |
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
Communication control character |
1 byte |
ACK (06h) |
Acknowledge |
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
Communication device number |
2 bytes |
00 - 1F |
Device number 0 through 31 |
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
Command |
|
|
|
|
1 byte |
0 (30h) |
OK: Discontinued |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
|
BCC |
|
|
|
|
|
|
2 bytes |
00 - 7F |
Block check character |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
Terminator |
|
|
1 byte |
CR (0Dh) |
Message end code |
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
NG Reply (Reply to Request Message 1)
06h |
** |
** |
32h |
30h |
3*h |
** |
** |
0Dh |
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
(2) |
(3) |
|
(4) |
(5) |
(6) |
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
Communication control character |
1 byte |
ACK (06h) |
Acknowledge |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
Communication device number |
2 bytes |
00 |
- 1F |
Device number 0 through 31 |
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
Command |
|
|
|
|
|
|
1 byte |
2 (32h) |
NG |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
01 |
(30h 31h) |
Program capacity error |
(4) |
|
|
|
|
|
|
|
|
|
|
|
|
02 |
(30h 32h) |
Protect error |
|
NG code |
|
|
|
|
|
|
2 bytes |
03 |
(30h 33h) |
RUN error |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
04 |
(30h 34h) |
CRC error |
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
(31h 32h) |
CPU module type code error |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
BCC |
|
|
|
|
|
|
|
|
2 bytes |
00 |
- 7F |
Block check character |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(6) |
|
Terminator |
|
|
|
|
|
|
1 byte |
CR (0Dh) |
Message end code |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note: NG reply never occurs in response to reply message 2.
MICROSMART |
10 |
MICROSMART COMMUNICATION PROTOCOL
The user program can be read from the PLC to a computer.
When reading a user program to a computer, two request messages must be sent from the computer to the PLC.
Send request message 1 first. After confirming that the returned reply message is an OK reply, send request message 2.
Specify a value larger than the user program capacity selected in the PLC in place of the program capacity in request message 1. Reserve a buffer in the computer to store the data of the specified program capacity temporarily.
Request Messages (Read User Program in ASCII Format)
Request Message 1
05h |
** |
|
** |
31h |
52h |
50h |
3*h |
** |
** |
** |
|
** |
** |
** |
** |
** |
** |
** |
0Dh |
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
(1) |
(2) |
(3) |
(4) |
(5) |
(6) |
|
|
|
|
(7) |
|
|
|
(8) |
(9) |
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
|
Communication control character |
1 byte |
|
|
|
ENQ (05h) |
Enquiry |
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
|
Communication device number |
2 bytes |
|
|
|
00 - 1F |
|
|
Device number 0 through 31 |
||||||||||||
|
|
|
|
|
FF |
|
|
Device number 255 (all devices) |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
|
Continuation |
|
|
|
|
|
|
1 byte |
|
|
|
1 (31h) |
|
|
Continued |
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
|
|
Command |
|
|
|
|
|
|
1 byte |
|
|
|
R (52h) |
|
|
Read data |
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
|
Data type |
|
|
|
|
|
|
1 byte |
|
|
|
P (50h) |
|
|
User program in ASCII format |
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 (30h) |
|
|
10-I/O |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 (31h) |
|
|
16-I/O |
|
(6) |
|
|
CPU module type code |
1 byte |
|
|
|
2 (32h) |
|
|
20-I/O transistor output |
||||||||||||
|
|
|
|
|
3 (33h) |
|
|
24-I/O |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 (34h) |
|
|
40-I/O |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 (36h) |
|
|
20-I/O relay output |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0000 0000 |
|
User program includes data of rung |
|||
(7) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comments and tag comments plus |
||||
|
|
Program capacity |
|
|
|
|
|
8 bytes |
|
|
: |
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
function area settings. The function |
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FFFF FFFF |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
area occupies 94 bytes. |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(8) |
|
|
BCC |
|
|
|
|
|
|
|
|
2 bytes |
|
|
|
00 - 7F |
|
|
Block check character |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(9) |
|
|
Terminator |
|
|
|
|
|
|
1 byte |
|
|
|
CR (0Dh) |
Message end code |
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Request Message 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
05h |
** |
|
** |
30h |
52h |
** |
** |
0Dh |
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
(1) |
(2) |
(3) |
(4) |
(5) |
(6) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
|
Communication control character |
1 byte |
|
|
|
ENQ (05h) |
Enquiry |
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
|
Communication device number |
2 bytes |
|
|
|
00 - 1F |
|
|
Device number 0 through 31 |
||||||||||||
|
|
|
|
|
FF |
|
|
Device number 255 (all devices) |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
|
Continuation |
|
|
|
|
|
|
1 byte |
|
|
|
0 (30h) |
|
|
Discontinued |
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
|
|
Command |
|
|
|
|
|
|
1 byte |
|
|
|
R (52h) |
|
|
Read data |
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
|
BCC |
|
|
|
|
|
|
|
|
2 bytes |
|
|
|
00 - 7F |
|
|
Block check character |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(6) |
|
|
Terminator |
|
|
|
|
|
|
1 byte |
|
|
|
CR (0Dh) |
Message end code |
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MICROSMART |
11 |
MICROSMART COMMUNICATION PROTOCOL
Reply Messages (Read User Program in ASCII Format)
OK Reply
• Reply Message 1
06h |
** |
|
** |
31h |
3*h |
|
** |
|
** |
|
** |
** |
|
** |
|
** |
** |
|
** |
** |
** |
|
0Dh |
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
(1) |
(2) |
(3) |
(4) |
|
|
|
|
|
|
(5) |
|
|
|
|
|
|
|
(6) |
|
(7) |
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
|
Communication control character |
1 byte |
|
|
|
|
ACK (06h) |
|
Acknowledge |
||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
(2) |
|
|
Communication device number |
|
|
2 bytes |
|
|
|
|
00 - 1F |
|
Device number 0 through 31 |
||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
|
Command |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
1 (31h) |
|
OK: Continued |
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 (30h) |
|
10-I/O |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 (31h) |
|
16-I/O |
|||
(4) |
|
|
CPU module type code |
|
|
|
|
|
1 byte |
|
|
|
|
2 (32h) |
|
20-I/O transistor output |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
3 (33h) |
|
24-I/O |
||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 (34h) |
|
40-I/O |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 (36h) |
|
20-I/O relay output |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0000 0000 |
|
User program includes data of rung |
|||
(5) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comments and tag comments plus |
||||
|
|
Program capacity |
|
|
|
|
|
|
|
8 bytes |
|
|
|
|
: |
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function area settings. The function |
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FFFF FFFF |
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
area occupies 94 bytes. |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(6) |
|
|
BCC |
|
|
|
|
|
|
|
|
|
|
|
|
2 bytes |
|
|
|
|
00 - 7F |
|
Block check character |
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(7) |
|
|
Terminator |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
CR (0Dh) |
|
Message end code |
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
• Reply Message 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
06h |
** |
|
** |
30h |
** |
|
** |
|
** |
|
** |
** |
|
** |
|
** |
|
|
|
|
** |
** |
** |
|
0Dh |
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
(1) |
(2) |
(3) |
|
|
|
|
|
|
(4) |
|
|
|
|
|
|
|
|
|
(5) |
|
(6) |
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
|
Communication control character |
1 byte |
|
|
|
|
|
ACK (06h) |
|
Acknowledge |
|||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
(2) |
|
|
Communication device number |
|
|
2 bytes |
|
|
|
|
|
00 - 1F |
|
Device number 0 through 31 |
|||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
|
Command |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
|
0 (30h) |
|
OK: Discontinued |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
(4) |
|
|
User program |
|
|
|
|
|
|
|
|
|
Variable length |
|
|
|
0 (30h) - 9 (39h) |
|
User program (ASCII code file) |
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
64,336 bytes max. |
|
A (41h) - F (46h) |
|
|||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
|
BCC |
|
|
|
|
|
|
|
|
|
|
|
|
2 bytes |
|
|
|
|
|
00 - 7F |
|
Block check character |
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(6) |
|
|
Terminator |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
|
CR (0Dh) |
|
Message end code |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note: The received user program is stored on the disk in the ASCII code format.
NG Reply (Reply to Request Message 1)
06h |
** |
** |
32h |
30h |
3*h |
** |
** |
0Dh |
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
(2) |
(3) |
|
(4) |
(5) |
(6) |
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
Communication control character |
1 byte |
ACK (06h) |
Acknowledge |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
Communication device number |
2 bytes |
00 |
- 1F |
Device number 0 through 31 |
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
Command |
|
|
|
|
|
|
1 byte |
2 (32h) |
NG |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
|
|
|
|
|
|
|
|
|
|
|
|
01 |
(30h 31h) |
Program capacity error |
|
NG code |
|
|
|
|
|
|
2 bytes |
02 |
(30h 32h) |
Protect error |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
04 |
(30h 34h) |
CRC error |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
BCC |
|
|
|
|
|
|
|
|
2 bytes |
00 |
- 7F |
Block check character |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(6) |
|
Terminator |
|
|
|
|
|
|
1 byte |
CR (0Dh) |
Message end code |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note: NG reply never occurs in response to reply message 2.
MICROSMART |
12 |
MICROSMART COMMUNICATION PROTOCOL
The user program can be read from the PLC to a computer.
When reading a user program to a computer, two request messages must be sent from the computer to the PLC.
Send request message 1 first. After confirming that the returned reply message is an OK reply, send request message 2.
Specify a value larger than the user program capacity selected in the PLC in place of the program capacity in request message 1. Reserve a buffer in the computer to store the data of the specified program capacity temporarily.
Request Messages (Read User Program in Binary Format)
Request Message 1
05h |
** |
|
** |
31h |
52h |
70h |
3*h |
** |
** |
** |
|
** |
** |
** |
** |
** |
** |
** |
0Dh |
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
(1) |
(2) |
(3) |
(4) |
(5) |
(6) |
|
|
|
|
(7) |
|
|
|
(8) |
(9) |
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
|
Communication control character |
1 byte |
|
|
|
ENQ (05h) |
Enquiry |
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
|
Communication device number |
2 bytes |
|
|
|
00 - 1F |
|
|
Device number 0 through 31 |
||||||||||||
|
|
|
|
|
FF |
|
|
Device number 255 (all devices) |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
|
Continuation |
|
|
|
|
|
|
1 byte |
|
|
|
1 (31h) |
|
|
Continued |
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
|
|
Command |
|
|
|
|
|
|
1 byte |
|
|
|
R (52h) |
|
|
Read data |
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
|
Data type |
|
|
|
|
|
|
1 byte |
|
|
|
p (70h) |
|
|
User program in binary format |
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 (30h) |
|
|
10-I/O |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 (31h) |
|
|
16-I/O |
|
(6) |
|
|
CPU module type code |
1 byte |
|
|
|
2 (32h) |
|
|
20-I/O transistor output |
||||||||||||
|
|
|
|
|
3 (33h) |
|
|
24-I/O |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 (34h) |
|
|
40-I/O |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 (36h) |
|
|
20-I/O relay output |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0000 0000 |
|
User program includes data of rung |
|||
(7) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comments and tag comments plus |
||||
|
|
Program capacity |
|
|
|
|
|
8 bytes |
|
|
: |
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
function area settings. The function |
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FFFF FFFF |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
area occupies 94 bytes. |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(8) |
|
|
BCC |
|
|
|
|
|
|
|
|
2 bytes |
|
|
|
00 - 7F |
|
|
Block check character |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(9) |
|
|
Terminator |
|
|
|
|
|
|
1 byte |
|
|
|
CR (0Dh) |
Message end code |
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Request Message 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
05h |
** |
|
** |
30h |
52h |
** |
** |
0Dh |
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
(1) |
(2) |
(3) |
(4) |
(5) |
(6) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
|
Communication control character |
1 byte |
|
|
|
ENQ (05h) |
Enquiry |
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
|
Communication device number |
2 bytes |
|
|
|
00 - 1F |
|
|
Device number 0 through 31 |
||||||||||||
|
|
|
|
|
FF |
|
|
Device number 255 (all devices) |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
|
Continuation |
|
|
|
|
|
|
1 byte |
|
|
|
0 (30h) |
|
|
Discontinued |
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
|
|
Command |
|
|
|
|
|
|
1 byte |
|
|
|
R (52h) |
|
|
Read data |
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
|
BCC |
|
|
|
|
|
|
|
|
2 bytes |
|
|
|
00 - 7F |
|
|
Block check character |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(6) |
|
|
Terminator |
|
|
|
|
|
|
1 byte |
|
|
|
CR (0Dh) |
Message end code |
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MICROSMART |
13 |
MICROSMART COMMUNICATION PROTOCOL
Reply Messages (Read User Program in Binary Format)
OK Reply
• Reply Message 1
06h |
** |
|
** |
31h |
3*h |
|
** |
|
** |
|
** |
** |
|
** |
** |
** |
|
** |
** |
|
** |
|
0Dh |
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
(1) |
(2) |
(3) |
(4) |
|
|
|
|
|
|
(5) |
|
|
|
|
|
|
|
(6) |
|
|
(7) |
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
|
Communication control character |
|
1 byte |
|
|
|
|
|
|
ACK (06h) |
Acknowledge |
|||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
(2) |
|
|
Communication device number |
|
|
2 bytes |
|
|
|
|
|
00 - 1F |
Device number 0 through 31 |
|||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
|
Command |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
|
|
1 (31h) |
OK: Continued |
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 (30h) |
10-I/O |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 (31h) |
16-I/O |
|||
(4) |
|
|
CPU module type code |
|
|
|
|
|
1 byte |
|
|
|
|
|
|
2 (32h) |
20-I/O transistor output |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
3 (33h) |
24-I/O |
||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 (34h) |
40-I/O |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 (36h) |
20-I/O relay output |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0000 0000 |
User program includes data of rung |
|||
(5) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comments and tag comments plus |
||||
|
|
Program capacity |
|
|
|
|
|
|
|
8 bytes |
|
|
|
|
|
: |
|
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function area settings. The function |
|||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FFFF FFFF |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
area occupies 94 bytes. |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(6) |
|
|
BCC |
|
|
|
|
|
|
|
|
|
|
|
|
2 bytes |
|
|
|
|
|
00 - 7F |
Block check character |
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(7) |
|
|
Terminator |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
|
|
CR (0Dh) |
Message end code |
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
• Reply Message 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||
06h |
** |
|
** |
30h |
** |
|
** |
|
** |
|
** |
** |
|
** |
** |
|
|
|
|
** |
** |
|
** |
|
0Dh |
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
(1) |
(2) |
(3) |
|
|
|
|
|
|
(4) |
|
|
|
|
|
|
|
|
|
(5) |
|
|
(6) |
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
|
Communication control character |
|
1 byte |
|
|
|
|
|
|
|
|
ACK (06h) |
|
Acknowledge |
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
(2) |
|
|
Communication device number |
|
|
2 bytes |
|
|
|
|
|
|
|
00 - 1F |
|
Device number 0 through 31 |
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
|
Command |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
|
|
|
|
0 (30h) |
|
OK: Discontinued |
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
|
|
User program |
|
|
|
|
|
|
|
|
|
Variable length |
|
|
|
|
|
(00h) - (FFh) |
|
User program (binary code file) |
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
32,168 bytes max. |
|
|
|
||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
|
BCC |
|
|
|
|
|
|
|
|
|
|
|
|
2 bytes |
|
|
|
|
|
|
|
00 - FF |
|
Block check character |
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(6) |
|
|
Terminator |
|
|
|
|
|
|
|
|
|
1 byte |
|
|
|
|
|
|
|
|
CR (0Dh) |
|
Message end code |
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note: The received user program is stored on the disk in the binary code format.
NG Reply (Reply to Request Message 1)
06h |
** |
** |
32h |
30h |
3*h |
** |
** |
0Dh |
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
(2) |
(3) |
|
(4) |
(5) |
(6) |
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) |
|
Communication control character |
1 byte |
ACK (06h) |
Acknowledge |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
Communication device number |
2 bytes |
00 |
- 1F |
Device number 0 through 31 |
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
Command |
|
|
|
|
|
|
1 byte |
2 (32h) |
NG |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
|
|
|
|
|
|
|
|
|
|
|
|
01 |
(30h 31h) |
Program capacity error |
|
NG code |
|
|
|
|
|
|
2 bytes |
02 |
(30h 32h) |
Protect error |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
04 |
(30h 34h) |
CRC error |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
BCC |
|
|
|
|
|
|
|
|
2 bytes |
00 |
- 7F |
Block check character |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(6) |
|
Terminator |
|
|
|
|
|
|
1 byte |
CR (0Dh) |
Message end code |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note: NG reply never occurs in response to reply message 2.
MICROSMART |
14 |
MICROSMART COMMUNICATION PROTOCOL
Data can be written into N-bytes of operands starting with the specified operand number in the PLC.
This command can be used to turn on or off bit operands such as inputs, outputs, internal relays, and shift register bits in units of 8 bits.
This command can also be used to change timer and counter preset values, enter data into data registers, and set calendar/ clock data.
Request Message (Write N Bytes)
05h |
** |
** |
30h |
57h |
|
** |
** |
** |
** |
** |
|
** |
** |
** |
** |
|
** |
** |
|
|
|
|
** |
** |
** |
0Dh |
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
(1) |
|
(2) |
(3) |
(4) |
|
(5) |
|
(6) |
|
|
|
(7) |
|
(8) |
|
|
|
|
|
|
(9) |
|
(10) |
|
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Data for 1-byte operand after ASCII conversion |
|||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
(1) |
|
|
Communication control character |
|
1 byte |
|
|
|
ENQ (05h) |
|
|
Enquiry |
||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(2) |
|
|
Communication device number |
|
2 bytes |
|
|
|
00 - 1F |
|
|
Device number 0 through 31 |
||||||||||||||||||||||
|
|
|
|
|
|
FF |
|
|
|
|
|
|
|
|
|
|
Device number 255 (all devices) |
|||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3) |
|
|
Continuation |
|
|
|
|
|
|
|
|
1 byte |
|
|
|
0 (30h) |
|
|
Discontinued |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(4) |
|
|
Command |
|
|
|
|
|
|
|
|
1 byte |
|
|
|
W (57h) |
|
|
Write data |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) |
|
|
Data type |
|
|
|
|
|
|
|
|
1 byte |
|
|
|
See table below. |
|
|
N-byte designation |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
(6) |
|
|
Operand number |
|
|
|
|
|
|
4 bytes |
|
|
|
See table below. |
|
|
First operand number to write to |
|||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(7) |
|
|
Data length (n) |
|
|
|
|
|
|
2 bytes |
|
|
|
00 - C8 |
|
|
Byte count of data to write |
|||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
200 (C8h) bytes maximum |
|||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(8) |
|
|
Data |
|
|
|
|
|
|
|
|
|
|
2n bytes |
|
|
|
0 (30h) - 9 (39h) |
|
|
Data to write |
|||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
1 ≤ n ≤ 200 |
A (41h) - F (46h) |
|
|
|||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||
(9) |
|
|
BCC |
|
|
|
|
|
|
|
|
|
|
2 bytes |
|
|
|
00 - 7F |
|
|
Block check character |
|||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(10) |
|
|
Terminator |
|
|
|
|
|
|
|
|
1 byte |
|
|
|
CR (0Dh) |
|
|
Message end code |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(5) Data type code |
|
|
|
|
|
|
(6) Operand number |
(Note) |
|
|
|
|
Remarks |
|||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
X (58h) |
Input |
|
|
|
|
|
|
|
0000 - 0307 |
|
|
|
|
|
|
|
|
The least significant digit of the oper- |
||||||||||||||||
Y (59h) |
Output |
|
|
|
|
|
|
|
0000 - 0307 |
|
|
|
|
|
|
|
|
and number is an octal number (0-7). |
||||||||||||||||
M (4Dh) |
Internal relay |
|
|
|
|
|
0000 - 1277, 8000 - 8077 |
|
|
|
Upper digits are decimal numbers. |
|||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
R (52h) |
Shift register |
|
|
|
|
|
0000 - 0127 |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||
T (54h) Timer (preset value) |
|
|
|
0000 - 0099 |
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||
t (74h) Timer (current value) |
|
|
|
0000 - 0099 |
|
|
|
|
|
|
|
|
All four digits of the operand number |
|||||||||||||||||||||
C (43h) Counter (preset value) |
|
|
|
0000 - 0099 |
|
|
|
|
|
|
|
|
||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
are decimal numbers. |
|||||||||||||||||||||||
c (63h) Counter (current value) |
|
|
|
0000 - 0099 |
|
|
|
|
|
|
|
|
||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||
D (44h) |
Data register |
|
|
0000 - 1299, 2000 - 7999, 8000 - 8199 |
|
|
|
|
|
|
||||||||||||||||||||||||
W (57h) |
Calendar/clock |
|
|
|
|
|
0000 - 0006 |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note: The valid operand range depends on the CPU module type. For details, see page 48.
Operand numbers for calendar and clock are allocated as listed on the right:
When the range specified by the data type and data length is invalid, the PLC returns an NG reply.
When a data register is designated as a preset value for a timer or counter, data cannot be written into the preset value. To change the preset value, write data into the data register designated as a preset value.
Calendar/clock |
Data |
|
operand number |
||
|
||
|
|
|
0000 |
Year |
|
0001 |
Month |
|
0002 |
Day |
|
0003 |
Day of week |
|
0004 |
Hour |
|
0005 |
Minute |
|
0006 |
Second |
MICROSMART |
15 |