Omron CJ2 CPU - REV 10-2010 User Manual page 200

Cj2 cpu unit software
Table of Contents

Advertisement

5 Understanding Programming
In this case then, instructions A and B are not differentiated instructions, the DIFU (of DIFD) instruc-
tion is used instead as shown below and instructions A and B are both upwardly (or downwardly) dif-
ferentiated and executed for one cycle only.
Additional Information
The CONDITION FLAG SAVE and CONDITION FLAG LOAD (CCS(282) and CCL(283)) instruc-
tions can be used to save and load the Condition Flag status. These can be used to access the
status of the Condition Flags at other locations in a task or in a different task.
Main Conditions Turning ON Condition Flags
Error Flag (P_ER)
The Error Flag will turn ON under special conditions, such as when operand data for an instruction is
incorrect. The instruction will not be executed when the Error Flag turns ON.
When the Error Flag is ON, the status of other Condition Flags, such as the <, >, OF, and UF Flags,
will not change and status of the = and N Flags will vary from instruction to instruction.
Refer to the descriptions of individual instructions in the CS/CJ/NSJ-series Instructions Reference
Manual (Cat. No. W474) for the conditions that will cause the Error Flag to turn ON. Caution is
required because some instructions will turn OFF the Error Flag regardless of conditions.
Additional Information
The PLC Setup Settings for when an instruction error occurs determines whether operation will
stop when the Error Flag turns ON. In the default setting, operation will continue when the Error
Flag turns ON. If Stop Operation is specified when the Error Flag turns ON and operation stops
(treated as a program error), the program address at the point where operation stopped will be
stored at in A298 to A299. At the same time, A295.08 will turn ON.
Equals Flag (P_EQ)
The Equals Flag is a temporary flag for all instructions except when comparison results are equal
(=). It is set automatically by the system, and it will change. The Equals Flag can be turned OFF
(ON) by an instruction after a previous instruction has turned it ON (OFF). The Equals Flag will turn
ON, for example, when MOV or another move instruction moves 0000 Hex as source data and will
be OFF at all other times. Even if an instruction turns the Equals Flag ON, the move instruction will
execute immediately and the Equals Flag will turn ON or OFF depending on whether the source
data for the move instruction is 0000 Hex or not.
5-108
Previous rung
C
D
Condition Flag
P_EQ (Equals Flag)
DIFU
D
Instruction A
Reflects instruction A execution results.
Instruction B
CJ2 CPU Unit Software User's Manual

Advertisement

Table of Contents
loading

Table of Contents