
Paramacros
Chapter 20
20-10
Example 20.8 illustrates the use of the conditional IF-GOTO command.
Example 20.8
Conditional IF
N1...;
N2IF[#3EQ-1.5]GOTO5;
N3...;
N4...;
N5...;
N6IF[#4LT3]GOTO1;
N7...;
When block N2 is read, parameter #3 is compared to the value -1.5. If the
comparison is true, blocks N3 and N4 are skipped and execution continues
on from block N5. If the comparison is false, execution continues on to
block N3. When block N6 is read, parameter #4 is compared to the value
3. If the comparison is true, execution is transferred to block N1. If false,
execution continues on to block N7.
Use the DO-END and WHILE-DO-END commands to set up complex
looping structures in your part program. The format for these commands is
shown below.
Unconditional DO-END
The unconditional DO-END command is rarely used. The lack of a
condition here causes the control to loop indefinitely, until you press
<CYCLE STOP> or <E-STOP> or until some other transfer of control
command forces execution out of the loop.
The format for the UNCONDITIONAL DO-END command is:
DO m;
:
:
:
END m;
Where: Is :
m an identifierused torelate a DO blockwith an ENDblock. The value of mmust
be thesame forthe DO and the corresponding END. This value canbeeither1,
2,or 3.
20.2.3
DO-END a nd
WHILE -DO-END Commands
Komentarze do niniejszej Instrukcji