beautypg.com

Delta Electronics Programmable Logic Controller DVP-PLC User Manual

Page 470

background image

8 Application Instructions API 100-149

DVP-PLC Application Manual

8-68

API Mnemonic

Operands

Function

149

D MEMW P

Write File Register

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

*

*

*

n

*

*

*

MEMW, MEMWP: 7 steps
DMEMW, DMEMWP: 13 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

: Device for storing the written data (starting from the designated D) m: Address in the file register to be written

n

: Number of data to be written at a time

Explanations:

1. Range

of

S

: D2000 ~ D4999 (SA/SX/SC); D2000 ~ D9999 (EH/EH2/SV)

2. Range

of

m

: K0 ~ K1,599 (SA/SX/SC); K0 ~ K9,999 (EH/EH2/SV)

3. Range

of

n

: For 16-bit instruction K1 ~ K1,600 (SA/SX/SC), K1 ~ K8,000 (EH/EH2/SV); For 32-bit instruction K1

~ K800 (SA/SX/SC), K1 ~ K4,000 (EH/EH2/SV)

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

5. Flag: M1101. See explanations below.

6. SA/SX/SC/EH/EH2/SV uses this instruction to read the data in data registers and write them into file registers.

7. SA/SX/SC offers 1,600 16-bit file registers.

8. m and n of SA/SX/SC do not suppot E and F index register modification.

9. EH/EH2/SV offers 10,000 16-bit file registers.

10. If S, m and n fall without their range, operation error will occur. M1067, M1068 = On and D1067 will record the

error code H’0E1A.

Program Example:

1. When X0 = On, the 32-bit instruction DMEMW writes 100 32-bit data starting from D2001 and D2000 into

address 0 ~ 199 in the file register.

2. When X0 = On, the instruction will be executed. When X0 = Off, the instruction will not be executed and the

previously data written in will remain unchanged.

X0

DMEMW

D2000

K0

K100

File Register:

1. EH/EH2/SV: When the PLC is powered, it will decide whether to automatically send the data in the file register

to the designated data register by M1101 (whether to enable the function of file register), D1101 (start address

in file register K0 ~ K9,999), D1102 (number of data to be read in file register K1 ~ k8,000), and D1103 (device

for storing read data, starting from designated D, K2,000 ~ K9,999).

2. In EH/EH2/SV, the reading of data from file register to data register D will not be executed if D1101 < 0, D1101