11
VB and the development of wizards / Mach3 Z-Axis direction problem after macro!
« on: January 15, 2015, 01:58:54 PM »
Hello,
I have a "new" problem (I think I had this problem before a few times in other situations):
My M6start and end macro moves the spindle to the toolchange position where i manually change it and press start.
It then measures the height of the new tool and begins with the next job. (Thats what it should do)
The problem is, after measuring the height it exceeds safe-z height and the limit switches trigger.
Normally "Code "G0G53 Z" & GetOEMDRO(54)" would exactly go to safe-z
In this code example it wont.
And another creepy thing to mention is that it also fails to reference Z afterwards.. It references correctly, but then goes in the positive direction instead of negative while trying to clear the limit-switch. (lucky me has only a relatively weak spindle with a motor that detects overcurrent)
The problematic code part:
Code "G0G53 Z" & GetOEMDRO(54)
Code "G0G53 X" & GetOEMDRO(1216) & "G0G53 Y" & GetOEMDRO(1217)
And the full code:
Thanks !
I have a "new" problem (I think I had this problem before a few times in other situations):
My M6start and end macro moves the spindle to the toolchange position where i manually change it and press start.
It then measures the height of the new tool and begins with the next job. (Thats what it should do)
The problem is, after measuring the height it exceeds safe-z height and the limit switches trigger.
Normally "Code "G0G53 Z" & GetOEMDRO(54)" would exactly go to safe-z
In this code example it wont.
And another creepy thing to mention is that it also fails to reference Z afterwards.. It references correctly, but then goes in the positive direction instead of negative while trying to clear the limit-switch. (lucky me has only a relatively weak spindle with a motor that detects overcurrent)
The problematic code part:
Code "G0G53 Z" & GetOEMDRO(54)
Code "G0G53 X" & GetOEMDRO(1216) & "G0G53 Y" & GetOEMDRO(1217)
And the full code:
Code: [Select]
If GetOEMDRO (24) <>0 Then
code "g0 g53 x" & GetOEMDRO(1218) & "g0 g53 y" & GetOEMDRO(1219) 'Go to probe Position
While IsMoving()
Wend
SavedZ = GetOEMDRO(49)
SetOEMDRO(49, 0)
'Probing process
code "g0 g53 z" & -GetOEMDRO(1220) 'Eilfahrt bis "Tasterhöhe"
While IsMoving()
Wend
code "g31 z-1000 f700"
While IsMoving()
Wend
code "M1002"
'Setting Variables
Z_Shift = GetOEMDRO (1221) 'Einstellbares Offset ggf.
Tool_Offset = getVar(2002)'Var method
Call setOEMDRO(42, Tool_Offset)
SetOEMDRO(49, SavedZ)
Code "G0G53 Z" & GetOEMDRO(54)
Code "G0G53 X" & GetOEMDRO(1216) & "G0G53 Y" & GetOEMDRO(1217)
'Re-enable coolant
If GetUSERLED(1200)<>1 Then
If GetOEMLED(12) Then
Else
DoOEMButton(114)
End If
SetUSERLED(1200, 1)
End If
Else
MsgBox "Keine Werkzeug-Nummer gewählt",0
End If
Thanks !