Advanced Function Instruction
7-94
FUN110
D
P
QUEUE
QUEUE
FUN110
D
P
QUEUE
IW : Data pushed into queue, can be a constant
or a register
QU : Starting register of queue
L : Size of queue
Pr : Pointer register
OW : Register accepting data popped out
from queue
QU may combine with V, Z, P0~P9 to serve
indirect address application
WX
WY
WM
WS TMR CTR
HR
IR
OR
SR
ROR
DR
K
XR
Range
Ope-
rand
WX0
∣
WX240
WY0
∣
WY240
WM0
∣
WM1896
WS0
∣
WS984
T0
∣
T255
C0
∣
C255
R0
∣
R3839
R3840
∣
R3903
R3904
∣
R3967
R3968
∣
R4167
R5000
∣
R8071
D0
∣
D4095
16/32-bit
+/- number
V
、
Z
P0~P9
IW
○
○
○
○
○
○
○
○
○
○
○
○
○
QU
○
○
○
○
○
○
○
○
○
*
○
○
L
○
○
*
○
2~256
Pr
○
○
○
○
○
○
○
○
*
○
*
○
OW
○
○
○
○
○
○
○
○
*
○
*
○
z
Queue is also a kind of table. It is different from ordinary table in that its queue register numbers go from 1 to L
and not from 0 to L-1. In other words QU
1
~QU
L
respectively correspond to pointers Pr = 1 to L, and Pr = 0 is
used to show that the queue is empty.
z
Queue is a first in first out (FIFO) device, i.e. - the data that first pushed into the queue will be the first to pop
out from the queue. A queue is comprised of L consecutive 16 or 32 bit registers (
D
instruction) starting from
the QU register, as in the diagram below:
Pr
4
IW
QU
g
5555
QU1
f
4444
QU2
e
3333
QU3
d
2222
QU4
c
1111
OW
QU5
××××
c
~
g
is the sequence number of
operation
QU
L
z
When execution control "EN" = 1 or "EN
↑
" (
P
instruction) has a transition from 0 to 1, the status of in/out
control "I/O" determines whether the IW data will be pushed into the queue (when "I/O" = 1) or be popped out
and transferred to OW (when "I/O" = 0). As shown in the diagram above, the IW data will always be pushed
into the first (QU1) register of the queue. After it has been pushed in, Pr will immediately be increased by 1, so
that the pointer can always point to the first data that was pushed into the queue. When it is popped out, the
data pointed by Pr will be transferred directly to OW. Pr will be reduced by 1, so that it still point to the first data
remained in the queue.
push(I/O=1)
1.IW always push into
QU1
2.Pr
+
1
→
Pr
Push
down
Pop out(I/O=0)
2. QUpr
→
OW
3. Pr
-
1
→
Pr
… …
Содержание 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 ...