Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: Laser on January 18, 2020, 08:16:03 AM
-
Hallo,
after a long search, I just can't find a solution.
I want to save a value. I added a DRO in the "Probing, Settings" Display. I can save the value in the Machine.ini and also read it back (LUA script). But what does not work - the changed value is not currently in the added field after Mach4 restart. How do the other values that originally exist get their numerical values back?
Greeting
Reinhard
-
registry
-
Thanks, the answer is very short. Do you think I should use a register? iRegs e.g. ?
-
Yes, use a register and make sure the 'persistent' is ticked.
-
Of course, that works with the registers. My special question was how the values are saved in the Probing / Settings screen. And: How are the values saved in the Machine.ini read back automatically (!!) when Mach4 is started and entered in the image? Exactly this automatic reloading is not possible for me..
-
It looks like the settings are saved to the profile when values are entered into the DRO using the 'On Modify' script. The values are then read using Probing.LoadSettings() function found in the mcProbing module. This is called from the PLC script in the 'PLC First Run' section. It is just manually reading the value saved in the profile and setting the DRO to display it.
In order to read the value you save to the profile for your custom DRO, just add the relevant code to the Probing.LoadSettings() function in the mcProbing module.
-
Thank you very much. That is the solution. I was looking for this reading function and just couldn't find it.