Send/receive data and amount of data
RS2 instruction can handle sent and received data in two modes, 16-bit mode and 8-bit mode. The processing mode is set in
the communication settings, and when the RS2 instruction is drive, the mode is switched to the set mode.
The handling of data is as follows.
■16-bit mode
RUN
monitor
SM400
RS2
D100
Serial communication setting
• Header
• Terminator
• Sum check code
• Control procedure
• Control mode
• Send data and amount of remaining send data
Send data
Number of bytes
to be sent
specified by "n1"
Sending
request
SM8561
Set in the
program.
Amount of
remaining
send data
SD8560
Sending sum
SD8565
K4
D200
K20
: [Added] [DLE + STX (SD8623: 0210H, SD8624: 0000H)]
: [Added] [DLE + ETX (SD8625: 0310H, SD8626: 0000H)]
: [Added]
: [CR, LF added]
: [None (RS-232C)]
Header
Data area
DLE
STX
31H
32H
33H
Low
High
Low
High
Low
order of
order of
order of
order of
order of
SD8623
SD8623
D100
D100
D101
4
3
2
1
00H
31H
63H
96H
16-bit data
Upper 8 bits
16-bit data is divided into upper
K1
8 bits and lower 8 bits when it is
sent or received.
Terminator
Sum data
34H
DLE
ETX
44H
44H
High
Low
High
High
Low
order of
order of
order of
order of
order of
D101
SD8625
SD8625
sum
sum
0
CAH
DAH
DDH
5 NON-PROTOCOL COMMUNICATION
Lower 8 bits
The order is different
from the data area.
CR
LF
Automatically reset when
sending is completed.
5.7 Programming
5
143