Hello Guest it is March 28, 2024, 01:39:48 PM

Author Topic: Tool measure macro  (Read 39953 times)

0 Members and 1 Guest are viewing this topic.

Re: Tool measure macro
« Reply #10 on: August 02, 2006, 09:09:19 PM »
Here you are:
http://www.machsupport.com/MachCustomizeWiki/index.php?title=OEM_DROs
This is the Wiki and I would love to see you put your probe macro into the Wiki :)
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: Tool measure macro
« Reply #11 on: August 17, 2006, 09:20:00 AM »
Hello Fabiano,

I sent you a PM but I don't know if you saw it. Could you please post a copy of your tool change macro ? It would definitely help me a lot as I have absolutely no experience in VB script.

Thanks
Jean-Louis
Jean-Louis
Re: Tool measure macro
« Reply #12 on: August 17, 2006, 08:05:47 PM »
Could you please post more about what you would like?
Thank you
Brian
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: Tool measure macro
« Reply #13 on: August 17, 2006, 08:52:48 PM »
Hi Brian,

Sorry I may have used wrong terms. What I actually would like to get is a tool probe macro as described by Fabiano (tool change position --> tool measurement --> tool change position --> new tool measurement).

I'm trying to understand the macro's listed above nevertheless, as I'm a real dummy in scripting, I wanted to get the final macro that Fabiano successfully used as a valid basis to make test on my machine.

Thanks
Jean-Louis
Jean-Louis
Re: Tool measure macro
« Reply #14 on: August 17, 2006, 09:37:19 PM »
I hope he will be nice and post the Code :)
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: Tool measure macro
« Reply #15 on: August 18, 2006, 06:01:25 AM »
Yes, I hope too ;)
Jean-Louis

Offline faby

*
  •  74 74
    • View Profile
Re: Tool measure macro
« Reply #16 on: August 20, 2006, 06:28:03 AM »
Here I am...
I was on holiday, I read the new posts only now.
I'll send the code as soon as possible, I keep it on another Pc.

Faby

Offline faby

*
  •  74 74
    • View Profile
Re: Tool measure macro
« Reply #17 on: August 21, 2006, 09:57:10 AM »
Here it is, my macro:

ChX = GetUserDRO( 1200 )
ChY = GetUserDRO( 1201 )
ChZ = GetUserDRO( 1202 )

Code "G53 G00 Z-1" 'Move the tool all the way up
While IsMoving()
Wend
ZOld = Getdro(2)
Code "G53 G00 X" & ChX & "Y" & ChY 'Move to the probe position
While IsMoving()
Wend

Code "G31 Z-230 F450" 'Z move down untill hit
While IsMoving()
Wend
HitOld = GetVar(2002) 'Get the Position that the Porbe hit at
Code "G53 G00 Z-1"'Z move all way up
Code "G53 G00 X65 Y-200" 'Move to change tool position
While IsMoving()
Wend

MsgBox ("Insert the new tool")

Code "G53 G00 X" & ChX & "Y" & ChY 'Move to the probe position
While IsMoving()
Wend

Code "G31 Z-230 F450" 'Z move down untill hit
While IsMoving()
Wend
HitNew = GetVar(2002) 'Get the Position that the Porbe hit at

Diff = HitOld - HitNew
DiffABS =Abs(Diff)

If DiffABS=0 Then End
ZNew=0
If HitOld < HitNew Then ZNew = ZOld - DiffABS :A=1
If HitOld > HitNew Then ZNew = ZOld + DiffABS :A=2


Code "G53 G00 Z-1"
While IsMoving()
Wend
Call setdro(2,ZNew)

'FxModel Creation

End

You have to set in mach3 the position of the tool switch
It's not perfect yet, when I change the tool it remain out of 0.5/1mm but i think it's a switch problem.
I'll try to get 3-4 measure value, for the same tool and then keep the average value.

I'll be in vacation for another week so if I won't answer you know why  ;D

Bye Faby
FxModel Team


Re: Tool measure macro
« Reply #18 on: August 21, 2006, 11:15:27 AM »
Thank you for posting it  :D
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: Tool measure macro
« Reply #19 on: August 21, 2006, 11:25:09 AM »
Thanks Faby and enjoy your holidays  ;D
Jean-Louis