Binary Subtract - Sbb(51) - Omron CQM1H - PROGRAM Programming Manual

Programmable controllers; inner boards
Table of Contents

Advertisement

Binary Calculation Instructions
5-22-2 BINARY SUBTRACT – SBB(51)
Limitations
Description
Flags
In the case below, A6E2 + 80C5 = 127A7. The result is a 5-digit number, so
CY (SR 25504) = 1, and the content of R + 1 becomes #0001.
Note For signed binary calculations, the status of the UF and OF flags indicate
whether the result has exceeded the signed binary data range (–32,768
(8000) to +32,767 (7FFF)).
Ladder Symbols
SBB(51)
Mi
Su
R
DM 6144 to DM 6655 cannot be used for R.
When the execution condition is OFF, SBB(51) is not executed. When the exe-
cution condition is ON, SBB(51) subtracts the contents of Su and CY from Mi
and places the result in R. If the result is negative, CY is set and the 2's com-
plement of the actual result is placed in R.
SBB(51) can also be used to subtract signed binary data. The Overflow and
Underflow Flags (SR 25404 and SR 25405) indicate whether the result has
exceeded the lower or upper limits of the 16-bit signed binary data range.
ER:
Indirectly addressed EM/DM word is non-existent.
(Content of *EM/*DM word is not BCD, or the EM/DM area boundary
has been exceeded.)
CY:
ON when the result is negative, i.e., when Mi is less than Su plus CY.
EQ:
ON when the result is 0.
OF:
ON when the result exceeds +32,767 (7FFF).
UF:
ON when the result is below –32,768 (8000).
Au: IR 010
A
Ad: DM 0100
+
8
R+1: HR 11
R: HR 10
0
0
0
1
2
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
@SBB(51)
Mi
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Su
R
Mi − Su − CY
Section 5-22
6
E
2
0
C
5
7
A
7
Operand Data Areas
Mi: Minuend word (binary)
Su: Subtrahend word (binary)
R: Result word
IR, SR, AR, DM, EM, HR, LR
CY
R
329

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents