Panasonic FP-E Programming Manual page 328

Fp series
Table of Contents

Advertisement

High−level Instructions
Explanation of example
The contents of data registers DT10 and DT20 are added when trigger R0 turns on. The added result is
stored in data register DT30.
when the decimal number 8 is in DT10 and the decimal number 4 is in DT20, as shown below.
Augend [S1]: K8
Bit position
15
12
11
· · ·
0 0 0
0
0 0 0
DT10
Addend [S2]: K4
Bit position
15
12
11
· · ·
DT20
0 0 0
0
0 0 0
Result [D]: K12
Bit position
15
12
11
· · ·
DT30
0 0 0
0
0 0 0
Description
The 16-bit data or 16-bit equivalent constant specified by S1 and S2 are added together. The added result is
stored in D.
Augend data
(S1)
+
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 or underflow will result.
Under normal circumstances, do not allow an overflow or underflow to occur.
If the calculated result accidentally overflows or underflows, use of the F23 (D+) instruction (32-bit data
addition) is recommended.
When you use the F23 (D+) instruction instead of F22 (+), be sure to convert the 16-bit addend and augend
into 32-bit data using the F89 (EXT) instruction.
If an overflow or underflow occurs, the carry flag (special internal relay R9009) will turn on.
Flag conditions
・Error flag (R9007):
・Error flag (R9008):
・= flag (R900B):
・Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 16-bit
3 − 64
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: info@clrwtr.com
8
7
4
3
0
·
·
· ·
· ·
0
0 0 0
0
1 0 0
0
+
(Addition)
8
7
4
3
0
·
·
· ·
· ·
0
0 0 0
0
0 1 0
0
8
7
4
3
0
·
·
· ·
· ·
0
0 0 0
0
1 1 0
0
Addend data
(S2)
Turns on and stays on when the area specified using the index modifier
exceeds the limit.
Turns on for an instant when the area specified using the index modifier
exceeds the limit.
Turns on for an instant when the calculated result is recognized as "0".
data (overflows or underflows).
Result
(D)

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fp0Fp2Fp2shFp0rFrsFp10sh ... Show all

Table of Contents