17.03.2014 Views

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>DVP</strong>-<strong>ES2</strong>/<strong>EX2</strong>/<strong>SS2</strong>/<strong>SA2</strong>/<strong>SX2</strong>/SE <strong>Operation</strong> <strong>Manual</strong> - Programming<br />

API Mnemonic Operands Function<br />

38 SFWR P Shift Register Write<br />

Controllers<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

SE <strong>SX2</strong><br />

Type Bit Devices Word devices Program Steps<br />

OP X Y M S K H KnX KnY KnM KnS T C D E F SFWR, SFWRP: 7 steps<br />

S * * * * * * * * * * *<br />

D * * * * * *<br />

n * *<br />

PULSE 16-bit 32-bit<br />

<strong>SA2</strong><br />

<strong>SA2</strong><br />

<strong>SA2</strong><br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong><br />

SE<br />

SE<br />

SE<br />

Operands:<br />

S: Source device D: Head address of data stack n: Length of data stack<br />

Explanations:<br />

1. This instruction defines the data stack of n words starting from D as a “first-in, first out<br />

(FIFO)” data stack and specifies the first device as the pointer (D). When SFWRP is<br />

executed, content in pointer pluses 1, and the content in S will be written into the device<br />

designated by the pointer. When the content in pointer exceeds n-1, the instruction stops and<br />

carry flag M1022= ON.<br />

2. This instruction is generally used in pulse execution mode (SFWRP).<br />

3. Valid range of operand n: 2≤ n ≤512<br />

Program Example:<br />

1. First, reset the content of D0. When X0 goes from OFF to ON, the content of D0 (pointer)<br />

becomes 1, and D20 is written into D1. If the content of D20 is changed and X0 is triggered<br />

again, pointer D0 becomes 2, and the content of D20 is then written into D2.<br />

2. P The figure below illustrates the shift and writing process of the instruction.<br />

The content of D0 becomes 1.<br />

. The content of D20 is written into D1.<br />

<strong>SX2</strong><br />

X20<br />

RST<br />

D0<br />

Reset the content of D0 to 0 (zero) previously<br />

X0<br />

SFWRP D20 D0 K10<br />

D20<br />

n = 10 points<br />

D9 D8 D7 D6 D5 D4 D3 D2 D1 D0<br />

Pointer<br />

D0 = 3 2 1<br />

Points to note:<br />

This instruction can be used together with API 39 SFRD for the reading/writing of “first-in, first-out”<br />

stack data.<br />

3-100

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!