![background image](http://html1.mh-extra.com/html/omron/sysmac-cs1d-cpu/sysmac-cs1d-cpu_reference-manual_7422681238.webp)
1199
Block Programming Instructions
Section 3-32
Flags
Precautions
Instructions in block programs are generally executed unconditionally. Branch-
ing, however, can be used to create conditional execution based on execution
conditions or operand bits.
Use IF A ELSE B IEND to branch between A and B.
Use IF A IEND to branch between A and doing nothing.
Branches can be nested to up to 253 levels.
A error will occur and the Error Flag will turn ON if the branch instructions are
not in a block program or if more than 254 branches are nested.
Nesting Branches
Up to 253 branches can be nested within the top level branch.
Examples
The following example shows two different block programs controlled by
CIO 000000 and CIO 000002.
The first block executes one of two additions depending on the status of
CIO 000001. This block is executed when CIO 000000 is ON. If CIO 000001
is ON, 0001 is added to the contents of CIO 0001. If CIO 000001 is OFF, 0002
is added to the contents of CIO 0001. In either case, the result is placed in
D00000.
The second block is executed when CIO 000002 is ON and shows nesting
two levels. If CIO 000003 and CIO 000004 are both ON, the contents of
CIO 1200 and CIO 0002 are added and the result is placed in D00010 and
then 0001 is moved into D00011 based on the status of CY. If either
CIO 000003 or CIO 000004 is OFF, then the entire addition operation is
skipped and CIO 000301 is turned ON.
Operand bit
ON?
"A" executed (be-
tween IF and IEND).
Name
Label
Operation
Error Flag
ER
ON if the branch instructions are not in a block program.
ON if more than 254 branches are nested.
OFF in all other cases.
Содержание SYSMAC CS1D-CPU**
Страница 3: ...iv...
Страница 29: ...xxx...
Страница 185: ...146 List of Instructions by Function Code Section 2 4...
Страница 193: ...154 3 35 4 MOVE BIT MOVBC 568 1274 3 35 5 BIT COUNTER BCNTC 621 1276 3 35 6 GET VARIABLE ID GETID 286 1278...
Страница 1389: ...1350 CJ series Instruction Execution Times and Number of Steps Section 4 2...
Страница 1390: ...1351 Appendix A ASCII Code Table ASCII SP Four leftmost bits Four rightmost bits...
Страница 1391: ...1352 ASCII Code Table Appendix A...