Hello Guest it is April 19, 2024, 10:18:38 AM

Author Topic: using a variable value directly in gcode  (Read 2026 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,965 6,965
    • 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