Thanks, I did figure out I was putting M30 at the end of sub rather than at end of main and that was causing the error message. I still cannot get a sub only written and saved to call back up. I am confused about the terminology. With my old allen bradley controlled mill there is both sub programs and subroutines with their own definitions. The terms seem be used interchangeably in mach. Your message says sub but then at the end you say subprogram directory. I cannot find a subprogram , but there is a subroutine wich is what I have been saving the attempts in. Can you please clarify and if not to much trouble write a short example of how you would do a sub only for storage.
Thanks for help, Scott