tommylight wrote: Adding G04 P5 after every M3 should do what you need.
That is in gcode, not in hal or ini.
And it might be put into the G-code automatically.
My CAM software, the venerable MeshCAM, permits me to define a customized 'post' (post-processor) file by which I can affect how certain G-codes are implemented and effect pre-ambles and post-ambles to G-code programs.
For example, if the code MeshCAM is outputting uses a roughing and finishing tools, this part of the .CON file:
Code:
TOOLCHANGE = "[N] M6 [T]"
TOOLCHANGE = "[N] M3 S#<RPM>"
TOOLCHANGE = "(Tool Changed to: TP=[TP] [TOOLDESC])"
TOOLCHANGE = "(MSG, Un-pause when spindle reaches speed.)"
TOOLCHANGE = "M0"
inserts all this code in the output at the toolchange. [I added the parts after #<RPM>. #<> denote variables in MeshCAM and the spindle speed is one of the things that has to be specified before MC will construct a G-code for the model.
Incidentally, I've also got the following START/END lines to record how long a job takes. They rely on a custom M144 M-code that does nothing more than exec Linux 'date', format it and append it to a file.
START = "[N] M144 Pnnn Q1 ; user-m-code to log start-time in same dir as ngc"
END = "[N] M144 Pnnn Q0 ; user-m-code to log stop-time in same log file as start-time in same dir as ngc"