137
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.
Saving and Loading Condition Flag Status
The CP1L-EL/EM CPU Units support instructions to save and load the Condi-
tion Flag status (CCS(282) and CCL(283)). These can be used to access the
status of the Condition Flags at other locations in a task or in a different task.
The following example shows how the Equals Flag is used at a different loca-
tion 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,
e.g., =
CMP
CCS
CCL
Instruction A
Instruction B
Stores result of comparison in the Condition Flags.
This will enable loading the results to use with
Instruction B.
The result of the comparison instruction in the
Equals Flag can be used by Instruction B without
interference from Instruction A.
Loads the statuses of the Conditions Flags that
were stored.
Saves status of Condition Flags.
Task
Содержание CP1L-EL20DR-D
Страница 3: ...CP1L EL20D CP1L EM30D CP1L EM40D CP1L EL EM CPU Unit Operation Manual Produced July 2017...
Страница 4: ...iv...
Страница 10: ...x...
Страница 22: ...xxii...
Страница 34: ...xxxiv Software Licenses and Copyrights 7...
Страница 178: ...144 Connecting the CX Programmer Section 5 1 Click the Connect button to connect and then connection online is completed...
Страница 192: ...158 Trial Operation and Debugging Section 5 3...
Страница 250: ...216 Automatic Clock Adjustment and Specifying Servers by Host Name Section 6 7...
Страница 666: ...632 Trouble Shooting Section 11 7...
Страница 696: ...662 Standard Models Appendix A...
Страница 805: ...771 Connections to Serial Communications Option Boards Appendix F Connecting to Unit...
Страница 806: ...772 Connections to Serial Communications Option Boards Appendix F...
Страница 836: ...802 PLC Setup Appendix G...
Страница 838: ...804 TCP Status Transitions Appendix H...
Страница 840: ...806 Ethernet Network Parameters Appendix I...
Страница 842: ...808 Buffer Configuration CP1L EL EM Appendix J...
Страница 844: ...810 Ethernet Specifications Appendix K...
Страница 851: ...Index 817 work words 118 write protection 447...
Страница 852: ...818 Index...
Страница 854: ...820 Revision History...
Страница 855: ......