Toshiba PROSEC T1-16S User Manual page 152

Programmable controller basic hardware and function
Hide thumbs Also See for PROSEC T1-16S:
Table of Contents

Advertisement

7. Instructions
FUN 036
-C
Expression
Input
[ A -C B
C ]
Function
When the input is ON, the data of B and the carry flag (CF = S050) are subtracted from A, and the
result is stored in C. If borrow is occurred in the operation, the carry flag is set to ON. If the result is
greater than 32767 or smaller than -32768, the output is turned ON.
This instruction is used to perform unsigned subtraction or double-length subtraction.
Execution condition
Input
OFF
No execution
ON
Execution
Normal
Overflow /
underflow
Operand
Name
X
A Minuend
B Subtrahend
C Difference
Example
When R013 is ON, the data of double-length register RW23 RW22 is subtracted from the data
of D0201 D0200, and the result is stored in D0211 D0210. The RSTC is a instruction to reset
the carry flag before starting the calculation.
If the data of D0201 D0200 is 12345678 and RW23 RW22 is 12340000, the result 5678 is
stored in D0211 D0210.
D0201 D0200 12345678
RW23 RW22
12340000
150
T1-16S User's Manual
Subtraction with carry
Output
Operation
No borrow
Borrow occurred
No borrow
Borrow occurred
Device
Y
R
S
T.
C. XW YW RW SW T
-
Output
CF
OFF
OFF
Reset
OFF
Set
ON
Reset
ON
Set
Register
C
D
I
J
D0211 D0210
6F3B0253
Constant Index
K
5678

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents