Panasonic FP-E Programming Manual page 372

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.
When H (BCD) 16 is in DT10 and H (BCD) 4 is in DT20, as shown below.
Minuend [S1]: H16 (BCD)
Bit position
15
12
11
· · ·
DT10
0 0 0
0
0 0 0
BCD H code
0
Subtrahend [S2]: H4 (BCD)
Bit position
15
12
11
· · ·
0 0 0
0
0 0 0
DT20
BCD H code
0
Result [D]: H12 (BCD)
Bit position
15
12
11
· · ·
DT30
0 0 0
0
0 0 0
BCD H code
0
Description
Subtracts the 4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data specified by S2 from the
4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data specified by S1.
The subtracted result is stored in D.
Minuend data
Subtrahend 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 underflow will result.
Under normal circumstances, do not allow an underflow to occur.
If the calculated result accidentally underflows, use of the F48 (DB−) instruction (8−digit BCD data
subtraction) is recommended.
If an 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 4-digit
3 − 108
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
1
0 1 1
0
0
1
6
(Subtraction)
8
7
4
3
0
·
·
· ·
· ·
0
0 0 0
0
0 1 0
0
0
0
4
8
7
4
3
0
·
·
· ·
· ·
0 0 0 0
1
0 0 1
0
0
1
2
(S2)
Turns on and stays on when:
Turns on for an instant when:
− The area specified using the index modifier exceeds the limit.
− The data is not BCD data.
Turns on for an instant when the calculated result is recognized as "0".
BCD data (underflows).
Result
(D)

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fp0Fp2Fp2shFp0rFrsFp10sh ... Show all

Table of Contents