Omron CJ - INSTRUCTIONS Reference Manual page 1083

Table of Contents

Advertisement

The status of the Condition Flags cannot be saved/loaded between a cyclic task and interrupt task.
Hint
Condition Flags are shared by all instructions, so the status of these Flags may change many times
during the PLC cycle as each instruction is executed. Previously, it was necessary to place conditions
using the Condition Flags immediately after the controlling instruction so that the status of the Condition
Flags would not be affected by intervening instructions. The CCS(282) and CCL(283) instructions allow
the controlling instruction to be separated from the execution conditions that rely on the result.
For example, CCS(282) can store the status of the Equals Flag after execution of a Comparison
Instruction and the result can be restored later. The result does not have to be used immediately after
execution of the instruction.
Task
• All of the Condition Flags are cleared when operation switches from one task to another. Use the
CCS(282) and CCL(283) instructions to save and load the Condition Flag status between tasks or
cycles.
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Within a task
CCS
CCL
Between cycles
A
A
CCL(283) is executed to read the status
CCS
in the next cycle after CCS(282) was
B
executed to save the status.
CCL
The results of the comparison are stored in the Condition Flags.
CMP
(In this case, the results of the COMPARE Instruction can be used
in instruction B even if those results are affected by execution of
instruction A.)
Preserves the status of the Condition Flags in a separate location
CCS
in the CPU Unit.
Instruction A
Restores the status of the Condition Flags.
CCL
The Equals Flag will reflect the result of the COMPARE instruction,
Instruction B
not the result of instruction A.
Between cyclic tasks
CCS
CCL
3. Instructions
3
1045

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents