
Chapter 6 Instruction Details
XBC E-Type Main Unit
6-162
Ver. 1
6.28.2 SUB, SUBP, DSUB, DSUBP
Instruction
Area Available
Step
Flag
P M K F L T C S Z D.x R.x
Co
nst.
U N D R
Error
(F110)
Zero
(F111)
Carry
(F112)
SUB(P)
DSUB(P)
S1 O O O O O O O - O -
- O O O O O
4~6
-
-
-
S2 O O O O O O O - O -
- O O O O O
D O O O - O O O - O -
-
- O O O O
Operand
Description
Data Type
S1
Data to be subtracted from S2
INT/DINT
S2
Data to be subtracted from S1
INT/DINT
D
Address to save operation result in
INT/DINT
1) SUBU (Signed Binary Subtract)
(1) Saves the result of word data S1 minus S2 in D (16-bit).
(2) Performs Signed Operation.
(3) If operation result is over 32,767(h7FFF) or below -32,768(hFFFF), Carry Flag will not be set.
5678 (BIN)
b15
b0
D
1234 (BIN)
b15
b0
S
-
4444 (BIN)
b15
b0
D
2) DSUBU (Signed Binary Double Subtract)
(1) Saves the result of word data S1 minus S2 in D.
(2) Performs Signed Operation.
(3) If operation result is over 2,147,483,647 (h7FFFFFFF) or below -2,147,483,648(hFFFFFFFF), Carry
Flag will not be set.
-
b0
567890 (BIN)
b15
D
b16
b31
D+1
b0
123456 (BIN)
b15
S
b16
b31
S+1
b0
444434 (BIN)
b15
D
b16
b31
D+1
3) Program Example
(1) For P1000=‘200’ and P1100=‘100’, Input Signal P00000 is changed from Off to On status, the result of
subtracted ‘100’ will be saved in P1200.
SUB P1000 P1100 P1200
P00000
(D)SUB
P S1 S2
(D)SUBP
S1 S2
means
SUB/DSUB
D
D
Содержание XBC-DN10E
Страница 1: ......
Страница 10: ...Table of Contents Table of Contents 6 10 10 CLEAR ALL PLC 29...
Страница 52: ...Chapter 3 Installation and Wiring XBC E Type Main Unit 3 24 Ver 1 3 7 2 XBC DR10E 4 point relay output...
Страница 54: ...Chapter 3 Installation and Wiring XBC E Type Main Unit 3 26 Ver 1 3 7 3 XBC DN10E 4 point transistor output...
Страница 56: ...Chapter 3 Installation and Wiring XBC E Type Main Unit 3 28 Ver 1 3 7 4 XBC DR14E 6 point relay output...
Страница 58: ...Chapter 3 Installation and Wiring XBC E Type Main Unit 3 30 Ver 1 3 7 5 XBC DN14E 6 point transistor output...
Страница 60: ...Chapter 3 Installation and Wiring XBC E Type Main Unit 3 32 Ver 1 3 7 6 XBC DR20E 8 point relay output...
Страница 62: ...Chapter 3 Installation and Wiring XBC E Type Main Unit 3 34 Ver 1 3 7 7 XBC DN20E 8 point transistor output...
Страница 64: ...Chapter 3 Installation and Wiring XBC E Type Main Unit 3 36 Ver 1 3 7 8 XBC DR30E 12 point relay output...
Страница 66: ...Chapter 3 Installation and Wiring XBC E Type Main Unit 3 38 Ver 1 3 7 9 XBC DN30E 12 point transistor output...