
High
−
level Instructions
3
−
100
Explanation of example
The contents of data register DT10 and data register DT20 are added to gether when trigger R0 turns on.
The added result is stored in data register DT30.
When H (BCD) 8 is in DT10 and H (BCD) 4 is in DT20, as shown below.
7
· ··
·
Bit position
·
· ·
· ·
DT10
15
0 0 0
12
0
11
0 0 0
8
0
7
0 0 0
4
0
3
1 0 0
0
0
Augend [S1]: H8 (BCD)
· ··
·
Bit position
·
· ·
· ·
DT20
15
0 0 0
12
0
11
0 0 0
8
0
7
0 0 0
4
0
3
0 1 0
0
0
Addend [S2]: H4 (BCD)
· ··
·
Bit position
·
· ·
· ·
DT30
15
0 0 0
12
0
11
0 0 0
8
0 0 0 0
4
1
3
0 0 1
0
0
Result [D]: H12 (BCD)
+
BCD H code
0
0
0
8
BCD H code
0
0
0
4
BCD H code
0
0
1
2
(Addition)
Description
The 4-digit BCD equivalent constants or 16-bit areas for 4-digit BCD data specified by S1 and S2 are added
together. The added result is stored in D.
Augend data
Result
(S1)
(D)
+
(S2)
Addend data
Precautions during programming
If the result of an arithmetic operation instruction does not fall within the range of values which can be
handled, an overflow will result.
Under normal circumstances, do not allow an overflow to occur.
If the calculated result accidentally overflows, use of the
F43 (DB+)
instruction (8-digit BCD data addition) is
recommended.
If an overflow occurs, the carry flag (special internal relay R9009) will turn on.
Flag conditions
・
Error flag (R9007): Turns on and stays on when:
・
Error flag (R9008): Turns on for an instant when:
−
The area specified using the index modifier exceeds the limit.
−
The data is not BCD data.
・
= flag (R900B):
Turns on for an instant when the calculated result is recognized as “0”.
・
Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 4-digit
BCD data (overflows).
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]
Summary of Contents for FP-E
Page 1: ...Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Page 2: ...Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Page 24: ...Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Page 1333: ...5 245 Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...