G-Wizard Calculator:
Fast, Easy, Reliable Feeds and Speeds


Join 100,000+ CNC'ers!  Get our latest blog posts delivered straight to your email inbox once a week for free. Plus, we’ll give you access to some great CNC reference materials including:

  • Our Big List of over 200 CNC Tips and Techniques
  • Our Free GCode Programming Basics Course
  • And more!


GCode is Complicated
G-Wizard Makes it Easy

Subprogram Error: Subprogram Target is Invalid or Undefined


Dear Sir, I am trying to run G code of my project but I am getting following error

“ERROR: M98/G65 subprogram target is invalid or undefined.”

Now the line from the program reads like this:  “N70 M98 P0002″… When M98 called, the controller should look for file O0002. But I am getting this error. Please suggest the steps to call a subprogram from a different file saved in a same directory where main program is stored. Thank you

  • You must to post comments
Best Answer

Sunny, at this point the subprogram must be in the same file as the gcode that calls it. It’s on the drawing board to allow it to be in a different file, but that’s not implemented yet.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.


Do you want to be a better CNC'er?

Get Better Tool Life, Surface Finish, and Material Removal Rates.


Start Now, It's Free!



  GW Calculator

  GW Editor



  Deals and Steals

CNC Blog








     Feeds and Speeds

     G-Code Tutorial

     CNC Machining & Manufacturing

     DIY CNC Cookbook

     CNC Dictionary

CNC Projects


     Machinist's Search


     Online Groups


     Reference Data


     CNC Dictionary


     Tool Brands


     Hall of Fame

     Organization: Soon!





     Our History

     Privacy Policy

All material © 2016, CNCCookbook, Inc.