Hello Guest it is April 26, 2024, 07:39:07 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 - stvracer

Pages: 1
1
General Mach Discussion / Tool changer macro help
« on: April 08, 2007, 01:01:21 AM »
Hi All
 I can't seem to get Mach3 2.00.061 to wait for my plc to change the tool when the config screen is set to automatic tool changer. It works fine if I set it to stop spindle and wait but I have to be there to push the cycle start after each tool change is complete. Any help would be much appreciated, Here is my m6start.m1s macro.



Num_Positions = 16
Code ("G53 g0 z0")
While IsMoving()
Wend
'SystemWaitfor ( INPUT4 )'toolchange complete signal
OldTool = GetOemDRO (1200) 'Tool In spindle DRO
While OldTool > Num_Positions Or OldTool <= 0     ' Check for a valid tool   
OldTool = Question ("Invalid Tool , Current Tool Number?")   
Wend
tool = GetSelectedTool() 
While Tool > Num_Positions Or Tool <= 0 ' Check for a valid tool   
Tool = Question ("Invalid Tool Requested, New Tool Number?")   
Wend   
NewTool = Tool
If NewTool = OldTool Then
   Exit Sub
End if
ToolDif1 = NewTool - OldTool 
ToolDif2 = OldTool - NewTool
If ToolDif1 < ToolDif2 Then
CarMove = ToolDif2
ActivateSignal( 8 )           'set carrosel to turn cw
Else
CarMove = ToolDif1
DeActivateSignal( 8 )         'set carrosel to turn ccw
End If
setmodoutput ( 64 , CarMove ) ' set plc counter to rotate number of positions
ActivateSignal( 9 )           ' activate toolchange
While IsActive (20)           ' wait for counter
Wend
DeActivateSignal( 9 )         ' insert tool and retract
Call SetUserDRO (1200,NewTool) 


Thanks
Steve
SKFab             
 

Pages: 1