beautypg.com

Delta Electronics Programmable Logic Controller DVP-PLC User Manual

Page 233

background image

6 Application Instructions API 00-49

DVP-PLC Application Manual

6-21

API Mnemonic

Operands

Function

13

SMOV P

Shift Move

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

1

*

*

m

2

*

*

D

*

*

*

*

*

*

*

*

n

*

*

SMOV, SMOVP: 11 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

: Source of data m

1

: Start digit to be moved of the source data m

2

: Number of digits (nibbles) to be moved of the

source data D: Destination device n: Start digit of the destination position for the moved digits

Explanations:

1.

This instruction is able to re-allocate or combine data.

When the instruction is executed, m

2

digits of contents

starting from digit m

1

(from high digit to low digit) of S will be sent to m

2

digits starting from digit n (from high digit

to low digit) of D.

2. Range:

m

1

= 1 ~ 4; m

2

= 1 ~ m

1

; n = m

2

~ 4

3.

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

4.

M1168 is designated by SMOV working mode. When M1168 = On, the program is in BIN mode. When M1168 =

Off, the program is in BCD mode.

Program Example 1:

1.

When M1168 = Off (in BCD mode) and X0 = On, the 4

th

(thousand) and 3

rd

(hundred) digit of the decimal value

in D10 start to move to the 3

rd

(hundred) and 2

nd

(ten) digit of the decimal value in D20. 10

3

and 10

0

of D20

remain unchanged after this instruction is executed.

2.

When the BCD value exceeds the range of 0 ~ 9,999, PLC will determine an operation error and will not execute

the instruction. M1067, M1068 = On and D1067 records the error code OE18 (hex).

M1168

10

3

10

2

10

1

10

0

10

3

10

2

10

1

10

0

Unchanged

Unchanged

D10(BIN 16 bits)

D10(BCD 4 digits)

D20(BIN 16 bits)

D20(BCD 4 digits)

Shift move

Auto conversion

Auto conversion

M1001

X0

SMOV

D10

K2

D20

K3

K4

Before the execution, assume D10 = K1234 and D20 = K5678. After the execution, D10 will remain unchanged and

D20 will become K5128.