Hello Guest it is December 08, 2019, 06:09:53 PM

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

1121
General Mach Discussion / Re: HOTKEY TO OUTPUT RELAY
« on: October 15, 2015, 08:58:56 AM »
Hello DAS,

as far i know, it is not possible to switch a output only while the key is pressed.

the macro is only trigged once when the key is pressed, not when the key ist released.
for the moment i know no way to realise this.

Thomas

1122
Hi Mark,

attached a small excelfile, try it not tested in all conditions.

m = (YEnd-YStart) / (XEnd-XStart)
q = YStart - m * XStart

XPre  =  XStart + 10
YPre =  m * XPre + q

Thomas

1123
General Mach Discussion / Re: HOTKEY TO OUTPUT RELAY
« on: October 15, 2015, 03:52:32 AM »
Hi Das,

put this little script into the button


'GetOEMLed(77) -> Output4
'GetOEMLed(78) -> Output5
'GetOEMLed(79) -> Output6

If GetOEMLed(79) Then
   DeActivateSignal(Output6)
Else
   ActivateSignal(Output6)
End If


but dont forget to activate the output in port's & pin's

Thomas

1124
Hi Mark,

i know tangential cutting from cutting glas.

i allway did a smal move "in the air" to get the wheel orientated
like this:

G0 X110  Y110     -     move to preposition
G1 X100  Y100     -     move to position to get knife orientated
G1 Z1                  -     plunge knife
G1 X10  Y10         -     Cut to end position

Thomas

1125
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 13, 2015, 04:40:56 AM »
Sorry my fault.

here the version with OEMTRIG1

Code: [Select]
Sub Main()
' -------------------------------------------------------------------------------
' TPS 09.10.2015  
' simple Test for Toolchange
' -------------------------------------------------------------------------------

' pin2 is mapped to Input1
' pin3 is mapped to Input2
' pin4 is mapped to Input3
' pin5 is mapped to Input4
' charger seated is mapped to OEMTRIG1

'get the new tool ---------------------------------------------------------------
tool = GetSelectedTool()

' nothing to do
If GetSelectedTool() = GetCurrentTool() Then
     message("Tool is the same NO tool change needed")
   END
End If
 
If  tool > 8 Or tool < 1 Then 'check tool number to be in range
    Message (" Tool " & tool & " is not a valid Number 1-8 ONLY, ENDING Program RUN ")
    DoButton(3)
    End
End If

 
Dim ActTurretPos as long
ActTurretPos = 0

'get actual starttime
Starttime = Timer

Message "Moving to Tool# " &GetselectedTool()

   ActivateSignal(output5)  'unlocks stop dog
   Sleep(1000)              'wait for a second
   ActivateSignal(OutPut6)  'turn air motor on
  
   While ActTurretPos <> tool 'turn until we are in the wright position
      ActTurretPos = GetTurret()
      Akttime = Timer
      If Akttime - Starttime > 20 then 'Timeout 20s
        Message("Turret timeout")
        DeActivateSignal(output5)    'locks stop dog
        Sleep(1000)                  'wait for a second
        DeActivateSignal(OutPut6)    'turn air motor off
        End
      End if
   Wend
  
   DeActivateSignal(output5)    'locks stop dog
   Sleep(1000)                  'wait for a second
   DeActivateSignal(OutPut6)    'turn air motor off
   sleep(1000)

    'look for OEMTRIG1
    if not IsActive(OEMTRIG1) then
        DOButton(3)
        Messagebox("Tool changer not seated!")
        End
    End If    

    Message("Tool " & tool & " Loaded")
   SetCurrentTool( tool )
  
End Sub

  

'function to get the actual turret positiom
Function GetTurret() As Long
GetTurret = 0
    If IsActive(Input1) Then
        GetTurret = GetTurret + 1
    End if
    
    If IsActive(Input2) Then
        GetTurret = GetTurret + 2
    End if

    If IsActive(Input3) Then
        GetTurret = GetTurret + 4
    End if

    If IsActive(Input4) Then
        GetTurret = GetTurret + 8
    End if
    
