Sub Program Call

dsherburn

dsherburn
I was experimenting with the M98 sub program call. I inserted a "call" to another program on the USB (program is 10.nc). At the end of the "called" program I have M99, which should return to the main program after the M98 call. It doesn't. It looks like it returns to the beginning of the main program (which promptly runs the M98 again, sticking me in an endless loop). I've attached the main G-code as well as the referenced called program (10.nc).
 

Attachments

  • test-circles.nc
    1.5 KB · Views: 14
  • 10.nc
    40 bytes · Views: 17

masso-support

MASSO Support
Staff member
Hi Dan,

I had a look at the program and have found your problem. You have an M30 command in the sub program 10.nc which is the End program and rewind command which sends you right back to the start.

If you remove it from 10.nc the program should run as expected.
G38.2 Z-6 F20
G92 Z1.3
G0 Z4
M30 (End program and rewind)
M99



Hope this helps

Cheers

Peter
 

dsherburn

dsherburn
Peter-You are correct. That works. I'm running a 38.2 probing routine at Tool Change to enable the new tool to be at "0" at the top of the work piece. Every time a Tool Change is encountered I can run the touch plate routine and use the thickness of the plate to offset "Z" to the top of the job. I had to change the input from tool setter to probe. Thanks again.

Dan
 
Top