DVP - ES2/EX2/SS2/SA2/SX2/SE Operation Manual - Programming

API

38

Mnemonic

Operands

Function

Controllers

SFWR

P

Shift Register Write

ES2/EX2

SS2

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

SFWR, SFWRP: 7 steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S

 

 

 

 

 

 

*

*

*

*

*

 

*

 

*

*

*

 

*

*

 

 

 

 

 

 

D

 

 

 

 

 

 

 

 

 

*

*

 

*

 

*

*

*

 

 

 

 

 

 

 

 

 

n

 

 

 

 

 

 

*

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

 

 

 

16-bit

 

 

 

 

32-bit

 

 

 

 

 

 

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

 

SA2

SX2

ES2/EX2

SS2

 

SA2

SX2

 

 

 

 

 

 

SE

 

SE

 

SE

Operands:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S: Source device D: Head address of data stack

 

n: Length of data stack

 

 

Explanations:

1.This instruction defines the data stack of n words starting from D as a “first-in, first out (FIFO)” data stack and specifies the first device as the pointer (D). When SFWRP is executed, content in pointer pluses 1, and the content in S will be written into the device designated by the pointer. When the content in pointer exceeds n-1, the instruction stops and carry flag M1022= ON.

2.This instruction is generally used in pulse execution mode (SFWRP).

3.Valid range of operand n: 2≤ n ≤512

Program Example:

1.First, reset the content of D0. When X0 goes from OFF to ON, the content of D0 (pointer) becomes 1, and D20 is written into D1. If the content of D20 is changed and X0 is triggered again, pointer D0 becomes 2, and the content of D20 is then written into D2.

2.P The figure below illustrates the shift and writing process of the instruction. n The content of D0 becomes 1.

o. The content of D20 is written into D1.

X20

X0

D20

RST

 

 

D0

Reset the content of D0 to 0 (zero) previously

SFWRP

D20

D0

K10

 

 

 

 

 

 

 

 

 

 

 

 

n = 10 points

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

D9

D8

 

D7

D6

 

D5

D4

D3

D2

D1

D0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Pointer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

D0 = 3

2

1

Points to note:

This instruction can be used together with API 39 SFRD for the reading/writing of “first-in, first-out” stack data.

3 - 100

Page 216
Image 216
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual KnX KnY KnM KnS SFWR, Sfwrp 7 steps