Hello Guest it is April 18, 2024, 11:59:32 AM

Author Topic: g52 and subroutines  (Read 4271 times)

0 Members and 1 Guest are viewing this topic.

g52 and subroutines
« on: December 12, 2008, 10:55:43 AM »
I am experimenting with using g52 and subroutines to cut the same piece of work more than once on a single sheet of pcb. I feel that I may have a syntax error.
The g-code shown in the Mach3 window has a square after the G98 p2 line and the last line which is g99 is not shown at all. When openned in Notebook the code looks as I meant it to be. I am wondering if there is some kind of syntax checker in Mach 3 that is altering my original programme, due to a syntax error. Is this likely.
Also, the toolpath window shows the two identical pieces of work, but when I step through, but not connected to the mill, it shows the first piece of work being cut twice.
Any pointers would be appreciated.

Dave

Offline Graham Waterworth

*
  • *
  •  2,672 2,672
  • Yorkshire Dales, England
    • View Profile
Re: g52 and subroutines
« Reply #1 on: December 14, 2008, 06:04:11 PM »
Hi Dave,

first of all subs use M98 and M99 not G98/99 also make sure you have a return on the last line of your code, better still put a % at the start and end of your code.

E.g.

%
o0001
g21g40
.....
m98 p2
m30

o0002
g00 x0y0
.....
m99
%

When you simulate a g-code run in Mach using G52's the path is drawn on top of each other, this is normal.

Graham
Without engineers the world stops
Re: g52 and subroutines
« Reply #2 on: December 15, 2008, 05:32:01 AM »
Thanks Graham,
The g98 was a typo in my posting, not in the actual code, but the missing return was the main problem. I also put g52 x0 y0 at the end of each subroutine as suggested in a previous posting I found.
I looked at the file in a hex editor and there was an 09 and an extra 0a that was causing the square character.

I'm still only cutting air so far, as the pcb drills are quite fragile, but my confidence is building.

Dave

Offline Graham Waterworth

*
  • *
  •  2,672 2,672
  • Yorkshire Dales, England
    • View Profile
Re: g52 and subroutines
« Reply #3 on: December 15, 2008, 11:38:50 AM »
Another happy customer

 :)

Graham
Without engineers the world stops