Welcome, Guest. Please login or register.
Did you miss your activation email?
November 24, 2014, 01:23:19 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  Tool changer macro help
Pages: 1   Go Down
Print
Author Topic: Tool changer macro help  (Read 4777 times)
0 Members and 1 Guest are viewing this topic.
stvracer
Active Member

Offline Offline

Posts: 4


View Profile
« on: April 08, 2007, 12: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             
 
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 2,111


Briceville, TN, USA


View Profile WWW
« Reply #1 on: April 08, 2007, 08:33:05 AM »

You need to put your "SystemWait()" at the END of your Macro, in where your PLC can send a "tool change done bit" to you input 4
Logged

Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
https://sites.google.com/site/sssystemsautomation/
stvracer
Active Member

Offline Offline

Posts: 4


View Profile
« Reply #2 on: April 08, 2007, 12:23:01 PM »

Thanks I will give that a try later today. MY tool change bit is only on about .5 second after the tool change is this ok?
Logged
stvracer
Active Member

Offline Offline

Posts: 4


View Profile
« Reply #3 on: April 09, 2007, 12:08:25 AM »

I got it to work by putting a pause after the (g53 g0 z0) that let the plc engage and lockout the input1. I could not get SystemWaitFor ( INPUT4 ) to let the system go even with the input signal working. Is there additional code that goes with systemwaitfor ()  that makes it work?
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 2,111


Briceville, TN, USA


View Profile WWW
« Reply #4 on: April 09, 2007, 10:27:05 PM »

Swap you active hi/low setting on imput4 and see if you see it then, when input 4 is active, and see if systemwait drops out.
Logged

Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
https://sites.google.com/site/sssystemsautomation/
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!