Справочник Пользователя для Mitsubishi Electronics FX

Скачать
Страница из 382
FX Series Programmable Controlers
Applied Instructions 5
5-45
5.5.4
SUM (FNC 43)
Operation:
The number of active (ON) bits within the source
device (S), i.e. bits which have a value of “1" are
counted. The count is stored in the destination
register (D). If a double word format is used, both the
source and destination devices use 32 bit, double
registers. The destination device will always have its
upper 16 bits set to 0 (zero) as the counted value can
never be more than 32.
If no bits are ON then zero flag, M8020 is set.
5.5.5
BON (FNC 44)
Operation:
A single bit position (n) is specified from within a
source device/area (S). n could be regarded as a
specified offset from the source head address (S),
i.e. 0 (zero) being the first device (a 0 offset) where
as an offset of 15 would actually be the 16th device.
If the identified bit becomes active, i.e. ON, the
destination device (D) is activated to “flag” the new
status.
The destination device could be said to act as a
mirror to the status of the selected bit source.
Mnemonic
Function 
Operands
Program steps
S
D
SUM
FNC 43
(
Sum of
active bits)
The number
(quantity) of
active bits in the
source data is
stored in the
destination device
K, H,
KnX, KnY, KnM, KnS,
T, C, D, V, Z
KnY, KnM, KnS,
T, C, D, V, Z 
SUM,SUMP:
7 steps
DSUM,
DSUMP:
9 steps
Mnemonic
Function 
Operands
Program steps
S
D
n
BON
FNC 44
(
Check
specified
bit status)
The status of the
specified bit in the
source device is
indicated at the
destination
K, H,
KnX, KnY,
KnM, KnS,
T, C, D, V,
Z
Y, M, S
K,H,
Note:
16 bit operation 
               n=0 to 15
32 bit operation 
               n=0 to 31
BON, BONP:
7steps
DBONP,
DBON:
13 steps
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
FLAGS Zero M8020
X0
D 2
[ S ]
[ D ]
D 0
SUM
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
b15
b0
D 0
8 4 2 1
. .
D 2
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
X0
M 0
K 15
[ S ]
[ D ]
D 10
[ n ]
BON
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
b15
b0
D 10
0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
b15 = 0, M0 = 0
b15 = 1, M0 = 1