Hello Guest it is November 13, 2019, 10:18:21 PM

Author Topic: Mach 4 variables  (Read 1125 times)

0 Members and 1 Guest are viewing this topic.

Mach 4 variables
« 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.
Re: Mach 4 variables
« Reply #1 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
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
My wife left with my best friend...
     and I miss him!

Offline DazTheGas

*
  •  750 750
  • DazTheGas
    • View Profile
Re: Mach 4 variables
« Reply #2 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
Theres always time for a choccy biccy
Re: Mach 4 variables
« Reply #3 on: November 16, 2017, 03:48:36 PM »
Thank you guys for the quick reply, much appreciated
Re: Mach 4 variables
« Reply #4 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

My wife left with my best friend...
     and I miss him!