Simualtion of code snippets, Subroutines


we will get an old CNC from Heckler and Koch.
This CNC has only 32k RAM and i think i must use Subroutines for our larger projects.

Im trying SheetCam TNG Development version 3.1.12 as demo.
I find SheetCam very usefull and have folowing questions:

Can you give an example of a Code Snippet wich i can run in the Simulation of SheetCam ?
Is it possible to create G-code Subroutines and simulate them inside SheetCam ?


Simulation does not understand G-code. The problem is that every machine uses a slightly different style of g-code. Simulation would have to have a reverse post to match each machine. Instead the simulation uses a special hidden post processor that generates code that it then runs. This code is nothing like g-code.

Hello Les,

thanks for your answer.
Is there a way for me, to convert G-Code into the code wich the simulator from SheetCam understand,
and send it then to the simulator ?


Have a look at c:\program files\sheetcam TNG\plugins\sim\sims\Sim commands.txt. Also have a look at the lua files.
If you can find your Application data folder then look in the SheetCam TNG folder for a file called temp.sim. That will contain the last code the simulator ran.

Oh yes, it’s a very nice open program.
I have found at the weekend the “Sim.lua”, wich converts the tokens from “Temp.Sim”.
So i have inserted “wx.wxLogMessage’s” at the Sim.lua to see at the debug window how it works.
Now i will try to convert also G-Code at “Sim.lua”.
May be i can work with the operation codes, to insert sub calls.

Thx for your answer