Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: SScnc on July 12, 2012, 09:09:27 PM
-
Is there a way to have a script look ahead in a Gcode file and look for the next tool to be able to stage it for the next tool change? Pretty much how commercial VMC's with side mount tool changers do it.
-
Hi,
I think you mean you want to prepare for the next tool change so that it is faster. Example:
N1 T1 M6 ( get first tool)
N2 T2 ( prepare second tool)
N3 ...
N4 ...
N5 M6 ( change tool 2 )
N6 T3 ( prepare next tool)
yes, that's possible.
Alex
-
Yes exactly, how can this be done in VB?
-
Hi,
when you code the T command e.g. T1 then the variable (GetSelectedTool) is set to this value .
You can read this variable in a VB script.
To see what i mean you can create a simple macro ( M code) e.g. M999
a = GetSelectedTool()
SetVar(1,a)
Go to MDI page
Now go to Operator menu then open G code variable monitor
then type something like T5 M999 and watch the G code variable monitor.
You should then see the value of the T command in the G code variable monitor.
You can work with that value preparing the next tool change.
The tool is only changed when you code M6
Will you have fix tool position or random ?
Alex
-
Alright thanks. The tool changer will have random positions. I need to figure out how to keep track of what tool is in what pocket.