Attaboy(;-) SD, It never hurts to learn a new trick. Just for the record Lcam does tool comp also(;-).
First off Yes SUBS can nest SUbs, the exception is NOT to nest itself.
Problem #1 You have confused MACH by having 2 subs called o1 (;-), After you fix the sub for the last line you will see mach endlessly loops in itself because it gores to the first o1 in the line and reruns the whole program again(endless loop) Your main program name is the same as the sub name(o0001,o1). To name the program use a ;0001 or (0001) that way you will see the name on file load.
Problem #2 In the sub o1 did you end it with a line return?? or did you mean to use the % Mach needs a line after the last line cal weither it be an empty line or the %charector. Without the empty line MACH will not see the last M99 so it stops there. A good habit is to start and end a program with %,,,,,,,,,,,,,,,,,,,,,% that way you never forget the empty line.
Problem#3 On your tool change when you called the G43 H1 D1. You do not used the Dword just G43 H1, the H1 calls the height data from T1.
Problem#4 On your G41 A good habit is to call the D1 as G41 D1. MACH will use the last tool called But a good habit is to call it anyway.
Problem #4 Check your geometry on the lines(;-) your are close but not perfect. Also it is VERY easy to get lost when switching back and forth between ABS and INC programing especially with subs in a sub. We call it getting LOST in Hyperspace, you never know where you will pop out.
Hope that helps, (;-) TP