Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: jeff114 on February 15, 2023, 07:08:13 AM

Title: Mach3 M98 ignored
Post 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:

Code: [Select]
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:
Code: [Select]
G1 Y200
G1 X200
G1 Y-200
G1 X-200
M99

%

and call it inside the main gcode file:

Code: [Select]
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

Title: Re: Mach3 M98 ignored
Post by: JohnHaine on February 15, 2023, 08:01:03 AM
https://www.cnczone.com/forums/mach-software-artsoft-software-/370418-mach-3-m98-can-get-work-please.html

Might help?
Title: Re: Mach3 M98 ignored
Post by: jeff114 on February 15, 2023, 08:40:31 AM
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).

Title: Re: Mach3 M98 ignored
Post by: JohnHaine on February 15, 2023, 11:09:59 AM
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.
Title: Re: Mach3 M98 ignored
Post by: Graham Waterworth on February 15, 2023, 06:58:17 PM
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
%
Title: Re: Mach3 M98 ignored
Post by: jeff114 on February 16, 2023, 12:33:30 AM
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
Title: Re: Mach3 M98 ignored
Post by: jeff114 on February 16, 2023, 06:55:54 AM
Hi,
I post a video on youtube to show you the problem:
https://youtu.be/jWNtcMbCoAU (https://youtu.be/jWNtcMbCoAU)

jeff
Title: Re: Mach3 M98 ignored
Post by: GRAYHIL on February 16, 2023, 12:07:35 PM
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
Title: Re: Mach3 M98 ignored
Post by: JohnHaine on February 16, 2023, 12:13:04 PM
Well I just tried it in simulation and it worked fine v03.422

Title: Re: Mach3 M98 ignored
Post by: jeff114 on February 16, 2023, 01:40:54 PM
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
Title: Re: Mach3 M98 ignored
Post by: jeff114 on February 17, 2023, 02:11:30 AM
I found my mistake, I created gcode file under linux and end line aren't the same as windows.

Thank you all !
Title: Re: Mach3 M98 ignored
Post by: JohnHaine on February 17, 2023, 02:42:27 AM
Excellent!   Glad it's fixed and worth knowing that!