beautypg.com

Delta Electronics Programmable Logic Controller DVP-PLC User Manual

Page 364

background image

7 Application Instructions API 50-99

D V P - P L C A P P L I C AT I O N M A N U A L

7-80

API Mnemonic

Operands

Function

80

RS

Serial Communication Instruction

Controllers

ES/EX/SS SA/SX/SC EH/SV

Bit Devices

Word Devices

Program Steps

Type

OP

X Y M S K H

KnX

KnY KnM KnS T

C

D

E

F

S

*

m

*

*

*

D

*

n

*

*

*

RS: 9 steps

PULSE 16-bit 32-bit

ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV

Operands:

S

: Start device for the data to be transmitted m: Length of data to be transmitted D: Start device for receiving

data n: Length of data to be received

Explanations:

1. Range

of

m

: 0 ~ 256

2. Range

of

n

: 0 ~ 256

3. See the specifications of each model for their range of use.

4. ES series MPU does not support E, F index register modification.

5. This instruction is a handy instruction exclusively for MPU to use RS-485 serial communication interface. The

user has to pre-store word data in S data register, set up data length m and the data receiving register D and

received data length n. If E, F index registers are used to modify S and D, the user cannot change the set values

of E and F when the instruction is being executed; otherwise errors may cause in data writing or reading.

6. Designate

m

as K0 if you do not need to send data. Designate n as K0 if you do not need to receive data.

7. There is no limitation on the times of using this instruction in the program, but only one instruction is allowed to

be executed at a time.

8. During the execution of RS instruction, changing the data to be transmitted will be invalid.

9. If the peripheral devices, e.g. AC motor drive, are equipped with RS-485 serial communication and its

communication format is open, you can use RS instruction to design the program for the data transmission

between PLC and the peripheral device.

10. If the communication format of the peripheral device is Modbus, DVP series PLC offers handy communication

instructions API 100 MODRD, API 101 MODWR, and API 150 MODRW, to work with the device. See

explanations of the instructions in this application manual.

11. For the special auxiliary relays M1120 ~ M1161 and special data registers D1120 ~ D1131 relevant to RS-485

communication, see remarks for more details.

Program Example 1:

1. Write the data to be transmitted in advance into registers starting from D100 and set M1122 (sending request

flag) as On.

2. When X10 = On, RS instruction will be executed and PLC will start to wait for the sending and receiving of data.

D100 starts to continuousl send out 10 data and when the sending is over, M1122 will be automatically reset to