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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3. Instruction Set<br />

API Mnemonic Operands Function<br />

39 SFRD P Shift Register Read<br />

Controllers<br />

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

SE<br />

<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 SFRD, SFRDP: 7 steps<br />

S * * * * * *<br />

D * * * * * * * *<br />

n * *<br />

PULSE 16-bit 32-bit<br />

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

<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 />

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

SE<br />

Operands:<br />

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

Explanation:<br />

1. This instruction defines the data stack of n words starting from S as a FIFO data stack and<br />

specifies the first device as the pointer (S). The content of pointer indicates current length of<br />

the stack. When SFRDP is executed, first data (S+1) will be read out to D, all data in this<br />

stack moves up to fill the read device and content in pointer minuses 1. When the content in<br />

pointer = 0, the instruction stops and carry flag M1022= ON<br />

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

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

Program Example:<br />

1. When X0 goes from OFF to ON, D9~D2 are all shifted to the right and the pointer D0 is<br />

decremented by 1 when the content of D1 is read and moved to D21.<br />

2. The figure below illustrates the shift and reading of the instruction.<br />

The content of D1 is read and moved to D21.<br />

D9~D2 are all shifted to the right.<br />

The content of D0 is decremented by 1.<br />

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

SE<br />

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

X0<br />

SFRDP D0 D21 K10<br />

n = 10 points<br />

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

Pointer<br />

Data read<br />

3-101

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

Saved successfully!

Ooh no, something went wrong!