End Function
    


1126
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 12, 2015, 04:22:35 PM »
OK something like this should work,
##

oemtrigger1 is not ok input5 would be great

Code: [Select]
Sub Main()
' -------------------------------------------------------------------------------
' TPS 09.10.2015  
' simple Test for Toolchange
' -------------------------------------------------------------------------------

' pin2 is mapped to Input1
' pin3 is mapped to Input2
' pin4 is mapped to Input3
' pin5 is mapped to Input4
' oemtrigger1 is mapped to input5

'get the new tool ---------------------------------------------------------------
tool = GetSelectedTool()

' nothing to do
If GetSelectedTool() = GetCurrentTool() Then
     message("Tool is the same NO tool change needed")
   END
End If
 
If  tool > 8 Or tool < 1 Then 'check tool number to be in range
    Message (" Tool " & tool & " is not a valid Number 1-8 ONLY, ENDING Program RUN ")
    DoButton(3)
    End
End If

 
Dim ActTurretPos as long
ActTurretPos = 0

'get actual starttime
Starttime = Timer

Message "Moving to Tool# " &GetselectedTool()

   ActivateSignal(output5)  'unlocks stop dog
   Sleep(1000)              'wait for a second
   ActivateSignal(OutPut6)  'turn air motor on
  
   While ActTurretPos <> tool 'turn until we are in the wright position
      ActTurretPos = GetTurret()
      Akttime = Timer
      If Akttime - Starttime > 20 then 'Timeout 20s
        Message("Turret timeout")
        DeActivateSignal(output5)    'locks stop dog
        Sleep(1000)                  'wait for a second
        DeActivateSignal(OutPut6)    'turn air otor off
        End
      End if
   Wend
  
   DeActivateSignal(output5)    'locks stop dog
   Sleep(1000)                  'wait for a second
   DeActivateSignal(OutPut6)    'turn air otor off

sleep(1000)
    'look for Input5
    if not IsActive(Input1) then
        DOButton(3)
        Messagebox("Tool changer not seated!")
end
    End If    

    Message("Tool " & tool & " Loaded")
   SetCurrentTool( tool )
  
End Sub

  

'function to get the actual turret positiom
Function GetTurret() As Long
GetTurret = 0
    If IsActive(Input1) Then
        GetTurret = GetTurret + 1
    End if
    
    If IsActive(Input2) Then
        GetTurret = GetTurret + 2
    End if

    If IsActive(Input3) Then
        GetTurret = GetTurret + 4
    End if

    If IsActive(Input4) Then
        GetTurret = GetTurret + 8
    End if
    
End Function
    

Thomas

1127
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 12, 2015, 02:25:22 AM »
Hi,

ok here with stop dog

Code: [Select]
Sub Main()
' -------------------------------------------------------------------------------
' TPS 09.10.2015 
' simple Test for Toolchange
' -------------------------------------------------------------------------------

' pin2 is mapped to Input1
' pin3 is mapped to Input2
' pin4 is mapped to Input3
' pin5 is mapped to Input4


'get the new tool ---------------------------------------------------------------
tool = GetSelectedTool()

' nothing to do
If GetSelectedTool() = GetCurrentTool() Then
     message("Tool is the same NO tool change needed")
   END
End If
 
Dim ActTurretPos as long
ActTurretPos = 0

'get actual starttime
Starttime = Timer

Message "Moving to Tool# " &GetselectedTool()

   ActivateSignal(output5)  'unlocks stop dog
   Sleep(1000)              'wait for a second
   ActivateSignal(OutPut6)  'turn air motor on
   
   While ActTurretPos <> tool 'turn until we are in the wright position
      ActTurretPos = GetTurret()
      Akttime = Timer
      If Akttime - Starttime > 20 then 'Timeout 20s
        Message("Turret timeout")
        DeActivateSignal(output5)    'locks stop dog
        Sleep(1000)                  'wait for a second
        DeActivateSignal(OutPut6)    'turn air otor off
        End
      End if
   Wend
   
   DeActivateSignal(output5)    'locks stop dog
   Sleep(1000)                  'wait for a second
   DeActivateSignal(OutPut6)    'turn air otor off

    Message("Tool " & tool & " Loaded")
   SetCurrentTool( tool )
   
