3. Instruction Set

Program Example 11: COM2 (RS-485), Function Code H10

1.Function code K16 (H10): Write in multiple Word devices. Up to 16 Words can be written. For PLC COM2 ASCII mode, only 8 words can be written.

2.For ASCII or RTU mode, PLC COM2 stores the data to be sent in D1256~D1295, and the received data in D1070~D1085.

3.Take the connection between PLC COM2 and VFD-B AC motor drive for example, the tables below explain the status when PLC COM2 writes multiple word devices in VFD-B.

M1002

 

 

D1120 Set communication protocol as 9600, 8, E, 1

 

 

 

 

 

 

 

MOV

H87

 

 

 

 

 

 

 

 

 

 

 

SET

M1120

Retain communication protocol

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MOV

K100

D1129 Set communication timeout as 100ms

M1143 = ON

 

 

 

 

 

 

 

 

 

 

 

 

 

RST

M1143

M1143 = OFF

 

 

 

 

SET

M1143

 

 

 

 

 

 

 

ASCII mode

 

 

 

 

RTU mode

 

X0

 

 

 

 

 

 

 

 

 

 

M1122

Sending request

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SET

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X0

 

 

 

 

H2000

D50

K2

 

 

 

 

 

 

 

 

 

MODRW

K1

K16

Data length(word)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Data storing register

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Data address: H2000

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Function code: K16

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

write in multiple Words

Receiving completed

 

 

 

 

 

 

 

 

 

 

 

 

Connection device

M1127

 

 

 

 

 

 

 

 

 

 

 

 

address: K1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Processing received data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ASCII mode: The received data is stored in D1070~D1085 in ASCII format

 

 

 

 

 

RTU mode: The received data is stored in D1070~D1085 in Hex

 

 

 

 

 

 

 

 

 

 

 

RST

M1127

Reset M1127

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ASCII mode (M1143 = OFF)

When X0 = ON, MODRW instruction executes the function specified by Function Code H10 PLC ÖVFD-B, PLC transmits: “01 10 2000 0002 04 1770 0012 30”

VFDÖPLC, PLC receives: “01 10 2000 0002 CD”

Registers for data to be sent (sending messages)

Register

 

Data

 

Descriptions

D1256

Low byte

‘0’

 

30 H

ADR 1

Address of VFD: ADR (1,0)

 

 

 

 

 

 

D1256

High byte

‘1’

 

31 H

ADR 0

 

 

 

 

 

 

 

 

D1257 Low byte

‘1’

 

31 H

CMD 1

Control parameter: CMD (1,0)

 

 

 

 

 

 

D1257

High byte

‘0’

 

30 H

CMD 0

 

 

 

 

 

 

 

 

 

D1258

Low byte

‘2’

 

32 H

Data Address

 

 

 

 

 

 

 

3 - 3 5 5

Page 471
Image 471
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Program Example 11 COM2 RS-485, Function Code H10, Ascii mode M1143 = OFF