Chapter 7
152
UM10372_PCNC440_Manual_0221A
PROgRAMMiNg
While/endwhile Example:
(draw a sawtooth shape)
G00 X1 Y0 (move to start position)
#1 = 1 (assign parameter #1 the value of 0)
F25 (set a feed rate)
o101 while [#1 LT 10]
G01 X0
G01 Y[#1/10] X1
#1 = [#1+1] (increment the test counter)
o101 endwhile
M02 (end program)
The following statements cause an error message and abort the interpreter:
• A return or endsub not within a sub denion
• A label on repeat which is dened elsewhere
• A label on while which is dened elsewhere and not referring to a do
• A label on if dened elsewhere
• A undened label on else or elseif
• A label on else, elseif or endif not poinng to a matching if
• A label on break or connue which does not point to a matching while or do
• A label on endrepeat or endwhile no referring to a corresponding while or repeat