Hi Brian,
You liked it in here?
I am trying to used the toolset macro of the file section.
The problem is that the Z axis refuses to set to anything other than the original set position. Electronically everything works fine, the z movement stops when the tool touches the top of the probe-plate and then returns to the home position.
Here is what I do:
I home the z axis
I set then tool to close to the top of the work peace and re-zero z Then lift the z and place my 15mm probe plate on top of my work piece Then run the script. The setting in the z DRO is not changing.
When I run "GOTO Z" the probe is going to the originally set 0 position close to the work piece as set in the beginning.
Then I step trough the program,
When the probe stops at the top of my probe, then I then put 15 in the z DRO and run the rest of the program, it stays like that and the top of the work peace is set to 0.
So what am I doing wrong?
I inlude what I am using here:
Zmove = 1.5
Zpos = GetDRO(2)
Tool = GetDRO (24)
ZOffset = GetVar (1000)
If Tool = 0 Then
Response = MsgBox ("Did you zero off the part First?", 4 , "Set up offset")
If (Response = 6) Then ' Yes
ZPos = Zpos - ZMove
Code "G31 Z" & ZPos & " F20.0"
While IsMoving()
Wend
Zpos = GetVar(2002)
Call SetVar (1000,ZPos)
Else
MsgBox "Set zero on the top of the part and run again"
End If
Else
OldZpos = Zpos
ZPos = Zpos - ZMove
Code "G31 Z" & ZPos & " F20.0"
While IsMoving()
Wend
Zpos = GetVar (2002)
Code "G00 Z" & Zpos
While IsMoving()
Wend
If Zpos = OldZpos - ZMove Then
responce = MsgBox ("ERROR! The tool did not hit the probe and DRO was not set" , 4 , "Probe ERROR!" )
Else
SetDRO (2,ZOffset)
End If
End If
Code "G00 G53 Z-.1"
Thank you,
Willy