572
Table Data Processing Instructions Section 3-16
After PUSH(632) has been used to write data into a stack, FIFO(633) and
LIFO(634) can be used to read data from the stack.
Flags
Precautions The stack must be defined in advance with SSET(630).
Examples When CIO 0.00 is ON in the following example, PUSH(632) copies the con-
tent of D200 to the stack beginning at D0. In this case, the stack pointer indi-
cates D7.
m
n
n
m
D
D+1
D+2
D+3
S
m
m+1
n
n
m+1
D
D+1
D+2
D+3
A
A
A
PLC memory
address
PLC memory
address
Write A.
Pointer
Pointer
Increment
pointer by 1.
Name Label Operation
Error Flag ER ON if the address specified by the stack pointer (TB+3
and TB+2) exceeds the last word in the stack.
(This is a stack overflow error.)
OFF in all other cases.
0.00
D0
D200
D200
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
PLC memory address
Write A.
Last word
in stack
Stack
pointer
PLC memory address
of last word in stack
Stack pointer
A
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
PLC memory address
After the data is written to
D7, the stack pointer is
incremented by one.
PLC memory address
of last word in stack
Stack pointer
Last word
in stack