Message 1 of 1
Writing Tool Information at beginning of sections errors on machines with turning
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I wanted to modify a Mill/turn post for a TAKISAWA machine to have the tool for each section written on the N1 just like the following picture. However, if I try to have it also write the ZMIN in this section, it gives the error "tool isn't defined". I just simply added the Tool Dump coding as the comment for the Seqno section like thus,
if (getProperty("writeTools")) {
/*if (is3D()) {
var numberOfSections = getNumberOfSections();
for (var i = 0; i < numberOfSections; ++i) {
var section = getSection(i);
var zRange = section.getGlobalZRange();
var tool = section.getTool();
if (zRanges[tool.number]) {
zRanges[tool.number].expandToRange(zRange);
} else {
zRanges[tool.number] = zRange;
}
}
comment += " " +(localize("ZMIN") + "=" + xyzFormat.format(zRange.getMinimum()));
}*/
var compensationOffset = tool.isTurningTool() ? tool.compensationOffset : tool.lengthOffs
var comment = "T" + toolFormat.format(tool.number * 100 + tool.number) + " " +
(tool.diameter != 0 ? "D=" + spatialFormat.format(tool.diameter) + " " : "") +
(tool.isTurningTool() ? localize("NR") + "=" + spatialFormat.format(tool.noseRadius) : localize("CR") + "=" + spatialFormat.format(tool.cornerRadius)) +
(tool.taperAngle > 0 && (tool.taperAngle < Math.PI) ? " " + localize("TAPER") + "=" + taperFormat.format(tool.taperAngle) + localize("deg") : "") +
/*(zRanges[tool.number] ? " - " + localize("ZMIN") + "=" + spatialFormat.format(zRanges[tool.number].getMinimum()) : "") +*/
" - " + localize(getToolTypeName(tool.type));
if (insertToolCall && getProperty("sequenceNumberToolOnly")) {
writeCommentSeqno(comment);
//writeBlock(mFormat.format(22));
} else {
writeComment(comment);
}
}
There are no other major changes to the post that I believe would cause this error. I wondered if there was different way to write the zRange coding for it to all give the ZMIN just like the upper tool dump in the sections. I find with a milling (only) machines, this problem does not occur.
Thank you for your time.