Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: jeff114 on February 15, 2023, 07:08:13 AM
-
Hello,
I have a problem with M98 subroutine in Mach3.
If I run this gcode file:
G90
F2000
G1 Z -1
G1 X0 Y0
G91
M98 P1000 L4
M30
O1000
G1 Y200
G1 X200
G1 Y-200
G1 X-200
M99
%
the O1000 is never executed. When running in step by step mode, when the M98 line is focused, next step is M30 and not O1000.
If I wrote a second gcode file (1000.tap) and put it in the subroutine folder like this:
G1 Y200
G1 X200
G1 Y-200
G1 X-200
M99
%
and call it inside the main gcode file:
G90
F2000
G1 Z -1
G1 X0 Y0
G91
M98 (1000.tap) L4
M30
It works.
I try with .066 .062 and .043 version and it doesn't change anything.
Do you know where does come this problem? I haven't found answer on internet.
Thank you
jeff
-
https://www.cnczone.com/forums/mach-software-artsoft-software-/370418-mach-3-m98-can-get-work-please.html
Might help?
-
Thank you JohnHaine,
I already read this post and it doesn't work with subroutine program within the current part program file (separated subroutine in another gcode file works).
-
Here is some code (actually for knurling with a rotary axis) which I know works.
G00 X1 Y0 Z67.595
G91
G00 A5
F100
G01 Z-1.397
M98 p2000 L37
G00 X1 Y0 Z67.595
G90
o2000
G91
G01 X10.783 A97.297
G01 X-10.783 A97.297
M99
The main difference I can see is that the "o" in o2000 is lower case.
-
Try it like this :-
%
G00 X1 Y0 Z67.595
G91
G00 A5
F100
G01 Z-1.397
M98 p2000 L37
G00 X1 Y0 Z67.595
G90
M30
o2000
G91
G01 X10.783 A97.297
G01 X-10.783 A97.297
M99
%
-
Thank you JohnHaine and Graham,
I try your gcodes with lower cases P and O but it doesn't change anything. I try with a fresh install of Mach3 .062 without any personal setup on a virtual machine and it dosen't work.
Is there a way to put Mach3 in debug mode to get log?
jeff
-
Hi,
I post a video on youtube to show you the problem:
https://youtu.be/jWNtcMbCoAU (https://youtu.be/jWNtcMbCoAU)
jeff
-
Whenever I use M98 and M99 I have always added an M30 (and % on a new line) at the end of the program after the M99 in addition to the one after the M98
grayhil
-
Well I just tried it in simulation and it worked fine v03.422
-
Thanks you,
I try to add M30 and % at end of file but it doesn't change anything. I will try with 3.422.
Thank you
Jeff
-
I found my mistake, I created gcode file under linux and end line aren't the same as windows.
Thank you all !
-
Excellent! Glad it's fixed and worth knowing that!