System information
SECTION SIX - PARAMETRIC PROGRAMMING
The above two statements accomplish the same thing. If the statement is true, N15 is executed; if
it is false, N21 is executed.
Examples: IF P1*P3/COS[P90] GE TAN[P6] THEN X1
IF P4/P3 LT P6 GOTO 25
IF P1 = P2 THEN P4 = P5 - P6
Multiple IF statements can be used to check for multiple conditions.
Example: IF P36<5 THEN IF P1<>0 THEN M5
Defined, this means if P36 is less than 5 and P1 does not equal 0, shut the
spindle off.
Note: The word THEN is optional in all cases.
WHILE-WEND
The second type of conditional statement is the WHILE-WEND statement. A WHILE statement
contains an expression that controls the repeated execution of the blocks contained between the
WHILE and WEND statements.
The expression controlling the repetition must contain one of the set of relational operators
which allows the expression to be reduced to either true or false. The expression is evaluated
before the contained blocks are executed. The contained blocks are executed repeatedly as long
as the expression is true. If the expression is false at the beginning the blocks are not executed.
Example: N20 WHILE [[P2*P3]/COS[P6]] LT P2
N21 P6 = P6 + 1
N22 Y[P2] Z[P3]
N23 X[P6]
N24 X1 Y0 Z0
N25 WEND
N26 M30
In this example lines N20 thru N25 will be repeated until the WHILE expression becomes false.
Then line N26 will be executed instead of N21.
Note: Nested WHILE loops are allowed.
Transfer statements
Transfer statements transfer control from one section of a program to another. They are
unconditional transfers in that when the statement is executed, control always transfers. The
GOSUB/RETURN, and CALL statements return control to the N+1 block after they are finished,
and the GOTO statement transfers control to the specified block without a return.
327










