Hello Guest it is March 29, 2024, 09:18:53 AM

Author Topic: homing or toolchange macro help needed  (Read 3785 times)

0 Members and 1 Guest are viewing this topic.

homing or toolchange macro help needed
« 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

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: homing or toolchange macro help needed
« Reply #1 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)

   

« Last Edit: November 02, 2008, 07:13:53 AM by Hood »

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: homing or toolchange macro help needed
« Reply #2 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

Offline budman68

*
  • *
  •  2,352 2,352
    • View Profile
Re: homing or toolchange macro help needed
« Reply #3 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
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)
Re: homing or toolchange macro help needed
« Reply #4 on: November 02, 2008, 02:40:35 PM »
Thanks Hood, thats done the trick  ;D