How to create “Spindle Delay” script file in PlanetCNC TNG software

With PlanetCNC TNG software user can create or customise g-code procedures (e.g. for M3/M5 g-codes, M6 g-code) using script files.

Script files are located in PlanetCNC TNG installation folder in scripts folder.

If your settings file is named e.g.”MyCNCRouter.settings”, then your corresponding scripts folder should be named MyCNCRouter.scripts. This way you can link multiple script files to corresponding setting files.

This tutorial will describe how create script file for short delay after spindle is turned ON.


To create and modify M3 g-code script please follow steps below:

1. Open PlanetCNC TNG software installation folder. Locate scripts folder and open it.

2. Create new text file and name it: Machine.UserDefined_M3.gcode

3. Open script file with text editor.

4. Add M3 and G04 g-codes.

Scipt file includes g-code lines:

G04 P5


Now after each time we turn spindle ON, software waits 5 seconds before it continues with program execution.


You can read more on M3 and G04 g-codes here: