Hello Guest it is April 19, 2024, 03:39:49 PM

Author Topic: Looking ahead into Gcode  (Read 3620 times)

0 Members and 1 Guest are viewing this topic.

Offline SScnc

*
  •  77 77
    • View Profile
Looking ahead into Gcode
« 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.
Re: Looking ahead into Gcode
« Reply #1 on: July 13, 2012, 08:40:44 PM »
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


Offline SScnc

*
  •  77 77
    • View Profile
Re: Looking ahead into Gcode
« Reply #2 on: July 15, 2012, 11:10:37 AM »
Yes exactly, how can this be done in VB?
Re: Looking ahead into Gcode
« Reply #3 on: July 15, 2012, 12:01:44 PM »
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

Offline SScnc

*
  •  77 77
    • View Profile
Re: Looking ahead into Gcode
« Reply #4 on: July 15, 2012, 03:31:52 PM »
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.