High
−
level Instructions
3
−
96
Explanation of example
The contents of data register DT10 and data register DT1 are added together when trigger R0 turns on.
When H4 (BCD)is in DT1 and H8 (BCD) is in DT10, as shown below.
· ··
·
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 [D]: H8 (BCD)
· ··
·
Bit position
·
· ·
· ·
DT1
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 [S]: H4 (BCD)
· ··
·
Bit position
·
· ·
· ·
DT10
15
0 0 0
12
0
11
0 0 0
8
0
7
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 constant or 16-bit area for 4-digit BCD data specified by S and the 16-bit area for
4-digit BCD data specified by D are added together.
Augend data
Result
(D)
(D)
+
(S)
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
F41 (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-X
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 ...