Hi Guys,
sorry for the delay, its been a very busy week so far.
I can see no obvious problems with the g-code, the only thing that can be off putting is Mach3 and a combination of subs and G91 code can cause the tool path to be drawn wrong. If you are not using tool compensation then the G40's can be removed as Mach3 is not over keen on tool comp codes in subs ether. Blank(s) or comment(s) as the first line(s) of the sub can cause problems too in some circumstances. Lastly it is a good idea to have a % only as the first and last line of the code, none in the middle.
You will all be pleased to know that Mach4 has none of these problems
Regards
Graham