Hi Mark,
I'm not sure I understand, but to turn on tool length compensation for a tool you might issue an MDI command of HxG43
Hi Tom,
I made a variation of my tool change program to just increment to the next tool at the push of a button. Saves a few seconds when loading and unloading a bunch of tools.
But its not applying tool length compensation when finished like when using the drop down menu or an M06 command. Is there a way to do this easily? Thanks
Mark
Similar Threads:
Hi Mark,
I'm not sure I understand, but to turn on tool length compensation for a tool you might issue an MDI command of HxG43
Regards
TK http://dynomotion.com
Well just trying to save some setup time when loading and unloading tools. Instead of moving mouse to drop down box and selecting proper tool each time, I just created a slightly different tool change program to change to the "Next Tool" (in carousel) by pushing a user button. Using a keyboard shortcut so I dont have to touch mouse at all, only one button to advance one tool. Just to make it a little faster when loading and unloading 10-15+ tools.
If I used the drop down box, or an M06 command the tool length compensation is applied automatically. If I use my new program, it is not. I ended up setting my part origin yesterday with the wrong offset because of this, which could possibly cause a crash if I'm a little careless sometime.
Any way I can get around needing to put in the "X" in HxG43? I could setup my new program as an M code, then setup a user button to execute that M code, and also a G43, but id need someway of getting it to apply the proper offset for the current tool. My current tool number is always stored in a persistent variable by my toolchange program if thats any help.
Hi Mark,
Couldn't you have your modified Tool Change C Program command an MDI with the HxG43? It has the tool number doesn't it?
Regards
TK http://dynomotion.com
Hi Tom,
Yes it knows the current tool number. Current tool = persist.UserData[157]. How do I send a MDI command with that value for "X"?
Mark
Hi Mark,
Similar to the SetToolNumber.c example. Use sprintf to format a string.
Code:#include "KMotionDef.h" #define TMP 10 // which spare persist to use to transfer data #include "KflopToKMotionCNCFunctions.c" #define LAST_TOOL_VAR 8 // -1=Spindle empty, 0=unknown, 1-4 Tool Slot loaded into Spindle main() { char s[80]; sprintf(s,"T%d",persist.UserData[LAST_TOOL_VAR]); MDI(s); //send the T word }
Regards
TK http://dynomotion.com
Hi Tom,
This seems to be working perfectly. Thanks! In case it helps anybody the code im using is:
char s[80];
sprintf(s,"G43H%d",persist.UserData[157]);
MDI(s); //send