End Sub

 

'function to get the actual turret positiom
Function GetTurret() As Long
GetTurret = 0
    If IsActive(Input1) Then
        GetTurret = GetTurret + 1
    End if
   
    If IsActive(Input2) Then
        GetTurret = GetTurret + 2
    End if

    If IsActive(Input3) Then
        GetTurret = GetTurret + 4
    End if

    If IsActive(Input4) Then
        GetTurret = GetTurret + 8
    End if
   
End Function
   


Thomas

1128
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 09, 2015, 03:07:55 PM »
ok,
maybe tomorrow.

1129
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 09, 2015, 09:14:41 AM »
ok,

here with DeActivate(Output6) and timeout,
hope it works.

Code: [Select]
Sub Main()
' -------------------------------------------------------------------------------
' TPS 09.10.2015  
' simple Test for Toolchange
' -------------------------------------------------------------------------------

' pin2 is mapped to Input1
' pin3 is mapped to Input2
' pin4 is mapped to Input3
' pin5 is mapped to Input4


'get the new tool ---------------------------------------------------------------
tool = GetSelectedTool()

' nothing to do
If GetSelectedTool() = GetCurrentTool() Then
     message("Tool is the same NO tool change needed")
   END
End If
 
Dim ActTurretPos as long
ActTurretPos = 0

Starttime = Timer

Message "Moving to Tool# " &GetselectedTool()

   ActivateSignal(OutPut6)
   While ActTurretPos <> tool
      ActTurretPos = GetTurret()
      Akttime = Timer
      If Akttime - Starttime > 20 then 'Timeout 20s
       Message("Turret timeout")
       DeActivateSignal(OutPut6)
       End
      End if
   Wend
   DeActivateSignal(OutPut6)
   Message("Tool " & tool & " Loaded")
   SetCurrentTool( tool )
  
End Sub

  

'function to get the actual turret positiom
Function GetTurret() As Long
GetTurret = 0
    If IsActive(Input1) Then
        GetTurret = GetTurret + 1
    End if
    
    If IsActive(Input2) Then
        GetTurret = GetTurret + 2
    End if

    If IsActive(Input3) Then
        GetTurret = GetTurret + 4
    End if

    If IsActive(Input4) Then
        GetTurret = GetTurret + 8
    End if
    
End Function
    



1130
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 09, 2015, 08:56:19 AM »
pls copy code again, did an other change.

Code: [Select]

Sub Main()
' -------------------------------------------------------------------------------
' TPS 09.10.2015 
' simple Test for Toolchange
' -------------------------------------------------------------------------------

' pin2 is mapped to Input1
' pin3 is mapped to Input2
' pin4 is mapped to Input3
' pin5 is mapped to Input4


'get the new tool ---------------------------------------------------------------
tool = GetSelectedTool()

' nothing to do
If GetSelectedTool() = GetCurrentTool() Then
     message("Tool is the same NO tool change needed")
   END
End If
 
Dim ActTurretPos as long
ActTurretPos = 0

Message "Moving to Tool# " &GetselectedTool()

   ActivateSignal(OutPut6)
   While ActTurretPos <> tool
      ActTurretPos = GetTurret() 
   Wend
   ActivateSignal(OutPut6)
   Message("Tool " & tool & " Loaded")
   SetCurrentTool( tool )
   
End Sub

 

'function to get the actual turret positiom
Function GetTurret() As Long
GetTurret = 0
    If IsActive(Input1) Then
        GetTurret = GetTurret + 1
    End if
   
    If IsActive(Input2) Then
        GetTurret = GetTurret + 2
    End if

    If IsActive(Input3) Then
        GetTurret = GetTurret + 4
    End if

    If IsActive(Input4) Then
        GetTurret = GetTurret + 8
    End if
   
End Function