Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: softselect on November 01, 2008, 04:17:07 PM

Title: homing or toolchange macro help needed
Post by: softselect on November 01, 2008, 04:17:07 PM
Hi Everyone,
I am trying to write a macro that will move to a home or tool change position for milling
it looks like this

Feed=GetDRO(18)
ofset=GetDRO(0)    - This must read which coordinate is active G54, g55, g56 etc.
code "g54"             - This must set G54 (Machine coordinates
Code "g00  Z0"      - This must move Z home (or tool change position)
code "g00 x0 y0"   - This must home X and Y
SetDRO(18,Feed)  - this must restore feedrate
setDRO(0,ofset)  - This must restore coordinate that was used before homing (this line seems to be the problem)

sadly this macro doesn't work
can anyone please help
Title: Re: homing or toolchange macro help needed
Post by: Hood on November 02, 2008, 06:43:13 AM
There are a lot better at VB and G Code than me but give this a go and see if it does what you want. I am not sure if you actually need to set your feedrate  DRO as you have because they shouldnt really change anyway.

Hood

Feed=GetDRO(18)
 ofset=GetDRO(0)    'This must Read which coordinate is active G54, g55, g56 etc.

         
Code ("G53 G0  Z0")      'This must move Z home (Or tool change position)
While IsMoving
Sleep (10)
Wend
code ("g53 G0 x0 y0")   ' This must home X And Y
While IsMoving
Sleep (10)
Wend
Call SetDRO(18,Feed)  'this must restore feedrate
Call setDRO(0,ofset)  'This must restore coordinate that was used before homing (this Line seems To be the problem)

   

Title: Re: homing or toolchange macro help needed
Post by: Hood on November 02, 2008, 07:12:40 AM
Just been messing with it, maybe this would be better but again I dont really know what I am doing so test with caution.
Hood

 Feed=GetDRO(18)
 ofset=GetDRO(46)    'This must Read which coordinate is active G54, g55, g56 etc.

         
Code ("G53 G0  Z0")      'Moves Z to Machine CoOrds Zero
While IsMoving
Sleep (10)
Wend
code ("g53 G0 x0 y0")   ' Moves X and Y to Machine CoOrds Zero
While IsMoving
sleep (10)
Wend
Call SetDRO(18,Feed)  'Sets feedrate DRO (Not sure this is really needed)
Code ("ofset") 'Sets back to previous offset
End
Title: Re: homing or toolchange macro help needed
Post by: budman68 on November 02, 2008, 08:46:02 AM
Quote
but again I dont really know what I am doing so test with caution.

Welcome to my world -  :D

Dave
Title: Re: homing or toolchange macro help needed
Post by: softselect on November 02, 2008, 02:40:35 PM
Thanks Hood, thats done the trick  ;D