High−level Instructions
3 − 103
Outline Subtracts one BCD data item that expresses a 4-digit decimal number
(4-digit BCD H codes) from another (minuend).
For the FP0R/FPΣ/FP−X/FP0/FP−e, the P type high−level instruction
“P45 (PB−)” is not available.
Program example
Boolean
Ladder Diagram
Address Instruction
10
F45 B−, DT10 , DT20
S
D
Trigger
R0
10
11
ST R 0
F45 (B−)
DT 10
DT 20
S 4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data (for subtrahend)
D 16-bit area for 4-digit BCD data (for minuend and result)
Operands
modifier
S A A A A A A A A A A A K A A
D N/A A A A A A A A A A A N/A N/A A
(*1) This cannot be used with the FP0 and FP−e.
(*2) This cannot be used with the FP0, FP−e, FP0R, FPΣ, FP−X.
(*3) With the FP0R, FPΣ,FP−X, FP2, FP2SH, and FP10SH, this is I0 to IC.
(*4) With the FP0R, FPΣ,FP−X, FP2, FP2SH, and FP10SH, this is ID.
Explanation of example
Subtracts the contents of data register DT10 from the contents of data register DT20 when trigger R0 turns
on. When H (BCD) 16 is in DT20 and H (BCD) 4 is in DT10, as shown below.
····
Bit position
·····
DT20
15
000
12
0
11
000
8
0
7
000
4
1
3
011
0
0
Minuend [D]: H16 (BCD)
····
Bit position
·····
DT10
15
000
12
0
11
000
8
0
7
000
4
0
3
010
0
0
Subtrahend [S]: H4 (BCD)
····
Bit position
·····
DT20
15
000
12
0
11
000
8
0
7
000
4
1
3
001
0
0
Result [D]: H12 (BCD)
BCD H code
0016
BCD H code
0004
BCD H code
0012
−
(Subtraction)
F45
P45
(PB−)
(B−)
4-digit BCD data subtraction
[D − S → D]
A: Available
N/A: Not Available
K: K0 to K9