Hello Guest it is March 28, 2024, 08:38:14 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.


Topics - gil.925

Pages: 1
1
 This macro is for Emco Compact 5  ( 6 tool holder).
I fail the test!  :-\
How I can include a limit switch at position (0)?
Without a syntax error?
I have no idea where is the error.
I will appreciate recommendations!!!
Thanks & Best regards!!

-----------------------------------------------------------------
 If GetSelectedTool() = GetCurrentTool() Then
 End If
 
 
 If GetSelectedTool = 0 Then
 ActivateSignal(OutPut7)          'Motor CW
 Sleep 500                              'Here I need a limit Switch ???
 ActivateSignal(OutPut6)          'Motor CCW
 While IsMoving(100)                'Wait
 Wend
 DeActivateSignal(OutPut7)
 DeActivateSignal(OutPut6)
 End If
 
 If GetSelectedTool = 1 Then
 ActivateSignal(OutPut7)
 Sleep 1000
 ActivateSignal(OutPut6)
 While IsMoving(100)
 Wend
 DeActivateSignal(OutPut7)
 DeActivateSignal(OutPut6)
 End If

  If GetSelectedTool = 2 Then
 ActivateSignal(OutPut7)
 Sleep 2000
 ActivateSignal(OutPut6)
 While IsMoving(100)
 Wend
 DeActivateSignal(OutPut7)
 DeActivateSignal(OutPut6)
 End If
 
 If GetSelectedTool = 3 Then
 ActivateSignal(OutPut7)
 Sleep 3000
 ActivateSignal(OutPut6)
 While IsMoving(100)
 Wend
 DeActivateSignal(OutPut7)
 DeActivateSignal(OutPut6)
 End If

 If GetSelectedTool = 4 Then
 ActivateSignal(OutPut7)
 Sleep 4000
 ActivateSignal(OutPut6)
 While IsMoving(100)
 Wend
 DeActivateSignal(OutPut7)
 DeActivateSignal(OutPut6)
 End If

 If GetSelectedTool = 5 Then
 ActivateSignal(OutPut7)
 Sleep 5000
 ActivateSignal(OutPut6)
 While IsMoving(100)
 Wend
 DeActivateSignal(OutPut7)
 DeActivateSignal(OutPut6)
 End If

 Call SetUserDRO(200,NewTool)
 SetCurrentTool
 End Sub

 Select Case ToolNumber
   Case Is=0
    Code"G00 X1.5"
    Code"G00 Z5.0"
   Case Is=1
    Code"G00 X1.5"
    Code"G00 Z5.0"
   Case Is=2
    Code"G00 X1.5"
    Code"G00 Z5.0"
   Case Is=3
    Code"G00 X1.5"
    Code"G00 Z5.0"
   Case Is=4
    Code"G00 X1.5"
    Code"G00 Z5.0"
   Case Is=5
    Code"G00 X1.5"
    Code"G00 Z5.0"
 End Select
 End Sub
 Main

Pages: 1