3. Instruction Set

API

150

Mnemonic

Operands

Function

Controllers

MODRW

 

MODBUS Read/ Write

ES2/EX2

SA2

SA2 SX2

 

 

SE

 

Type

Bit Devices

 

 

 

 

Word devices

 

 

 

 

 

 

Program Steps

 

OP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X

Y

M

S

K

H

KnX

KnY

KnM

KnS

T

C

D

E

 

F

MODRW: 11 steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S1

 

 

 

 

*

*

 

 

 

 

 

 

 

 

 

 

 

*

 

 

 

 

 

 

 

 

 

S2

 

 

 

 

*

*

 

 

 

 

 

 

 

 

 

 

 

*

 

 

 

 

 

 

 

 

 

S3

 

 

 

 

*

*

 

 

 

 

 

 

 

 

 

 

 

*

 

 

 

 

 

 

 

 

 

S

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*

 

 

 

 

 

 

 

 

 

n

 

 

 

 

*

*

 

 

 

 

 

 

 

 

 

 

 

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

16-bit

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

 

 

 

 

 

32-bit

 

 

 

 

 

 

 

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

 

 

 

 

 

 

 

 

SE

SE

SE

Operands:

S1: Device address (K1~K254) S2: Function code: K2(H2), K3(H3), K5(H5), K6(H6), K15(H0F) ,

K16(H10) S3: Data address S: Data register n: Data length.

Explanations:

 

 

 

 

 

1.

MODRW supports COM1 (RS-232), COM2 (RS-485), COM3 (RS-485). (COM3 is only

 

applicable to DVP-ES2/EX2/SA2/SE, and is not applicable to DVP-ES2-C.)

2.

S1: Address of the device to be accessed. Range: K1~K254.

3.

S2: Function code. H02: read multiple bit devices of DVP-PLC; H03: read multiple word

 

devices of AC motor drive or DVP-PLC; H05: force ON/OFF bit device; H06: write in single

 

word device of AC motor drive or DVP-PLC; H0F: write in multiple bit devices of DVP-PLC;

 

H10: write in multiple word devices of AC motor drive or DVP-PLC. Only these function codes

 

are available currently; other function codes are not executable. Please refer to the program

 

examples below for more information

 

 

 

4.

S3: Address of the data to be accessed. If the address is illegal for the designated

 

communication device, the communication device will respond with an error message and

 

DVP-PLC will store the error code and associated error flag will be ON.

 

z Associated registers and flags indicating errors on PLC com ports: (For detailed

 

 

information please refer to Points to note of API 80 RS instruction.)

 

 

 

 

 

 

 

 

 

 

PLC COM

COM1

 

COM2

COM3

 

 

 

Error flag

M1315

 

M1141

M1319

 

 

 

Error code

D1250

 

D1130

D1253

 

 

 

 

 

 

 

 

 

 

z For example, if 8000H is illegal for DVP-PLC, the error will be in indicated by different set

 

 

of flags and registers. For COM2, M1141 will be ON and D1130 = 2; for COM1, M1315 =

 

 

ON and D1250 = 3, for COM3, M1319 = ON and D1253 = 3. Please check the user

 

 

manual of DVP-PLC for error code explanations.

5.

S: Registers for storing read/written data. Registers starting from S stores the data to be

 

written into the communication device or the data read from the communication device. When

3 - 3 3 1

Page 447
Image 447
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Modrw, PLC COM COM1 COM2 COM3