Specifications
7. Application Instructions
© DELTA ELECTRONICS, INC. ALL RIGHTS RESERVED
7-38
80 RS
S m D n Data Communication
Bit device Word device
Device
Operand
X Y M S K H KnX KnY KnM KnS T C D E F
S
Ϩ
m
ϨϨ Ϩ
D
Ϩ
n
ϨϨ Ϩ
Note: The usage range of operand m is 0~256.The usage range of operand
n is 0~256.Please refer to function specification chart for every
device usage range.
S
: start device of transmitting data.
m
: transmitting data group
number.
D
: start device of receiving data.
n
: receiving data
group numbers.
This instruction is a convenience instruction for MPU to use RS -485 to
connect communication interface in series. It saves words data in
S
source data register and sets length
m
. It also sets receive
data register
D
and length.
If it doesn’ t need to transmit data,
m
can be indicated to K0 and if
it doesn’ t need to receive data,
n
can be indicated to K0.
You can use RS command in the program unlimitedly, but you can’ t
execute two or more RS commands at the same time.
It is invalid to change delivery data during executing RS command.
PLC user can transmit data of PLC and peripheral equipment if
peripheral equipment has RS-485 series communication and
communication format of this equipment is public.
If communication format of peripheral equipment corresponds with
communication format of MODBUS, DVP series PLC provides several
convenience communication commands, API 100 MODRD, API 101
MODWR and API 150 MODRW, for user to use. Please refer to
individual instruction for detail.
Please refer to following footnote for flag special auxiliary relay
M1120~M1161 and special data register D1120~D1131 that relates to
RS-485 communication.
Program Example 1:
Ϩʳ Writing data into the register that starts from D100 and set M1122
(delivery request flag) to ON.
Ϩʳ If RS command is executed when X10=ON, PLC will in the state of
waiting for transmitting and receiving data. It will start to transmit 10
continuous data that start from D100. M1122 will be set to OFF at the
end of transmitting. (Please don’ t execute RST M1122 by program)
After 1ms, it will start to receive external 10 data and save them into
continuous registers that start from D120.
Ϩʳ When finishing to receive data, M1123 will be set to ON. (Program will
set M1123 to OFF when finishing to receive data and in the state of
waiting transmitting and receiving. Please don’ t execute RST M1123
continuously by PLC program.
transmit request
write delivery data in
ad
v
a
n
ce
SET M1122
delivery
request
pulse
X10
RS D100 K10 D120 K10
receive completely
deal with receiving data
reset flag when finishing
receiving data
M1123
RST M1123
M1002
MOV
M1120
D1129
set communication protocol
9600, 7, E, 1
communication protocol latched
setting communication time
range 100ms
H86 D1120
SET
K100MOV