Karl,
Yesterday before quitting I found an old post of yours, concerning this subject.
Code:
You found,IMHO, the greatest weakness in Camsoft. It doesn't do parametric programming. I wrote a number of special M codes as a work around for looping in Gcode. Here's a clip, the message statements explain how to set up your Gcode to loop.
MESSAGE
MESSAGE To use M93 put statement
MESSAGE {LOOPM93=5} <on its own line>
MESSAGE N100 <space after this and on its own line>
MESSAGE <lines of code>
MESSAGE M93 N100
MESSAGE the 5 can be any number
MESSAGE the 100 can be any number
MESSAGE
\93=1
LOADING \55:IF\55=0THENEXIT
{LOOPM93=LOOPM93-1}
IF{LOOPM93}>0THENJUMP Nn
-----M93
MESSAGE
MESSAGE To use M94 put statement
MESSAGE {LOOPM94=5} <on its own line>
MESSAGE N200 <space after this and on its own line>
MESSAGE <lines of code>
MESSAGE M94 N200
MESSAGE the 5 can be any number
MESSAGE the 200 can be any number
MESSAGE
\93=1
LOADING \55:IF\55=0THENEXIT
{LOOPM94=LOOPM94-1}
IF{LOOPM94}>0THENJUMP Nn
-----M94
MESSAGE
MESSAGE To use M95 put statement
MESSAGE {LOOPM95=5} <on its own line>
MESSAGE N300 <space after this and on its own line>
MESSAGE <lines of code>
MESSAGE M95 N300
MESSAGE the 5 can be any number
MESSAGE the 300 can be any number
MESSAGE
\93=1
LOADING \55:IF\55=0THENEXIT
{LOOPM95=LOOPM95-1}
IF{LOOPM95}>0THENJUMP Nn
-----M95
MESSAGE
MESSAGE To use M96 put statement
MESSAGE {LOOPM96=5} <on its own line>
MESSAGE N400 <space after this and on its own line>
MESSAGE <lines of code>
MESSAGE M96 N100
MESSAGE the 5 can be any number
MESSAGE the 400 can be any number
MESSAGE
\93=1
LOADING \55:IF\55=0THENEXIT
{LOOPM96=LOOPM96-1}
IF{LOOPM96}>0THENJUMP Nn
-----M96
JUMP Nn 'to use write M98 N100 to goto N100, ENDLESS LOOP!!
-----M97
I entered it in my MCODE file, saved, backed-up, etc, restarted, and still could not make it work. I'm at work now, so I cannot post the exact code I tried. I will do that this evening, along with my modified MCODE file. Hopefully you might see what I have missed.
Steve