Yesterday, a post-processing student asked me how to force UG to change tools like MC.
It probably means that there are multiple operations for a tool. Normally, it is the first operation to change the tool, and the subsequent ones do not change the tool because the tools are the same.
And he wanted to change the knife again when needed for subsequent operations.
He has no time to learn tutorials recently, otherwise it would be very simple for him. After learning the idea, a small custom command can be done.
First of all, we need to know the post-processing process, which is covered in my tutorial.
Generally speaking, the operation starts, the tool is changed, the initial movement, and the first movement.
Our first operation is definitely a tool change, then the code we want to add should be the first move, not the initial move
Then how to write this code, first of all, let’s find out where we are programming, and which places we can borrow.
Convenient, I took a look, we can borrow the position of manual tool change:
The default is automatic tool change, here is not ticked, then if we ticked, then the tool is forced to change.
We add a custom command where we moved for the first time:
global mom_tool_manual_change
if {[info exists mom_tool_manual_change] && $mom_tool_manual_change == “Yes”} {
PB_auto_tool_change
MOM_force once H G_adjust
}
The code is very simple, we find the variable for manual tool change, and then use the if command to determine whether this variable exists,
If it exists, whether to tick it (=Yes)
After the conditions are met, call the command block PB_auto_tool_change for automatic tool change. How to find this, it is very simple:
Then this is to be called separately. Therefore, the lower tool length compensation will be output later.
Then just force the output of tool length compensation:
MOM_force once H G_adjust
Finally, because manual tool change is used, post-processing this area, just keep it empty:
Please keep the source and address of this article for reprinting:Composing with youth, the UG at that time has not been called NX
Reprint Statement: If there are no special instructions, all articles on this site are original. Please indicate the source for reprinting.:Cnc Machine Wiki,Thanks!^^