Hello Guest it is November 24, 2020, 09:17:03 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TPS

221
General Mach Discussion / Re: Gage Block height problem
« on: April 29, 2020, 05:20:55 AM »
can you pls post your Auto tool Zero script?

222
General Mach Discussion / Re: Auto zero script problem
« on: April 29, 2020, 03:58:40 AM »
added some sleep's to your code, maybe it helps

Code: [Select]
ToolRadius = GetOemDRO(1112)/2  'custom tool diameter DRO
PlateOffset = 20  'X and Y offset
PlateThickness = 15  'Z offset

CurrentFeed = GetOemDRO(818)
CurrentAbsInc = GetOemLED(48)
CurrentGmode = GetOemDRO(819)
CurrentFeedOverride = GetOEMDRO(821)


'X 1st Pass at fast rate


Message "X axis 1st pass"
Sleep 2000
If GetOemLed (825) = 0 Then
DoOemButton (1008)
Sleep(250)
SetOemDRO (821,100)
Code "G90 G31 X20 F600"
While IsMoving()
Wend
Sleep(250)
XProbePos = GetVar(2000)
If Abs(XprobePos) <= Abs(20) - 0.1 Then
Code "G0 X" &XProbePos
While IsMoving()
Wend
Call SetDro (0,0)
Sleep(250)
Code "G1 X-1 F1000"
While IsMoving()
Wend
Message "X axis 2nd pass"
Sleep(250)
Else
Code "G53 G0 X" &x
While IsMoving()
Wend
Message "Material not found, check connection and try again"
Code "F" &CurrentFeed
SetOemDRO (821,CurrentFeedOverride)
If CurrentAbsInc = 0 Then Code "G91"
If CurrentGMode = 0 Then Code "G0"
Sleep(250)
Exit Sub
End If
Else
Message "Probe is grounded, check connection and try again"
Code "F" &CurrentFeed
SetOemDRO (821,CurrentFeedOverride)
If CurrentAbsInc = 0 Then Code "G91"
If CurrentGMode = 0 Then Code "G0"
Sleep(250)
Exit Sub
End If


'X 2nd pass at slow rate


DoOEMButton (1008)
Sleep(250)
Code "G31 X2 F30"
While IsMoving()
Wend
Sleep(250)
XProbePos = GetVar(2000)
If Abs(XprobePos) <= Abs(2) - 0.1 Then
Code "G0 X" &XProbePos
While IsMoving()
Wend
Call SetDro (0,ToolRadius)
Sleep(250)
Message "X axis is now zeroed"
Sleep(250)
Code "G91 G0 X-10"
Code "G0 Y-20"
Code "G0 X20"
While IsMoving()
Wend
Sleep(250)
Else
Code "G53 G0 X" &x
While IsMoving()
Wend
Message "Material not found, check connection and try again"
Code "F" &CurrentFeed
SetOemDRO (821,CurrentFeedOverride)
If CurrentAbsInc = 0 Then Code "G91"
If CurrentGMode = 0 Then Code "G0"
Sleep(250)
Exit Sub
End If



'Y 1st Pass at fast rate


Message "(Y axis 1st pass)"
If GetOemLed (825) = 0 Then
DoOemButton (1009)
Sleep(250)
Code "G90 G31 Y20 F600"
While IsMoving()
Wend
Sleep(250)
YProbePos = GetVar(2001)
If Abs(YprobePos) <= Abs(20) - 0.1 Then
Code "G0 Y" &YProbePos
While IsMoving()
Wend
Call SetDro (1,0)
Sleep(250)
Code "G1 Y-1 F1000"
While IsMoving()
Wend
Message "Y axis 2nd pass"
Sleep(250)
Else
Code "G53 G0 Z0"
Code "G53 G0 Y" & y & "X" & x
Code "G53 G0 Z" & z
While IsMoving()
Wend
Message "Material not found, check connection and try again"
Code "F" &CurrentFeed
SetOemDRO (821,CurrentFeedOverride)
If CurrentAbsInc = 0 Then Code "G91"
If CurrentGMode = 0 Then Code "G0"
Sleep(250)
Exit Sub
End If
Else
Message "Probe is grounded, check connection and try again"
Code "F" &CurrentFeed
SetOemDRO (821,CurrentFeedOverride)
If CurrentAbsInc = 0 Then Code "G91"
If CurrentGMode = 0 Then Code "G0"
Sleep(250)
Exit Sub
End If


'Y 2nd pass at slow rate


