Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 70

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Precautions
Main Conditions Turning ON Condition Flags
Error Flag
Note
Equals Flag
Carry Flag
Note
Less Than and Greater
Than Flags
Negative Flag
Specifying Operands for
Multiple Words
The ER 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 ER Flag turns ON.
When the ER 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 CP-series CP1H CPU
Unit Programming Manual (W451) for the conditions that will cause the ER
Flag to turn ON. Caution is required because some instructions will turn OFF
the ER Flag regardless of conditions.
The PLC Setup Settings for when an instruction error occurs determines
whether operation will stop when the ER Flag turns ON. In the default setting,
operation will continue when the ER Flag turns ON. If Stop Operation is spec-
ified when the ER 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.
The Equals Flag is a temporary flag for all instructions except when compari-
son 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.
The CY Flag is used in shift instructions, addition and subtraction instructions
with carry input, addition and subtraction instruction borrows and carries, as
well as with Special I/O Unit instructions, PID instructions, and FPD instruc-
tions. Note the following precautions.
(1) The CY Flag can remain ON (OFF) because of execution results for a cer-
tain instruction and then be used in other instruction (an addition and sub-
traction instruction with carry or a shift instruction). Be sure to clear the
Carry Flag when necessary.
(2) The CY Flag can be turned ON (OFF) by the execution results for a cer-
tain instruction and be turned OFF (ON) by another instruction. Be sure
the proper results are reflected in the Carry Flag when using it.
The < and > Flags are used in comparison instruction, as well as in the LMT,
BAND, ZONE, PID and other instructions.
The < or > Flag can be turned OFF (ON) by another instruction even if it is
turned ON (OFF) by execution results for a certain instruction.
The N Flag is turned OFF when the leftmost bit of the instruction execution
results word is "1" for certain instructions and it is turned OFF unconditionally
for other instruction.
With the CP-series PLCs, an instruction will be executed as written even if an
operand requiring multiple words is specified so that all of the words for the
operand are not in the same area. In this case, words will be taken in order of
the PLC memory addresses. The Error Flag will not turn ON.
Section 1-2
37

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents