# ID 20377

Unexpected M30 or M02.
Description | In a subroutine the end of the main program (M02/M30) is detected. Example: Wrong: %L sub1 N10 G91 X10 Y20 Z30

:

N100 M30

%main

N10 G00 X0 Y0 Z0

N20 LL sub1

:

N1000 M30

Correct:

%L sub1

N10 G91 X10 Y20 Z30

:

N100 M17

%main

N10 G00 X0 Y0 Z0

N20 LL sub1

:

N1000 M30

Response | Class | 1 | Continue NC program processing.
Solution | Class | 1 | Check and modify NC program. Replace M02/M30 in subroutines with M17/M29. Finish main program with M02/M30.
Error type | 1, Error message from NC program.