Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Olovsson on May 31, 2018, 03:13:16 PM

Title: How to get hold of Probing Calibration Data in a LUA script?
Post by: Olovsson on May 31, 2018, 03:13:16 PM
Hi,

I'm setting up a probe in Mach4, which is working very good so far. But, I want a write, for my needs, a bit different probing routine compared with the ones offered by default in Mach4. I have so far figured out that the calibration routine stores the calibration data in the Machine.ini file. So far so good. My question is if there is some way I can get hold of that data in a LUA script (without parsing the whole file and looking for the parameter)? Is it stored in some variables at start up? The one I wanted to get hold of is the calibrated probe radius. I have been looking around in the documentation, in the forum, in internet, but so far failed to find some information about this.

Hope to get some help here by all the expertise in the forum.

Best Regards,
Kjell     
Title: Re: How to get hold of Probing Calibration Data in a LUA script?
Post by: Olovsson on May 31, 2018, 04:19:58 PM
Ok - when you post a question you get some new ideas in the same moment as you press the post button  :). Looked a bit more in the API documentation (help file) and found:

retval, rc = mc.mcProfileGetDouble(
      number mInst,
      string section,
      string key,
      number defval)

in the section "Profile (INI) Settings". Works perfect to get out the values I want from the ini file.

Kjell



Title: Re: How to get hold of Probing Calibration Data in a LUA script?
Post by: Chaoticone on May 31, 2018, 05:27:44 PM
 :)