Binary Calculation Instructions; Binary Add - Adb(50) - Omron CQM1H - PROGRAM Programming Manual

Programmable controllers; inner boards
Table of Contents

Advertisement

Binary Calculation Instructions

5-22 Binary Calculation Instructions

5-22-1 BINARY ADD – ADB(50)
Limitations
Description
Flags
Example
TR 0
00000
25504
25504
328
Ladder Symbols
ADB(50)
@ADB(50)
Au
Ad
R
DM 6144 to DM 6655 cannot be used for R.
When the execution condition is OFF, ADB(50) is not executed. When the exe-
cution condition is ON, ADB(50) adds the contents of Au, Ad, and CY, and
places the result in R. CY will be set if the result is greater than FFFF.
Au + Ad + CY
ADB(50) can also be used to add 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 greater than FFFF.
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).
The following example shows a four-digit addition with CY used to place either
#0000 or #0001 into R+1 to ensure that any carry is preserved.
Au: Augend word (binary)
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Ad: Addend word (binary)
Au
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Ad
R
IR, SR, AR, DM, EM, HR, LR
CY
Address Instruction
00000
CLC(41)
00001
00002
ADB(50)
00003
010
DM 0100
HR 10
= R
00004
MOV(21)
00005
#0000
HR 11
= R+1
00006
MOV(21)
00007
#0001
00008
HR 11
= R+1
Section 5-22
Operand Data Areas
R: Result word
R
Operands
LD
OUT
TR
CLC(41)
ADB(50)
DM
HR
AND NOT
MOV(21)
#
HR
LD
TR
AND
MOV(21)
#
HR
00000
0
010
0100
10
25504
0000
11
0
25504
00001
11

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CQM1H - PROGRAM and is the answer not in the manual?

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents

Save PDF