176
Condition Flags
Section 4-18
Using the Condition Flags
The Condition Flags are shared by all of the instructions, so their status may
change often in a single cycle. Be sure to read the Condition Flags immedi-
ately after the execution of instruction, preferably in a branch from the same
execution condition.
Since the Condition Flags are shared by all of the instructions, program oper-
ation 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. Refer
to SECTION 2 Programming of CS/CJ Series Programming Manual (W394)
for more details.
The Condition Flags are cleared when the program switches tasks, so the sta-
tus of a Condition Flag cannot be passed to another task. For example the
status of a flag in task 1 cannot be read in task 2.
Carry Flag
P_CY
Turned ON when there is a carry in the result of an arithmetic opera-
tion or a “1” is shifted to the Carry Flag by a Data Shift instruction.
The Carry Flag is part of the result of some Data Shift and Symbol
Math instructions.
Greater Than Flag
P_GT
Turned ON when the first operand of a Comparison Instruction is
greater than the second or a value exceeds a specified range.
Equals Flag
P_EQ
Turned ON when the two operands of a Comparison Instruction are
equal the result of a calculation is 0.
Less Than Flag
P_LT
Turned ON when the first operand of a Comparison Instruction is less
than the second or a value is below a specified range.
Negative Flag
P_N
Turned ON when the most significant bit (sign bit) of a result is ON.
Overflow Flag
P_OF
Turned ON when the result of calculation overflows the capacity of the
result word(s).
Underflow Flag
P_UF
Turned ON when the result of calculation underflows the capacity of
the result word(s).
Greater Than or
Equals Flag
P_GE
Turned ON when the first operand of a Comparison Instruction is
greater than or equal to the second.
Not Equal Flag
P_NE
Turned ON when the two operands of a Comparison Instruction are
not equal.
Less Than or
Equals Flag
P_LE
Turned ON when the first operand of a Comparison Instruction is less
than or equal to the second.
Always ON Flag
P_On
Always ON. (Always 1.)
Always OFF Flag
P_Off
Always OFF. (Always 0.)
Name
Symbol
Function
=
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,
e.g., =
Содержание CP1H-CPU - 05-2006
Страница 1: ...OPERATION MANUAL CP1H CPU Unit SYSMAC CP Series CP1H X40D CP1H XA40D CP1H Y20DT D Cat No W450 E1 02...
Страница 2: ...CP1H X40D CP1H XA40D CP1H Y20DT D CP1H CPU Unit Operation Manual Revised May 2006...
Страница 3: ...iv...
Страница 11: ...xii TABLE OF CONTENTS...
Страница 15: ...xvi...
Страница 19: ...xx...
Страница 31: ...xxxii Conformance to EC Directives 6...
Страница 71: ...40 Function Blocks Section 1 5...
Страница 133: ...102 Computing the Cycle Time Section 2 7...
Страница 169: ...138 CPM1A Expansion I O Unit Wiring Section 3 6...
Страница 411: ...380 Clock Section 6 8...
Страница 519: ...488 Replacing User serviceable Parts Section 10 2...
Страница 527: ...496 Standard Models Appendix A...
Страница 535: ...504 Dimensions Diagrams Appendix B...
Страница 628: ...597 Connections to Serial Communications Option Boards Appendix F Connecting to Unit...
Страница 629: ...598 Connections to Serial Communications Option Boards Appendix F...
Страница 659: ...628 PLC Setup Appendix G...
Страница 665: ...634 Index work words 159 write protection 370...
Страница 667: ...636 Revision History...