DoOEMButton (1009)
Sleep(250)
Code "G31 Y2 F30"
While IsMoving()
Wend
Sleep(250)
YProbePos = GetVar(2001)
If Abs(YprobePos) <= Abs(2) - 0.1 Then
Code "G0 Y" &YProbePos
While IsMoving()
Wend
Call SetDro (1,ToolRadius)
Sleep(250)
Message "Y axis is now zeroed"
Code "G91 G0 Y-5"
Code "G0 Z20"
Code "G90 G0 X20 Y20"
While IsMoving()
Wend
Else
Code "G53 G0 Z0"
Code "G53 G0 Y" & y & "X" & x
Code "G53 G0 Z" & z
While IsMoving()
Wend
Message "Material not found, check connection and try again"
Code "F" &CurrentFeed
SetOemDRO (821,CurrentFeedOverride)
If CurrentAbsInc = 0 Then Code "G91"
If CurrentGMode = 0 Then Code "G0"
Sleep(250)
Exit Sub
End If


223
General Mach Discussion / Re: Gage Block height problem
« on: April 29, 2020, 03:40:06 AM »
None of them is Setting a Special Offset.

the one in the left upper Corner is OEMDro(1001) and the set Z button uses this DRO

code of Set Z button
Code: [Select]
Code "G92.2"

'Call SetDRO(24,0)
Call SetDRO(2, ABS(GetOEMDRO(1001)))



the one in the right  bottom Corner is OEMDro(1002) and the set tool Offset button uses this DRO

code of Set tool offset button
Code: [Select]
Tool_Num = GetDRO (24)


If Tool_Num <>0 then
  Z_Shift = GetOEMDRO (1002)
  Z_Offset = GetOEMDRO ( 49 )
  Axis_Pos = GetOEMDRO(85)
  Tool_Offset = Axis_Pos - Z_Offset  -Z_Shift
  Call setOEMDRO(42, Tool_Offset)
End if

224
VB and the development of wizards / Re: Turn tool turret macro
« on: April 28, 2020, 09:51:39 AM »
nice to hear that you got it working.

225
VB and the development of wizards / Re: Turn tool turret macro
« on: April 25, 2020, 02:53:10 AM »
ok if the timer function is not working, you can try to use the time function.

example:
Code: [Select]
Dim TS As Single
Dim TE As Single
Dim TT As Single

'get the starttime
TS = Timer

Sleep 4000

'get the actual time
TE = Timer
TT = TE - TS



MsgBox TT




226
VB and the development of wizards / Re: Turn tool turret macro
« on: April 24, 2020, 01:00:37 PM »
if i run your testcode here in VB Scripter window, i get a result, see attachment

227
VB and the development of wizards / Re: Turn tool turret macro
« on: April 24, 2020, 06:21:30 AM »
did some tests Looks like the Timer Resolution is 10 seconds this code should work better

Code: [Select]
'----------------------------------------------------------------------
'TOOL CHANGE
'----------------------------------------------------------------------

Sub DoToolChange()

SetCurrentTool(NewTool) 'Update the tool DRO
'Call ActivateSignal(OUTPUT6) 'Set tool change allowed signal to PLC
SetTimer(20) 'Clear timer 1
sleep 500

While NOT IsActive(INPUT1)  'While the turret is moving, count down

t = GetTimer(20)
If t > 0.4 Then
Call ToolFailed
End If
Sleep 100
Wend

Call ToolComplete


End Sub
     
 

'----------------------------------------------------------------------
'TOOL COMPLETE
'----------------------------------------------------------------------

Sub ToolComplete()
DeActivateSignal(OUTPUT6)
SetSpinSpeed(PreviousSpeed) 'RPM before tool change called
Message("Tool Change Complete in " & GetTimer(20) & " seconds")
sleep 100
End Sub


228
VB and the development of wizards / Re: Turn tool turret macro
« on: April 23, 2020, 05:46:07 AM »
i think that is what you try to do

Code: [Select]

'Clear timer 1
SetTimer(1)



While IsActive(INPUT1) = False 'While the turret is moving, count down
t = GetTimer(1)

If t > 4000 Then
Call ToolFailed
End If
Sleep 100
Wend

Call ToolComplete




229
VB and the development of wizards / Re: Turn tool turret macro
« on: April 21, 2020, 08:05:19 AM »
what have you selected in Config -> General Config -> Toolchange?

230
VB and the development of wizards / Re: Turn tool turret macro
« on: April 21, 2020, 08:02:47 AM »
put a MSGBox("M6 call") at the beginn of M6 macro just to see that it getting called.