Been playing today with gcode for an entirely different 2D reason and notice that:
- My generated gcode file starts with a line containing a single % and ends with a line containing a single % (This fits with your understanding.)
- The last gcode instruction before the final % is 'M2'
Just guessing but M2 = 'End of Program', and it may be essential. A controller could be programmed to interpret end-of-file as the instruction to run the gcode but it isn't the law. M2 may mean, "All instructions sent, now execute them". If you haven't got an M2 in your test program, the controller might sit waiting for more instructions until it gets fed up and times out.
Dave