Panasonic FP-E Programming Manual page 336

Fp series
Table of Contents

Advertisement

High−level Instructions
Explanation of example
Subtracts the contents of data register DT20 from the contents of data register DT10 when trigger R0 turns
on. The subtracted result is stored in data register DT30.
Example 1: When the decimal number 16 is in DT10 and the decimal number
4 is in DT20.
Minuend [S1]: K16
Bit position
Subtrahend [S2]: K4
Bit position
Result [D]: K12
Bit position
Example 2: When the decimal number 3 is in DT10 and the decimal number
5 is in DT20.
Minuend [S1]: K3
Bit position
Subtrahend [S2]: K5
Bit position
Result [D]: K−2
Bit position
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 F28 (D−) instruction (32-bit data
subtraction) is recommended.
When you use the F28 (D−) instruction instead of F27 (−) be sure to convert the 16-bit subtrahend and
minuend 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.
3 − 72
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: info@clrwtr.com
15
12
11
· ·
· ·
DT10
0 0 0
0
0 0 0
15
12
11
· ·
· ·
DT20
0 0 0
0
0 0 0
15
12
11
· ·
· ·
DT30
0 0 0
0
0 0 0
15
1211
· ·
· ·
DT10
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
15
1211
· ·
· ·
DT20
0 0 0 0 0 0 0 0 0 0 0 0 0 1
15
1211
· ·
· ·
DT30
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
8
7
4
3
0
· ·
· ·
0
0 0 0
1
0 0 0
0
(Subtraction)
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
8 7
4 3
0
· ·
· ·
(Subtraction)
8 7
4 3
0
· ·
· ·
0
1
8 7
4 3
0
·
·
· ·

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fp0Fp2Fp2shFp0rFrsFp10sh ... Show all

Table of Contents