EasyManuals Logo

Omron CJ2 CPU UNIT SOFTWARE User Manual

Omron CJ2 CPU UNIT SOFTWARE
670 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 #250 background imageLoading...
Page #250 background image
6 I/O Memory Areas
6-44
CJ2 CPU Unit Software User’s Manual
z Using the Condition Flags
The Condition Flags are shared by all of the instructions, so their status may change often in a sin-
gle cycle. Be sure to read the Condition Flags immediately after the execution of instruction, prefera-
bly in a branch from the same execution condition.
Precautions for Correct UsePrecautions for Correct Use
• Because the Condition Flags are shared by all of the instructions, program operation can be
changed from its expected course by interruption of a single task. Be sure to consider the
effects of interrupts when writing the program.
• The Condition Flags are cleared when the program switches tasks, so the status of a Condi-
tion Flag cannot be passed to another task. For example the status of a flag in task 1 cannot
be read in task 2.
z Saving and Loading Condition Flag Status
The Condition Flag status instructions (CCS(282) and CCL(283)) can be used to save and load the
status of the Condition Flags between different locations within a task (program) or between different
tasks or cycles.
The following example shows how the Equals Flag is used at a different location in the same task.
Instruction A
The result from instruction A is
reflected in the Equals Flag.
Instruction B
Instruction
LD
Instruction A
AND
Instruction B
Operand
Condition Flag
Example: P_EQ
P_EQ
CMP
CCS
CCL
P_EQ
Stores result of comparison in the Condition Flags.
This will enable loading the results to use with
Instruction B.
Saves status of Condition Flags.
Loads the statuses of the Conditions Flags that
were stored.
The result of the comparison instruction in the
P_EQ Flag can be used by Instruction B without
interference from Instruction A.
Instruction A
Instruction B
Task

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron CJ2 CPU UNIT SOFTWARE and is the answer not in the manual?

Omron CJ2 CPU UNIT SOFTWARE Specifications

General IconGeneral
BrandOmron
ModelCJ2 CPU UNIT SOFTWARE
CategorySoftware
LanguageEnglish

Related product manuals