Hello Guest it is December 09, 2019, 08:41:26 PM

Author Topic: Save current tool position so I can come back to it?  (Read 2279 times)

0 Members and 1 Guest are viewing this topic.

Save current tool position so I can come back to it?
« on: February 20, 2015, 07:17:47 PM »
I'd like to be able to call a routine that moves the mill somewhere and then, when the routine is done, I'd like the mill to return to where it was before the routine was called.  Is that possible?
Re: Save current tool position so I can come back to it?
« Reply #1 on: February 20, 2015, 07:25:29 PM »
There is  "Remember" and "Return" that might be what you want.
OEM 286 & 285 that you could build into a button script.
Russ
Re: Save current tool position so I can come back to it?
« Reply #2 on: February 20, 2015, 07:27:02 PM »
Ah - thanks for the reply but I want to do it automatically in my code.   The routine is called many times and I'd have to hang around throughout the job to press that button.

No way to do this in code?
Re: Save current tool position so I can come back to it?
« Reply #3 on: February 20, 2015, 07:29:07 PM »
Sure, could be done in a macro, then called with M****
Re: Save current tool position so I can come back to it?
« Reply #4 on: February 20, 2015, 07:30:34 PM »
Ok.  I'll look into how to use OEM codes in gcode.  Will report back here when I figure it out and have working code.
Re: Save current tool position so I can come back to it?
« Reply #5 on: February 20, 2015, 07:30:54 PM »
or, how bout a subroutine, then a return ?
Re: Save current tool position so I can come back to it?
« Reply #6 on: February 20, 2015, 07:31:48 PM »
I do use a subroutine already and it returns to the main program when it is done.  Trouble is, the tool doesn't automatically return to where it was before the routine was called.

Online ger21

*
  • *
  •  6,291 6,291
    • View Profile
    • The CNC Woodworker
Re: Save current tool position so I can come back to it?
« Reply #7 on: February 20, 2015, 07:51:57 PM »
SetVar(1, GetOEMDRO(800))
SetVar(2, GetOEMDRO(801))
SetVar(3, GetOEMDRO(802))

Do Stuff Here

Code "G0 Z" & GetVar(3) ' Move to Previous Z Position
Code "G0 X" & GetVar(1) & " Y" & GetVar(2) ' Move to Previous XY Position

Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Save current tool position so I can come back to it?
« Reply #8 on: February 20, 2015, 07:54:29 PM »
Thanks.  Are those lines going into my gcode file or in something else?  I'm doing a lot of hunting regarding these OEM codes and they refer to VB scripting but I haven't found yet how that relates to the gcode file.

Online ger21

*
  • *
  •  6,291 6,291
    • View Profile
    • The CNC Woodworker
Re: Save current tool position so I can come back to it?
« Reply #9 on: February 20, 2015, 07:58:42 PM »
They need to go into an M code macro. I was assuming that's where you're "routine" was.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html