Hi Rick,
Thanks for the link and the associated program listings. My next question is: is there a decent book that deals largely with Gcode programming protocol - in the same way that other computer language programming books do it - i.e. without any real appeal to machining as such.
I have Michael J Peterson's "CNC Programming - Basics and Tutorial" which for a supposedly English-speaking author often comes over as Chinglish e.g. p29. "Absolute programming is programming mode that is a reflection of each number read is from part or machine Zero" ??? and the programming examples given are for specific production of an item with little explanation of options, why specific code was chosen or possible options - a good book if you wanted to make his example pieces but lacking if otherwise.
I also have Marcus Bowman's "CNC Milling in the Workshop" which is a much better book - but is still geared towards specific examples and the code needed to produce the artifact.
What I am looking for is a book that is separate from any CNC machining at all - but just explains Gcode instructions, the options available for each instruction, what a typical program needs to consist of (Initialisation, parameter definitions, global presets, ) the various ways you can arrange loops, subroutines, even nested subroutines (if these are allowed), can you carry arguments through into subroutines? where to put comment statements (are inline comments allowed? and why some CNC Gcode use " ;" while others use "/"), etc.
I guess what I am looking for is a book entitled "The CNC programming language"