Advanced Function Instruction
7-97
FUN111
D
P
STACK
STACK
FUN111
D
P
STACK
z
When no data has yet been pushed into the stack or the pushed in data has already been popped out (Pr = 0),
the stack empty flag "EPT" will set to 1. In this case any further pop up actions, will be ignored. If more data is
pushed than popped out, sooner or latter the stack will be full (pointer Pr points to ST
L
position), and the stack
full flag "FUL" will set to 1. In this case any further push actions, will be ignored. As with queue, the stack
pointer in normal case should not be changed by other instructions. If there is a special application which
requires to set the Pr value, then its effective range is 0 to L (0 means empty, 1 to L respectively correspond to
ST
1
to ST
L
). Beyond this range, the pointer error flag "ERR" will set to 1, and the instruction will not be carried
out.
X0
EN
Pr :
R 20
L :
OW :
I/O
10
R 2
IW :
R 1
FUL
ERR
EPT
X1
R 0
111P.STACK
ST :
z
The program at left assumes that the initial content of the
stack is just as in the diagram of a stack on the
preceding page. The operation illustrated in this example
is to push a data and than pop it from stack. The results
are shown below. Under any circumstances, Pr always
point to the data that was most recently pushed into the
stack.
Pr
Pr
5
R1
4
ST
QU
ST1
1 1 1 1
R2 ST1
1 1 1 1
R2
ST2
2 2 2 2
R3 ST2
2 2 2 2
R3
ST3
3 3 3 3
R4 ST3
3 3 3 3
R4
ST4
4 4 4 4
R5
OW
ST4
4 4 4 4
R5
OW
ST5
5 5 5 5
R6
××××
R20
ST5
R6
5 5 5 5
R20
ST6 R7
↑
ST6
R7
ST7 R8
OW unchanged
ST7
R8
ST8 R9
ST8
R9
ST9 R10
ST9
R10
ST10 R11
ST10
R11
After push(X1=1
,
X0 from 0
→
1)
After pop up(X1=0
,
X0 from 0
→
1)
Содержание FBs-CBE
Страница 78: ...MEMO ...
Страница 111: ...4 6 X0 X1 Node A Y0 Y1 Node B differential down Incerse differential up t Scan time Inverse t t ...
Страница 141: ...Basic Function Instruction 6 16 FUN 2 SKP SKIP START FUN 2 SKP Y2 Y1 Y0 T201 10S X0 X1 X2 0 10 0 ...
Страница 305: ...MEMO ...
Страница 348: ...MEMO ...