Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: mechaniac on December 25, 2007, 07:09:10 AM

Title: Can i get the state of coordinate system ?
Post by: mechaniac on December 25, 2007, 07:09:10 AM
Hello,

I'm trying to get the current state of coordinate system (e.g. G94, G95......etc.) in a macro. Is this possible, and how works the code?  Sorry for this possible stupid question, but I'm an absolutely Newbie in programming.

Thanks for answers.


Greetings,
Helmut



Title: Re: Can i get the state of coordinate system ?
Post by: Bodini on January 05, 2008, 12:20:19 PM
So is your question "how do i get the current offset"?  Like G54, G55, G56, etc.?

If that IS the question, then I've deduced this much...

"GetVar (5220)" returns a single digit number.  This number is the same number as the offset on the "Offsets" screen in Mach.

So on that screen, G54=1, G55=2, G56=3, etc.

If you try the code below in the "VB script editor" (built into Mach, in the pull-down "Operator" menu), the number returned does indeed correspond with the "fixture" number :

FixNumb = GetVar (5220)
MsgBox (FixNumb)

Even if this wasn't your question, I learned something today.  ;) :) :P

-Nick
Title: Re: Can i get the state of coordinate system ?
Post by: Bodini on January 05, 2008, 12:21:15 PM
Oh yeah, I found that info here: http://www.machsupport.com/MachCustomizeWiki/index.php?title=Mach_specific_Subroutines/Functions_grouped_by_purpose#Access_to_the_machine_G-code_parameter_block
Title: Re: Can i get the state of coordinate system ?
Post by: mechaniac on January 05, 2008, 02:18:42 PM
Hi Nick,

Thank you, this will answer my question.

Greets,

Helmut