o sub o100 IF [#5000 EQ 0] M3 S1000 G4 P.5 #5000 = 10 o100 ENDIF M19 R0 Q10 P0 o200 IF [# GT 0] G53 G0 Z15.6000 ; low position M64 P0 M64 P1 M66 P0 L3 Q5 o101 if [#5399 LT 0] (abort, failed tool arm out) o101 endif M66 P1 L4 Q5 o102 if [#5399 LT 0] (abort, failed tool arm out) o102 endif M65 P1 M65 P0 M66 P2 L3 Q5 o103 if [#5399 LT 0] (abort, failed low air) o103 endif M64 P2 M66 P3 L3 Q2 o104 if [#5399 LT 0] (abort, failed to release tool) o104 endif M66 P4 L4 Q2 o105 if [#5399 LT 0] (abort, failed to release tool) o105 endif M5 M62 P3 G53 G0 Z20 M65 P3 o200 ENDIF G53 G0 Z20 o300 IF [# GT 0] M68 E0 Q# M64 P4 G4 P2 M66 P5 L3 Q60 o106 if [#5399 LT 0] (abort, failed to align carousel) o106 endif M65 P4 M64 P0 M64 P1 M66 P0 L3 Q5 o107 if [#5399 LT 0] (abort, failed tool arm out) o107 endif M66 P1 L4 Q5 o108 if [#5399 LT 0] (abort, failed tool arm out) o108 endif M65 P1 M65 P0 M66 P2 L3 Q5 o109 if [#5399 LT 0] (abort, failed low air) o109 endif M64 P2 M66 P3 L3 Q2 o110 if [#5399 LT 0] (abort, failed to release tool) o110 endif M66 P4 L4 Q2 o111 if [#5399 LT 0] (abort, failed to release tool) o111 endif M5 M62 P3 G53 G0 Z15.6000 M65 P3 o300 ENDIF M65 P2 M66 P4 L3 Q2 o112 if [#5399 LT 0] (abort, failed to clamp tool) o112 endif M66 P3 L4 Q2 o113 if [#5399 LT 0] (abort, failed to clamp tool) o113 endif M64 P0 M64 P5 M66 P1 L3 Q5 o114 if [#5399 LT 0] (abort, failed tool arm in) o114 endif M66 P0 L4 Q5 o115 if [#5399 LT 0] (abort, failed tool arm in) o115 endif M65 P5 M65 P0 o endsub [1] M2