Hello Guest it is March 29, 2024, 02:30:49 AM

Author Topic: G65 Macro Calls  (Read 4619 times)

0 Members and 1 Guest are viewing this topic.

G65 Macro Calls
« on: July 23, 2015, 03:45:26 PM »
I have a few questions in regard to G65.

1. Is it an external program call? In other words by programming G65 P9001 will the program go find that program in the directory and then run it. Once complete return to the main program. This works with most CNC machine controls. Just wondering if Mach 4 acts the same.

It works if I do it in parallel with the main like so,

Some code....
G65 P9001
more code
M30

O9001
some code...
M99

Buy if I do not include that O9001 in the main program it simply runs right past it.

How do I do an external program call?

Any help would be fantastic.
Re: G65 Macro Calls
« Reply #1 on: July 23, 2015, 04:27:10 PM »
Update...

G65 and M98 external sub calls fail.

When the routine is called, I have the following code:

O1000
G90 G00 X-40.
G4 P2.
X40.
G65 P1002
M30

In my subroutines folder I have the file named O1002 with no extension just as the manual states. The sub looks like this:

O1002
G90 G00 X20.
G4 P2.
X-20.0
M99

But here are the results:

Main program calls the sub with no issue, but the M99 is stripped and once the code is complete in the sub the program execurtion stops and sits. I must then rewind the program and start again.

But, notice what I said that the M99 in the sub is not visible in the GCODE window.

Bug????
Re: G65 Macro Calls
« Reply #2 on: July 23, 2015, 04:34:36 PM »
I tried the same thing this time wth the sub in the main.. Same issue the M99 is stripped. Screen shots attached.

Am I missing something?

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: G65 Macro Calls
« Reply #3 on: July 23, 2015, 05:22:19 PM »
Did you add the needed carriage return to the end of the SUB after the M99 if NOT it will NOT see the M99 and will not run. As a point I always add a % after the M30.

I just finished testing the M98/G65/G66 calls here other than a few quirks they worked internally and externally.

OK from your picture I can see that you did not add teh CF to the end of the file. Add either a CF (blank line)  or the % after the M99.


This works: AND you can return BACK to the main at an a N word with the M99 Pxx  return call as well

01000
G90 G00 X-40.
G4 P2.
X40.
G65 P1002
M30
%

In my subroutines folder I have the file named O1002 with no extension just as the manual states. The sub looks like this:

o1002
G90 G00 X20.
G4 P2.
X-20.0
M99
%

(;-) TP
« Last Edit: July 23, 2015, 05:28:08 PM by BR549 »
Re: G65 Macro Calls
« Reply #4 on: July 23, 2015, 05:25:24 PM »
Thanks. I will do that.