Hello Guest it is March 29, 2024, 02:42:16 AM

Author Topic: Call G91 sub from G90 main program?  (Read 11447 times)

0 Members and 1 Guest are viewing this topic.

Call G91 sub from G90 main program?
« on: March 03, 2014, 09:42:20 AM »
Is it possible to call and use a subroutine that uses incremental (G91) programming, from a main program that uses absolute (G90) programming? Or aternatively, can I specify some parts of the main program as G90 and some as G91?

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Call G91 sub from G90 main program?
« Reply #1 on: March 03, 2014, 01:43:40 PM »
Yes you can use G90 and G91 in any part of the main program, be care full using G91 in subs
Without engineers the world stops
Re: Call G91 sub from G90 main program?
« Reply #2 on: March 03, 2014, 03:48:49 PM »
Thanks Graham, I can probably do what I need to do in the main program, but if not, what is it I need to be careful of when using G91 in subs?
Re: Call G91 sub from G90 main program?
« Reply #3 on: March 03, 2014, 07:28:40 PM »
For a sub like a pocket operation that you want to use at multiple locations you need to program it incrementally. Otherwise you can't use it at multiple locations.
Re: Call G91 sub from G90 main program?
« Reply #4 on: March 04, 2014, 04:17:50 AM »
Yes, that makes sense; repeatability was the main reason I thought of using G91

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Call G91 sub from G90 main program?
« Reply #5 on: March 04, 2014, 04:16:46 PM »
You can use subs and absolute code, you just need to use G52 to set the local offset position and then you can use G90 absolute code at the new position

E.g.

%
G00 G90 X0 Y0
M98 P1
G52 X20.
M98 P1
G52 X20. Y-20.
M98 P1
G52 X0 Y-20.
M98 P1
G52 X0 Y0
M30

O1 (SUB)
G00 X0 Y0
G01 Z-1. F100.
X10.
Y-10.
X0
Y0
G00 Z1.
M99
%
« Last Edit: March 04, 2014, 04:38:30 PM by Graham Waterworth »
Without engineers the world stops
Re: Call G91 sub from G90 main program?
« Reply #6 on: March 05, 2014, 09:19:41 AM »
Thanks Graham, that may well work, but I have a gap in my knowledge, namely that I don't know how to manually choose a line and run from it. I've posted a request for help on this in the main section, as I haven't found anything in the manual or on the forum. It could well be that I'm just using the wrong search terms, but so far I haven't found anything relevant.