Hello Guest it is December 15, 2019, 09:33:43 PM

Author Topic: G31 Trouble  (Read 2515 times)

0 Members and 1 Guest are viewing this topic.

G31 Trouble
« on: February 24, 2010, 03:38:33 PM »
I have manually added these lines to my program and they work great. I have a floating head with a micro switch. This is on a plasma table that I just added an auto  THC to.
G31 Z-1     
G91  Z.3   
G90
But when I have tried to do a subroutine (M98) with this it gives me an error on the G31 Z-1 line
G31  Z-1
G91  Z.3     
G90
M99
%
Any idea of what I did wrong?
Thanks, Greg

Offline Graham Waterworth

*
  • *
  •  1,923 1,923
  • Yorkshire Dales, England
    • View Profile
Re: G31 Trouble
« Reply #1 on: February 24, 2010, 08:09:07 PM »
how did you write the sub ?

it should look something like this

%
g21g40
m98p1(call sub)
m30

o1
g31z1.f100
g91z.3
m99
%

Graham
Without engineers the world stops
Re: G31 Trouble
« Reply #2 on: February 25, 2010, 09:42:52 AM »
This is my test program.
N001 G70
N002 G90
N003 G00 X-0.037 Y0.0
N004 M98 (Pierce.tap)   I added the P1 behind the M98 to try it but then it skipped the subroutine
N005 M03
N006 G01 Y1.0
N007 M05 G00 Z .25
N008 G40
N009 M30

This is my subroutine.
G31  Z-1 F30     When it checks the program it stops on this line.
G91  Z.3   
G90
M99
%

Thanks, Greg
Re: G31 Trouble
« Reply #3 on: February 25, 2010, 10:05:50 AM »
I just tried this on the computer in the office and it works fine. No motors hooked up but it goes through the program and I am using the same profile and screen set in the office as out in the shop.
Greg

Offline Graham Waterworth

*
  • *
  •  1,923 1,923
  • Yorkshire Dales, England
    • View Profile
Re: G31 Trouble
« Reply #4 on: February 25, 2010, 11:37:17 AM »
Do you have the sub program stored in the subprogram folder inside mach3 folder, if not you should or you need to specify the full path in the m98 call.

Graham
Without engineers the world stops
Re: G31 Trouble
« Reply #5 on: February 25, 2010, 02:21:36 PM »
I found the problem. I had a G41 in the line before the M98 on my original program and that is what was messing it up. All is working now.
Greg