Hello Guest it is April 25, 2024, 06:42:31 PM

Author Topic: DIY machine tool change VB part of the problem Can help  (Read 3212 times)

0 Members and 1 Guest are viewing this topic.

DIY machine tool change VB part of the problem Can help
« on: March 18, 2013, 05:17:06 AM »
DIY machine tool change VB part of the problem Can help
Internet po a tool change program
Including a program to let him wait for the signal does not operate machine stops after execution
Do not know less to configure what makes the machine signals
Program {SystemWaitFor (7)' Wait for the tool Release Limit switch}
JNC-40M-axis control card IN7 knife contacts knife contacts test OK
Page to go to the the MACH3 input point the INPUT3 set axis control card IN6 do a test the MACH3 of INPUT3 light will shine
I then changed the program
1-SystemWaitFor (INPUT7) 'Wait for the tool Release Limit switch
In7 contact short-circuit
Machine stop waiting for signal
And modified to become
2-SystemWaitFor (INPUT6) 'Wait for the tool Release Limit switch
IN6 contact short-circuit
Machine stop waiting for signal
And modified to
3-SystemWaitFor (INPUT3) 'Wait for the tool Release Limit switch
IN6 contact short-circuit
Machine stop waiting for signal
I would like to ask how to get it to

Internet po a tool change program
'ToolChange Macro For Bed type tool changer 11/05 Brian
Sub Main()
OldTool = GetOEMDRO (1200) 'Tool In spindle DRO You must add this to your settings screen
x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
tool = GetSelectedTool()
NewTool = tool
'Tool Changer Macro (Bed Type)
MaxToolNum = 8      'Max number off tools for the changer
ToolDown   = -70 'Z Pos to Get or drop a tool
ToolUp     = 0.0    'Z Hieght to Rapid from tool to tool
If NewTool = OldTool Then
        Exit Sub
End If
While NewTool > MaxToolNum
NewTool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend
Code "G00 G53 Z" & ToolUp
While IsMoving()
Wend
Call MovePos(OldTool)
While IsMoving()
Wend
Code "G53 Z" & ToolDown
Code "G4 P.75"
While IsMoving()
Wend
ActivateSignal(Output5) 'Turn On Draw bar to release the tool
Code "G4 P1.0"    'Wait for the tool to release
'SystemWaitFor (INPUT7) 'Wait for the tool Release Limit switch
Code "G53 Z" & ToolUp
Call MovePos(NewTool)
While IsMoving()
Wend
Code "G53 Z" & ToolDown
Code "G4 P.75"
While IsMoving()
Wend
DeActivateSignal(Output5) 'Turn Off Draw bar to Clamp the tool
Code "G4 P1.0"    'Wait for the tool to Clamp
While IsMoving()
Wend
Code "G53 Z" & ToolUp
Call SetUserDRO (1200,NewTool)
SetCurrentTool( NewTool )
Code "G00 X" & x & " Y" & y 'Move back to where the tool change was prompted
End Sub
Sub MovePos(ByVal ToolNumber As Integer)
Select Case ToolNumber
       Case Is = 1
         Xpos = 12.00
         YPos = 2.00
       Case Is = 2
         Xpos = 14.00
         YPos = 2.00
       Case Is = 3
         Xpos = 16.00
         YPos = 2.00
       Case Is = 4
         Xpos = 18.00
         YPos = 2.00
       Case Is = 5
         Xpos = 12.00
         YPos = 4.00
       Case Is = 6
         Xpos = 14.00
         YPos = 4.00
       Case Is = 7
         Xpos = 16.00
         YPos = 4.00
       Case Is = 8
         Xpos = 18.00
         YPos = 4.00
End Select
Code "G53 X" & XPos & " Y" & YPos
End Sub
Main