
18.CUSTOM MACRO NC FUNCTIONS B-63782EN/01
- 246 -
- Control command
Program flow in the custom macro body is controlled by the following
command.
- If [<conditional expression>]GOTO n (n = sequence number)
When <conditional expression> is satisfied, the next execution is
done from block with sequence number n.
When <conditional expression> is not satisfied, the next block is
executed.
When the [<IF conditional expression>] is committed, it executes
from block with n unconditionally.
The following <conditional expressions> are available:
#j EQ #k whether #j = #k
#j NE #k whether #j = #k
#j GT #k whether #j > #k
#j LT #k whether #j < #k
#j GE #k whether #j y #k
#j LE #k whether #j x #k
- IF [<conditional expression>] THEN macro statement
If the specified conditional expression is satisfied, a
predetermined macro statement is executed. Only a single macro
statement is executed.
- WHILE (<conditional expression>) DO m (m = 1, 2, 3)
:
END m
While <conditional expression> is satisfied, blocks from DO m to
END m is repeated.
When <conditional expression> is no more satisfied, it is executed
from the block next to END m block.
- Format of custom macro body
The format is the same as the sub program.
#120=1
WHILE
#120 LE 10
DO 1
#120=#120+1
END
Re
eated 10 times.
Example
O Macro number ;
Custom macro body
M99