![background image](http://html1.mh-extra.com/html/omron/sysmac-c200hs/sysmac-c200hs_operation-manual_742436216.webp)
206
Example
If 00002 is ON, the program represented by the following diagram clears CY with
CLC(41), adds the content of LR 25 to a constant (6103), places the result in DM
0100, and then moves either all zeros or 0001 into DM 0101 depending on the
status of CY (25504). This ensures that any carry from the last digit is preserved
in R+1 so that the entire result can be later handled as eight-digit data.
TR 0
MOV(21)
#0001
DM 0101
00002
CLC(41)
ADD(30)
LR 25
#6103
DM 0100
MOV(21)
#0000
DM 0101
25504
25504
Address
Instruction
Operands
00000
LR
00002
00001
OUT
TR
0
00002
CLC(41)
00003
AND(30)
LR
25
#
6103
DM
0100
00004
AND
25504
00005
MOV(21)
#
0001
DM
0101
00006
LD
TR
0
00007
AND NOT
25504
00008
MOV(21)
#
0000
DM
0101
Although two ADD(30) can be used together to perform eight-digit BCD addition,
ADDL(54) is designed specifically for this purpose.
5-19-6
DOUBLE BCD ADD – ADDL(54)
Au: First augend word (BCD)
IR, SR, AR, DM, HR, TC, LR
Ad: First addend word (BCD)
IR, SR, AR, DM, HR, TC, LR
Ladder Symbols
Operand Data Areas
R: First result word
IR, SR, AR, DM, HR, LR
ADDL(54)
Au
Ad
R
@ADDL(54)
Au
Ad
R
Limitations
Each of the following pairs must be in the same data area: Au and Au+1, Ad and
Ad+1, and R and R+1.
Description
When the execution condition is OFF, ADDL(54) is not executed. When the exe-
cution condition is ON, ADDL(54) adds the contents of CY to the 8-digit value in
Au and Au+1 to the 8-digit value in Ad and Ad+1, and places the result in R and
R+1. CY will be set if the result is greater than 99999999.
Au + 1
Au
Ad + 1
Ad
R + 1
R
+
CY
CY
BCD Calculations
Section 5-19
Содержание SYSMAC C200HS
Страница 1: ...Cat No W235 E1 05 C200HS SYSMAC Programmable Controllers...
Страница 2: ...C200HS Programmable Controllers Operation Manual Revised February 2002...
Страница 3: ...iv...
Страница 5: ...vi...
Страница 379: ...371 SR word Corresponding key s Bit 279 03 04 05 3 06 07 VER 08 09 Monitoring Operation and Modifying Data Section 7 1...
Страница 470: ...468 Programmer Program Date Page Word Contents Notes Word Contents Notes Data Storage...
Страница 471: ...469 Programmer Program Date Page TC address T or C Set value Notes TC address T or C Set value Notes Timers and Counters...