Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: giannis121 on November 04, 2011, 03:22:34 PM

Title: Actual position when i hit pause.
Post by: giannis121 on November 04, 2011, 03:22:34 PM
How can i record the exact position on X & Y axis when i hit pause?

When the machine is running and i hit pause, it takes some time until the machine deccelerates and stops.
So, i want to record the exact position and current line and move automaticaly back to this position.

Does GetVar(2000) or GetParam(XDRO) have to do anything with that?

Any ideas please...
Giannis
Title: Re: Actual position when i hit pause.
Post by: BR549 on November 04, 2011, 04:29:43 PM
There is not a way to do that BUT you can get really close.  The capture code will be just a Squeek before the actual pause process starts.

You have to modify the Pause button to allow CB code. It depends on where you want to store the variables Xpos Ypos. This example stores the Xpos and Ypos tand Zpos to #vars 1000 and 1001and 1002. And the current line number to #var 1003

SetVar(1000,GetDro(0))
SetVar(1001,GetDro(1))
SetVar(1002,GetDro(2))
SetVar(1003,GetDro(16))                                                                                                                            
DoButton(1)
While Ismoving()
Wend
Code"G91"
Code" G0 Z.250"
Code"G90"
Code" G0 X#1000 Y#1001 Z#1002"
Code" SetDro(16,GetVar(1003))


Hope that helps, (;-) TP