3 . I n s t r u c t i o n S e t
M N050 03003E F or mo re infor ma tio n vi sit:
w w w. e a t o n . c o m
3-91
API Mnemonic
Operands
Function
38
SFWR P
S, D, n
Shift Register Write
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T
C D E
F
S
* * *
*
*
*
*
*
*
*
*
D
*
*
*
*
*
*
n
*
*
SFWR, SFWRP: 7 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P 32 16 P 32 16
P
Operands:
S
: Source address
D
: Starting address of data stack
n
: Length of data stack
Description:
1.
This instruction defines the data stack of
n
words starting with
D.
This first address of the
data stack is the pointer into the remainder of the data stack. When D=1, the value of S is
moved into position 1 of the data stack (when the instruction is executed the first time). D is
incremented with each execution of the instruction and should be reset when it reaches the
last element of the data stack. When the contents of the pointer (D) exceeds
n-1
, the
instruction stops and carry flag M1022= ON.
2.
This instruction works best with the pulse instruction (SFWRP).
3.
Valid range of operand
n
: 2
≤
n
≤
512
Program Example:
1.
First, X20=ON resets the contents of D0 to 0. When X0 goes from OFF to ON, the contents
of D0 becomes 1 and the contents of D20 is moved into D1. After changing the content of
D20, X0 goes from OFF to ON again, then the contents of D0 becomes 2 and the contents of
D20 is moved into D2.
2.
Please refer to the following
n
~
o
steps to perform SFWR instruction.
n
The content of D20 is created and built in D1.
o
The content of D0 becomes 1.
X20
RST
D0
D9
D8
D7
D6
D5
D4
D3
D2
D1
D0
D20
X0
SFWRP
D20
K10
D0
Reset the content of D0 to 0 (zero) previously
Pointer
n = 10 points
D0 = 3 2 1
Point to note:
The API 38 SFWR instruction can be used with the API 39 SFRD instruction create a first-in,
first-out (FIFO) application.
Summary of Contents for ELC-PB
Page 1: ......
Page 5: ...For more information visit www eaton com MN05003003E iv...
Page 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Page 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Page 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Page 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...