Hello Guest it is April 27, 2024, 07:28:11 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

2221
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 09, 2015, 08:53:46 AM »
Hi,

found a mistake in my code:

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
    


copy and paste error

2222
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 09, 2015, 08:51:00 AM »
so what is happening,

can you see Input1 - Input4 changing in diagnostic screen,
when it rotates ?

Thomas

2223
Hi,

simple example to open the calculator

X = Shell("Calc.exe", 1) ' Shell Calculator.

Thomas

2224
General Mach Discussion / Re: Mach3 connect to RAMPS 1.4
« on: October 09, 2015, 04:24:05 AM »
Hi,

if you use RAMPS 1.4 with the Arduiono software,
you only need "universal g code sender" (google for it).

Thomas

2225
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 09, 2015, 04:17:17 AM »
Hi,
i have written down a small test script, not tested:

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 = GetTurrent + 1
    End if
    
    If IsActive(Input1) Then
        GetTurret = GetTurrent + 2
    End if

    If IsActive(Input1) Then
        GetTurret = GetTurrent + 4
    End if

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


Regards Thomas

2226
VB and the development of wizards / Re: Mach3 Probe HELP
« on: October 05, 2015, 05:53:56 AM »
ok, here the corrected version:

Sub Main

cutheight = 20
cutpos = 0
ZProbePos = 0

    Code "G31 Z-200 F150" 'do the probing
    While IsMoving() 'wait for finish
    Wend           
   
    'get the position where we hit the probe
    ZProbePos = GetVar(2002)   
    cutpos = ZProbePos - cutheight

    'go to cutting heigt
    code "G1 Z" + CStr(cutpos) + "F100"

    'set new z-Pos
    SetDRO(2,cutheight)

End Sub


but the logic  sequence would be to do a ref all first,
and the run the script, because the ref Z will "destroy"
your probe height.

Thomas



2227
VB and the development of wizards / Re: Mach3 Probe HELP
« on: October 05, 2015, 05:28:28 AM »
what exactly did not work ?

did you do a ref all after the probe ?

2228
VB and the development of wizards / Re: Mach3 Probe HELP
« on: October 05, 2015, 04:58:52 AM »
Hi,

a simple example for metric would be:

Sub Main

cutheight = 20
cutpos = 0
ZProbePos = 0

    Code "G31 Z-200 F150" 'do the probing
    While IsMoving() 'wait for finish
    Wend           
   
    'get the position where we hit the probe
    ZProbePos = GetVar(2002)   
    cutpos = ZProbePos - cutheight

    'go to cutting heigt
    code "G1 Z" + cutpos + "F100"

    'set new z-Pos
    SetDRO(2,cutheight)

End Sub

not tested, just written down.

Thomas

2229
VB and the development of wizards / Re: Mach3 Probe HELP
« on: October 05, 2015, 02:50:44 AM »
Hi,

post your vbscript an we will see, but remember
the probing is only measuring the length of the
tool, nothing else.

Thomas

2230
Hi Mark,

never used the Tangential functionality, but i think it will rotate the knife,
because this is the basic function of tangential control.

Thomas