![FATEK FBs Series Скачать руководство пользователя страница 198](http://html1.mh-extra.com/html/fatek/fbs-series/fbs-series_manual_3764826198.webp)
Advanced Function Instruction
7 -3 4
FUN 57
P
DECOD
DECODE
FUN 57
P
DECOD
S :
D :
EN
Decode control
Ladder symbol
57P.DECOD
Ns :
ERR
Range error
N :
L
S : Source data register to be decoded
(16 bits)
N
S
: Starting bits to be decoded within S
N
L
: Length of decoded value (1~8 bits)
D : Starting register storing decoded results
(2~256 points = 1~16 words)
S, N
S
, N
L
, D 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-bit
+/- number
V
、
Z
P0~P9
S
○
○
○
○
○
○
○
○
○
○
○
○
○
○
N
S
○
○
○
○
○
○
○
○
○
○
○
○
0
~
15
○
N
L
○
○
○
○
○
○
○
○
○
○
○
○
1
~
8
○
D
○
○
○
○
○
○
○
○
*
○
*
○
○
●
This instruction, will set a single bit among the total of 2
NL
discrete points (D) to 1 and the others bit are set to
0. The bit number to be set to 1 is specified by the value comprised by B
N
S
~
B
N
S
+N
L
−
1 of S
(
which is called
the decode value, B
N
S
is the starting bit of the decode value, and B
N
S
+N
L
−
1 is the end value
)
,.
●
When decode control "EN" = 1 or "EN
↑
" (
P
instruction) has a transition from 0 to 1, will take out the value
B
N
S
~
B
N
S
+N
L
−
1 from S. And with this value to locate the bit position and set D accordingly, and set all the
other bit to zero
●
This instruction only provides 16 bit operand, which means S only has B0~B15. Therefore the effective range
of Ns is 0~15, and the N
L
length of the decode value is limited to 1~8 bits. Therefore the width of the decoded
result D is 2
1
~
8
points = 2~256 points = 1~16 words (if 16 points are not sufficient, 1 word is still occupied). If
the value of N
S
or N
L
is beyond the above range, will set the range-error flag "ERR" to 1, and do not carry out
this instruction.
●
If the end bit value exceeds the B15 of S, then will extend toward B0 of S + 1. However if this occurs then
S+1 can’t exceed the range of specific type of operand (ie. If S is of D type register then S+1 can’t be D3072).
If violate this, then this instruction only takes out the bits from starting bit B
N
s to its highest limit as the decode
value.
X0
EN
S :
Ns : 3
R 2
57P.DECOD
ERR
D :
WX 0
N
L
: 5
z
The instruction at left takes out the data of five
successive bits from X3 to X7 within the WX0
register and decodes it. The results are then stored
in the 32-bit register starting at R2.
X15
X7
X3
X0
S 0 0 1 1 0 0 0 0 0 1 0 0 1 1 1 0
Length of decode value N
L
=5,so bit value is formed by X7~X3 (equal 9)
Ø
X0
=
R3
R2
D 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
B31
B9
B0
Because N
L
=5,the width of D is 2
5
= 32 point = 2 word. That is, D is formed by R3R2, and the decoded value is
01001=9, therefore B9 (the 10th point) within D is set to 1, and all other points are 0.
Содержание FBs Series
Страница 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 ...