172
Condition Flags
Section 4-14
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., =
Содержание CP1L CPU UNIT - 03-2009
Страница 1: ...Cat No W462 E1 06 CP1L CPU Unit SYSMAC CP Series CP1L L_0D_ CP1L M_0D_ OPERATION MANUAL...
Страница 2: ......
Страница 4: ...iv...
Страница 10: ...x...
Страница 22: ...xxii...
Страница 34: ...xxxiv Conformance to EC Directives 6...
Страница 70: ...36 Function Blocks Section 1 5...
Страница 584: ...550 Trouble Shooting Section 8 7...
Страница 627: ...593 Sample Application Section 9 12 Network Settings Network Tab Network Settings Driver Tab...
Страница 630: ...596 Sample Application Section 9 12...
Страница 654: ...620 Troubleshooting Unit Errors Section 11 4...
Страница 662: ...628 Replacing User serviceable Parts Section 12 2...
Страница 668: ...634 Standard Models Appendix A...
Страница 698: ...664 Auxiliary Area Allocations by Function Appendix C...
Страница 746: ...712 Auxiliary Area Allocations by Address Appendix D...
Страница 773: ...739 Connections to Serial Communications Option Boards Appendix F Connecting to Unit...
Страница 774: ...740 Connections to Serial Communications Option Boards Appendix F...
Страница 806: ...772 Index...
Страница 808: ...774 Revision History...