''========================================================================================
'  Created From: LengthCompDisable.m3m
'  Includes: 
'       ../Common.def
'       ./ToolLengthComp.def
''========================================================================================

''========================================================================================
''	 Included Definitions:
''========================================================================================
MachAAxisOEMDRO = 		803	' A Axis OEM DRO
''========================================================================================

''
'   Bogus G49 Macro
'
'   Usage:
'       M149
''

'#filename "M849.m1s"
'#include "Common.def"
'#include "ToolLengthComp.def"

''========================================================================================
''	Start of Macro Code
''========================================================================================

' See where the knee is now
CurrentPos = GetOEMDRO(MachAAxisOEMDRO)
Message "CurrentPos=" & CurrentPos & " ToolOffset=" & ToolOffset
If CurrentPos > 0 Then
    ' Make sure we always move UP to final position
    Code "G0 A-0.100"
    ' Macro:     #WaitUntilStopped

    ' Wait until machine is stopped
    While IsMoving ()
        Sleep 10
    Wend
    ' End Macro: #WaitUntilStopped
End If    
Code "G0 A0.000"
' Macro: #WaitUntilStopped
' Wait until machine is stopped
While IsMoving ()
    Sleep 10
Wend
' End Macro: #WaitUntilStopped
