In my shop I have several NGC machines reading programs from a network locations. We produce around 100 unique pieces a day and sometimes have operators run the same file twice.
Is there any way to have a M or G code self edit the file? For example, at the end or the program, edit itself with a cycle count number?

I know I can do this with loop counters respective the machine but does not solve if an operator runs it on a second machine.

I log to a DPRINT file, but not sure if I can check DPRNT for a string of text before continuing.

Any ideas?