Other Instructions - Omron CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 Reference Manual

Programmable controllers
Hide thumbs Also See for CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009:
Table of Contents

Advertisement

3. Instructions

Other Instructions

STC/CLC
Instruction
SET CARRY
CLEAR CARRY
Symbol
Applicable Program Areas
Function block
Area
definitions
Usage
OK
Flags
Operand
Error Flag
ER
Equals Flag
=
Carry Flag
CY
Negative Flag
N
*1 In CJ2, CS1-H, CJ1-H, CJ1M, and CS1D (for Single-CPU System) CPU Units, these Flags are left unchanged.
In CS1 and CJ1 CPU Units, these Flags are turned OFF.
Function
STC
When the execution condition is ON, STC(040) turns ON the Carry Flag (CY). Although STC(040) turns
the Carry Flag ON, the flag will be turned ON/OFF by the execution of subsequent instructions which
affect the Carry Flag.
ROL(027), ROLL(572), ROR(028), and RORL(573) make use of the Carry Flag in their rotation shift
operations. When using any of these instructions, use STC(040) and CLC(041) to set and clear the
Carry Flag.
CLC
When the execution condition is ON, CLC(040) turns OFF the Carry Flag (CY). Although CLC(040)
turns the Carry Flag OFF, the flag will be turned ON/OFF by the execution of subsequent instructions
which affect the Carry Flag.
+C(402), +CL(403), +BC(406), +BCL(407), -C(412), -CL(413), -BC(416), and -BCL(417) make use of
the Carry Flag in their addition operations. Use CLC(041) just before any of these instructions to
prevent any influence from other preceding instructions.
ROL(027), ROLL(572), ROR(028), and RORL(573) make use of the Carry Flag in their rotation shift
operations. When using any of these instructions, use STC(040) and CLC(041) to set and clear the
Carry Flag.
Hint
The +(400), +L(401), +B(404), +BL(405), -(410), -L(411), -B(414), and -BL(415) instructions do no
include the Carry Flag in their addition and subtraction operations. In general, use these instructions
when performing addition or subtraction.
992
Mnemonic
Variations
STC
@STC
CLC
@CLC
STC
STC(040)
Block program areas
Step program areas
OK
OK
Description
1
Unchanged*
1
Unchanged*
ON
1
Unchanged*
Function
code
040
Sets the Carry Flag (CY).
041
Turns OFF the Carry Flag (CY).
Subroutines
Interrupt tasks
OK
Data type
STC
Unchanged*
Unchanged*
ON
Unchanged*
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Function
CLC
CLC(041)
SFC action or transition
programs
OK
OK
CLC
1
1
1

Advertisement

Table of Contents
loading

Table of Contents