Hello Guest it is May 23, 2019, 07:33:16 PM

Author Topic: using a variable value directly in gcode  (Read 1263 times)

0 Members and 1 Guest are viewing this topic.

using a variable value directly in gcode
« on: May 03, 2015, 10:08:32 AM »
I'm having no luck executing movement from inside macro files, so I'm looking for an alternative to this macro.

Dim X As Double
X = GetVar(302)
Code "G00 X" & X
End

Is it possible to call up the value of the variable X in this way inside the macro, pass it to the main Gcode file, and then read and execute the 'G00 X &X' command in the Gcode itself, rather than unreliably from inside a macro? Absolute mayhem ensued when I tried more complicated moves from a macro, I'm looking to avoid all 'Code "G...."' statements if at all possible.

If not, would adding
'If IsMoving()
Wend'
before 'End' ensure that this line is executed properly before moving on?

Thanks,
M21

Offline BR549

*
  •  6,865 6,865
    • View Profile
Re: using a variable value directly in gcode
« Reply #1 on: May 03, 2015, 02:40:18 PM »
Always use the WHile Ismoving()  / Wend after each single motion call or Group of motion calls.

(;-) TP
Re: using a variable value directly in gcode
« Reply #2 on: May 03, 2015, 04:24:40 PM »
Will do