Hi,
Calum wrote:
Is there a way that I could write tool diameter and description from my Gcode to the tool table at run time?
Well.. almost/maybe.... I'll explain.
The tool table data you called out (Diam and tool description) can be written to the tool table from a mach script.
See the programmers ref manual and look up "SetToolParam" - that is how you set the diameter value in the mach tool table.
To set the description there is a special MSM call to use: MSMAPI_SetToolDesc
See section 15.9.3.2 in the MSM mill manual for the technical description of this interface.
OK, those are the references needed to set diam and description from a script.
But you asked about doing this from gcode....
You can create a user M code to run a mach script. So you could create (for example) M1201 to set the diameter.
The M1201 would need take some parameters so that you can pass in the tool # and diam values. You can do that with the Param1, Param2 and Param3 script calls.
Next you would naturally do the same and make a M1202 (just an example number for the mcode) to set the description. Alas, the description is where things get stuck.... Gcode is oriented around numbers and not strings. I don't know a way to pass a text string to an mcode - so I don't see a way to easily pass the tool description via gcode in so that the script can set the description in the tool table. I also don't know how you'd would get the text description from CAM into the gcode - you'll have to probably modify the CAM post processor to do that step.
Now there may be other ways to solve this... it all depends on how the info is available from your cam program.
For example: If the CAM tool info can be put into a file, then you could write a script to read the file contents and load that into the mach tool table. Then you could just make one user mcode that was run at the beginning of each gcode program - it would read the file and load the mach tool table etc.
I don't have a ready to use solution for you, but this should get you started thinking about that tools you have that you can use to get the job done.
Dave