Hello Guest it is March 28, 2024, 04:06:29 PM

Author Topic: I want to move Tool down slowly at ATC macro scriptm MACH3  (Read 3334 times)

0 Members and 1 Guest are viewing this topic.

Offline Julie

*
  •  18 18
    • View Profile
I want to move Tool down slowly at ATC macro scriptm MACH3
« on: November 12, 2014, 03:29:55 AM »
Hello,All.
I'm studying ATC macro. I reference below script.
But tool's down move feed rate is too fast, so i modifying it.
I inserted [ Code "F200"] above red font code, but have no effect.
How can i solve a problem? ???
Please help me!
Thank you!

 



Sub Main()         'Define variables
OldTool = GetOEMDRO (1200)    
x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
tool = GetSelectedTool()
NewTool = tool
MaxToolNum = 5            'Maximum number of tools to use.
ToolDown   = -50       'Height for the tool change.
ToolUp     = 0.0          'Height the Z-axis for the tool change.
PosSec      = 50.0      'Safe Position.
If NewTool = OldTool Then
   Exit Sub
End If
While NewTool > MaxToolNum
NewTool = Question ("Place valid tool number (between 1 y 5)")
Wend
Code "G00 G53 Z" & ToolUp     'The z-axis is going to "machine zero"
While IsMoving()
Wend
Code "G53 y" & PosSec       'Going to safe position.  
While IsMoving()
Wend
Code "G53 Z" & ToolDown      'Down to the height of tools
While IsMoving()
Wend
Call MovePos(OldTool)      'Going to the last position to relase the old tool.
While IsMoving()
Wend
ActivateSignal(Output1)    'Relase the tool.
Code "G4 P1.0"
Code "G53 Z" & ToolUp        
While IsMoving()
Wend
Call MovePos(NewTool)      'Go to the new tool position.
While IsMoving()
Wend
Code "G53 Z" & ToolDown      'down the z-axis to hold the tool.
While IsMoving()
Wend
DeActivateSignal(Output1)    'hold the new tool.
Code "G4 P1.0"
Code "G53 y" & PosSec       'Returns to the safe position.
While IsMoving()
Wend
Code "G53 Z" & ToolUp      'Returns z-axis to "machine zero".
Call SetUserDRO (1200,NewTool)
SetCurrentTool( NewTool )
End Sub

Sub MovePos(ByVal ToolNumber As Integer)

Select Case ToolNumber      'Here set the position of each tool.
       Case Is = 1
         Code "G00 G53 x12.0"
    Code "G00 G53 y5.0"
       Case Is = 2
         Code "G00 G53 x24.0"
    Code "G00 G53 y5.0"
       Case Is = 3
         Code "G00 G53 x36.0"
    Code "G00 G53 y5.0"
       Case Is = 4
         Code "G00 G53 x48.0"
    Code "G00 G53 y5.0"
       Case Is = 5
         Code "G00 G53 x60.0"
    Code "G00 G53 y5.0"
End Select

End Sub
Main  
« Last Edit: November 12, 2014, 03:32:59 AM by Hyojung »

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: I want to move Tool down slowly at ATC macro scriptm MACH3
« Reply #1 on: November 12, 2014, 07:13:00 AM »
Change Code "G00 G53" to "G01 G53".
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline Julie

*
  •  18 18
    • View Profile
Re: I want to move Tool down slowly at ATC macro scriptm MACH3
« Reply #2 on: November 12, 2014, 07:57:37 AM »
Thank you!!
You are the BEST!!!