Accessing a list of tool used in the post?

Hi guys,

I’d like to put a list of tools used by the program at the top of my posted code. It is super helpful when loading the job to see a list of all of the tools used in the program.

I’ve looked at the post processor documentation and I don’t see anyway to access this. There is mention of all internal variables being accessible from the post. But I really only see a handful of internal variables when I look at the variable monitor.

Thanks,

-Jim

That’s a tall ask :wink:
Consider first using the alternative of menu File-‘Job report’. Experiment with the 3 formats available and All Tools check box.

Another alternative- use function OnToolChange() to post comment lines in the gcode with the tool data you want to see. These comment lines appear in sequence with the gcode production. Use a line leader ‘(>>>>>>>>’ to draw attention to the comment so its easy for the machine operator to pick them out visually.

But to your specific ask if those alternatives don’t work… If you have some programming experience it is possible. A general design I can suggest would be

  • accumulate into a table (array) the unique tool data you want to present in the gcode header as the pp sequentially processes Operations and streams out to file the gcode. Accumulate tool data with your custom code in function OnToolChange().
  • Once the normal gcode file has been built and Operations processed, use more custom code in function OnFileClosed() to reopen the gcode file and insert gcode comment lines representing your accumulated tool use data.

re. access to internal variables- it seems you found the list of most variables available and functions in the pp documentation, menu Options-Machine-‘Post processor’, click button ‘Post documentation’.
See also Lua programming language doc here: Lua 5.1 Reference Manual - contents
You will likely use Lua native file I/O to write your tool data records to the gcode file.

re. variable monitor- these are variables in the ‘var.’ table, a Lua construct, NOT a complete list of sheetcam internal variables exposed from the C++ engine to the pp. In order to see the variables named in the doc, set a debug breakpoint on a pp line and then see the ‘Stack’ tab at the bottom of the pp Editor window to see the current list and values of internal variables available at that line of the pp during an active run and breakpoint event. Not all variables are shown at each breakpoint, only those that are in scope at that breakpoint.

Hi sheetcamC S2,

Thanks for the quick response. (as an aside, I’ve been using your software for a number of years and it is good bang for the buck. Recently I bought a Mazak fiber laser and they recommend Hexgaon’s Radnest for their CAM. I bought it and I hate it. Besides being $14k, it’s terrible software and is in many ways, but not all, inferior to Sheetcam)

Thank you for the advice on accumulating the tool data as the post runs. We’ll see what I come up with and share it if it happens.

My overall goal is to get get Sheetcam and Linuxcnc coupled together well enough to make sure that the right tools are in the machine to run the job. The machine in question is a modified Homag router with 40+ tools, so there can be a lot to keep track of.

Thank you