101
Mach4 General Discussion / How to use a variable in a Gcode script line?
« on: August 06, 2019, 11:28:22 PM »
mc.mcCntlGcodeExecuteWait(inst, "G90 G53 G0 X"VariableforXhere" Y"VariabeforYhere"")
I have tried about everything I can think of at this point. I tried a bunch of other ways to use the variables. This format above is not necessarily what I expect to work, but I am looking for the correct format to do this.
I want to use a variable value for the X and Y in a Gcode command. At the beginning of my M6 script I store the X and Y positions before I move anything. Then I do all my tool change stuff, and I want to go back where I started.
There may be a better way to do this....if so, what is it?
I thought I was done with my M6 script and then this causes an error in the real run. I got it in a format that it would compile, but then it didn't move anywhere on this line. Everything I try either does nothing or won't compile with an error so far.
I have tried about everything I can think of at this point. I tried a bunch of other ways to use the variables. This format above is not necessarily what I expect to work, but I am looking for the correct format to do this.
I want to use a variable value for the X and Y in a Gcode command. At the beginning of my M6 script I store the X and Y positions before I move anything. Then I do all my tool change stuff, and I want to go back where I started.
There may be a better way to do this....if so, what is it?
I thought I was done with my M6 script and then this causes an error in the real run. I got it in a format that it would compile, but then it didn't move anywhere on this line. Everything I try either does nothing or won't compile with an error so far.