Post Processor Help, Comment tool order
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Looking for a little bit of help here. I am writing my tools to my machine as an operator setup note. We have 2 machines that require hand loading tools and its nice to be able to lay the tools out in their correct order before starting the program.
The following Post Processor code gives me my tools, but it puts them in numerical order (1,2,3,4) where as I want them in actual order they will be used (3,1,2,4) Or whatever that order might be.
var tools = getToolTable();
if (tools.getNumberOfTools() > 0) {
for (var i = 0; i < tools.getNumberOfTools(); ++i) {
var tool = tools.getTool(i);
var comment = "T" + toolFormat.format(tool.number) + " " +
"D=" + xyzFormat.format(tool.diameter) + " " +
localize("CR") + "=" + xyzFormat.format(tool.cornerRadius);
if ((tool.taperAngle > 0) && (tool.taperAngle < Math.PI)) {
comment += " " + localize("TAPER") + "=" + taperFormat.format(tool.taperAngle) + localize("deg");
}
if (zRanges[tool.number]) {
comment += " - " + localize("ZMIN") + "=" + xyzFormat.format(zRanges[tool.number].getMinimum());
}
comment += " - " + getToolTypeName(tool.type);
writeComment(comment);
}
}
This currently posts as at the top of my program,
N19 (T) T9 D=0.375 CR=0.015 - ZMIN=0.225 - bullnose end mill $
N20 (T) T35 D=0.375 CR=0. - ZMIN=0.225 - flat end mill $
N21 (T) T44 D=0.5 CR=0. TAPER=45deg - ZMIN=0.685 - chamfer mill $
N22 (T) T60 D=3. CR=0.03 TAPER=45deg - ZMIN=0.745 - face mill $
It should post 60,9,35,44 as that is the actual machining order, or as follows
N19 (T) T60 D=3. CR=0.03 TAPER=45deg - ZMIN=0.745 - face mill $
N20 (T) T9 D=0.375 CR=0.015 - ZMIN=0.225 - bullnose end mill $
N21 (T) T35 D=0.375 CR=0. - ZMIN=0.225 - flat end mill $
N22 (T) T44 D=0.5 CR=0. TAPER=45deg - ZMIN=0.685 - chamfer mill $