Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: SScnc on September 13, 2011, 06:13:21 AM

Title: Need help with a simple macro
Post by: SScnc on September 13, 2011, 06:13:21 AM
In my M6Start macro I have this code.

X = GetUserDRO ( 1200 )
Z = GetUserDRO ( 1201 )

code "G53G0 , Z" & Z
While IsMoving
Wend
code "G53G0 , X" & X

Basically it just looks at two DRO's I have on the screen and moves the machine to whatever I have in those DRO's. My problem is, I want to move X&Z at the same time. I've tried all different configurations and I can't seem to figure it out.

I have it working right now with this code.

code "G53G0 , X-.125 Z-10.75"

and it works great. However if I want to change the values I have to edit the macro.

Any help is appreciated.

Thanks
Title: Re: Need help with a simple macro
Post by: Dan13 on September 13, 2011, 07:24:52 AM
Hi,

This should do what you want:

x = GetUserDRO ( 1200 )
z = GetUserDRO ( 1201 )
code "G53G0 X" &x & "Z" &z

Dan
Title: Re: Need help with a simple macro
Post by: SScnc on September 13, 2011, 03:16:13 PM
Okay thanks, I was very close to that. Just my syntax was off. I will try it and get back.