Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need some advice on how to modify the m6 code on the tool changer with G116.
Please find my post processor attached.
Solved! Go to Solution.
I need some advice on how to modify the m6 code on the tool changer with G116.
Please find my post processor attached.
Solved! Go to Solution.
Hello @info ,
Just curious, Have you tried enabling the post property called “Enable Safe Tool Change Logic”? This property allows the post to check whether the tool being called is already loaded or staged.
Hello @RohitMane_
Yes, I've already tested it, but in my G116 I have protected connections and the tool length corrector is already active immediately after the tool change.
Then you need to update case COMMAND_LOAD_TOOL (Line no : 2162).
Search for case COMMAND_LOAD_TOOL in the code, and modify or replace the code below that line as shown in the example below. You can remove the commented-out section if you wish.
case COMMAND_LOAD_TOOL:
setSpindleLoadMonitor(false); // disable spindle load monitoring
writeComment(tool.comment);
var toolCall = "T" + toolFormat.format(tool.number);
if (getProperty("preloadTool")) {
if (getProperty("safeToolChange")) {
writeBlock("IF [ VTLCN EQ", toolFormat.format(tool.number), "]", skipNLines(5));
writeBlock("IF [ VTLNN EQ", toolFormat.format(tool.number), "]", skipNLines(3));
writeBlock("IF [ VTLNN EQ 0 ]", skipNLines(2));
writeBlock(mFormat.format(64));
// writeToolBlock(mFormat.format(6), toolCall);
writeBlock(gFormat.format(116), toolCall); // new code
} else {
// if (!isFirstSection()) {
// writeComment(toolCall);
// writeToolBlock(mFormat.format(6));
// } else {
// writeToolBlock(toolCall, mFormat.format(6));
// }
writeBlock(gFormat.format(116), toolCall); // new code
}
var preloadTool = getNextTool(tool.number != getFirstTool().number);
if (preloadTool) {
writeBlock("T" + toolFormat.format(preloadTool.number)); // preload next/first tool
} else if (getProperty("safeToolChange")) {
writeBlock(formatComment("*"));
}
} else {
if (getProperty("safeToolChange")) {
writeBlock("IF [ VTLCN EQ", toolFormat.format(tool.number), "]", skipNLines(2));
// writeToolBlock(mFormat.format(6), toolCall);
writeBlock(gFormat.format(116), toolCall); // new code
writeBlock(formatComment("*"));
} else {
// writeToolBlock(toolCall, mFormat.format(6));
writeBlock(gFormat.format(116), toolCall); // new code
}
}
setProperty("showSequenceNumbers", saveShowSequenceNumbers);
return;
Hi @RohitMane_ ,
Thanks for the great suggestion for the change, but now if I activate the sequence number “tool change only” , it doesn't insert the numbering.
Oh, yes, that’s correct.
Please change the function name from writeBlock to writeToolBlock only on the new code lines. Then you’ll get the sequence number on the tool change line.
before change
writeBlock(gFormat.format(116), toolCall); // new code
after change
writeToolBlock(gFormat.format(116), toolCall); // new codeHi @RohitMane_ ,
Perfect, it works perfectly.
I would like to make another change.
I would like the program name written in the first line to be written between (), as if it were a comment, so that the machine tool does not read it. Then I would also like to write the date and time of the program writing before the tool list. Thank you.
To include the program name as a comment, replace writeln with writeComment on line number 590.
To insert the date and time, add the following line immediately after that statement.
var d = new Date();
writeComment("Creation date: " + d.toLocaleDateString() + " " + d.toLocaleTimeString());