Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: native34 on November 16, 2017, 02:37:04 PM

Title: Mach 4 variables
Post by: native34 on November 16, 2017, 02:37:04 PM
Where would one find the variable definitions for programming Mach4 interface. I need to know what "2035" means but can't find any reference to it. I am trying to modify the Z axis Set button to allow me to enter the value for my reference tool length, instead of it being pulled from the current tool length register. CurHVal=mc.get...(inst, 2035) I'm not sure what this 2035 means. I want to create a text field that I can set the length of my ref tool and have it use that as my value, as sometimes I may forget to set the currents tool manually and would create a bad situation with my tool length offsets and setting my Z work offset.
Title: Re: Mach 4 variables
Post by: joeaverage on November 16, 2017, 02:51:00 PM
Hi,
this is the best reference that I know of:
http://www.machsupport.com/forum/index.php/topic,30323.0.html (http://www.machsupport.com/forum/index.php/topic,30323.0.html)
Poppabear has put this together on his own and represents a great deal of work, but still patchy. Any further discoveries by other users I'm sure would be
welcomed.

Craig
Title: Re: Mach 4 variables
Post by: DazTheGas on November 16, 2017, 03:02:12 PM
2035 is the current tool length register but you can pull any data from the tooltable using the commands such as mc.mcToolGetDataExDbl, take a look in the API Docs under tools.

DazTheGas
Title: Re: Mach 4 variables
Post by: native34 on November 16, 2017, 03:48:36 PM
Thank you guys for the quick reply, much appreciated
Title: Re: Mach 4 variables
Post by: joeaverage on November 16, 2017, 07:53:55 PM
Hi,
I suspect the reason that NFS doesn't publish a list of pound variables is because they are internal to Mach and subject to change.

Using an API call as Daz has suggested will undoubtedly actually refer to the same internal register. If however in a later release of Mach where the pound variable number has
changed the API call will still work.

Using pound variables became common in Mach3 because you could use them inline Gcode, for example:

G1 X(#500) Y(#501) Z(#503)

whereas using OEMdro(*********) required it be contained in a macro.

Mach4 is the same, you can use pound variables inline but have to call a macro, a Lua program, if you wish to use API's.

Craig