EasyManuals Logo
Home>Omron>Controller>CJ - INSTRUCTIONS

Omron CJ - INSTRUCTIONS User Manual

Omron CJ - INSTRUCTIONS
1308 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #399 background imageLoading...
Page #399 background image
361
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Symbol Math Instructions
3
–/–L
Subtraction at (1)
Subtraction at (2)
Final Subtraction Result
Example Programming
If the result of the subtraction is a negative number (Mi<Su or Mi+1, Mi <Su+1, Su), the result is output
as the 2's complement and the Carry Flag (CY) will turn ON to indicate that the result of the subtraction
is negative. To convert the 2's complement to the true number, an instruction which subtracts the result
from 0 is necessary using the Carry Flag (CY) as an execution condition.
2
B
−
0
8
F
A
5
3
5
6
A
0
1
E
0
3
Mi+1: CIO 201
CY
Mi: CIO 200
Su+1: CIO 121 Su: CIO 120
6 8 5 1 F 9 2 D1
R+1: D101 R+1: D100
The Carry Flag (CY) is ON, so the result is subtracted from 0000 0000 to
obtain the actual number.
0
−
0 0 0 0 0 0 0
CY
Su+1: D101 Su: D100
9 7 A E 0 6 D 31
R+1: D101 R+1: D100
6 8 5 1 F 9 2 D
−
CY
9 7 A E 0 6 D 31
R+1: D101 R+1: D100
6 8 5 1 F 9 2 D
Mi+1: CIO 201 Mi: CIO 200
2 0 F 5 5 A 1 0
Su+1: D101 Su: D100
The Carry Flag (CY) is turned ON, so the actual number is –97AE06D3.
Because the content of D101 and D100 is negative, CY is used to turn
ON CIO 21.00 to indicate this.
−
D100
D110
D120
0.00
When CIO 0.00 is ON in the following example, D110 will be
subtracted from D100 as 4-digit signed binary values and the
result will be output to D120.
−L
D100
D110
D120
0.00
When CIO 0.00 is ON in the following example, D111 and D110
will be subtracted from D101 and D100 as 8-digit signed binary
values and the result will be output to D121 and D120.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron CJ - INSTRUCTIONS and is the answer not in the manual?

Omron CJ - INSTRUCTIONS Specifications

General IconGeneral
BrandOmron
ModelCJ - INSTRUCTIONS
CategoryController
LanguageEnglish

Related product manuals