Is there ANY way you could do this is conversational and then open the program in text and just read how your machine automatically writes the code correctly?? I've done this on more than one occasion when I had to call up subroutines for a bobcad file that was generated in G-code and because of that I had to write a longhand program to rotate and call up the correct subs to cut the spokes on a motorcycle wheel~
Also, the sub might have to be something like ####.txt or something similar... In my case it was that added to the end in order to get it to work...
As for the keyboard on a Cent 6, I dunno except on my cent 5 it was just a simple matter of drilling a tiny hole and running the cord inside to plug it in!!