Is the M99998 macro not run in demo mode?
Posted: Thu Jun 22, 2017 9:32 am
Am I doing something wrong or is the constructor macro not, or not always, run if UCCNC is started in demo mode?
I detected this after I switched off the machine and wanted to use UCCNC in demo mode to make some changes. I noticed that the fields I am using for my probe screen were not updated to the saved value, but went back to default. It seems that if at that stage I manually run M99998 then the fields get updated every time, but not automatically at start. Have not seen this before and not noticed if the machine is powered up before UCCNC, but in demo mode there seems to be an issue at least with user field updates.
My M99998.txt looks like this so it is really simple:
The code is not run automatically, but every time after UCCNC start in demo I can run it in the MDI manually and then the fields are updated with the saved value. Values are saved in the pro file even in demo mode, so that part seems to work, but the constructor macro is not seems to run, or run before UCCNC is ready for it.
I detected this after I switched off the machine and wanted to use UCCNC in demo mode to make some changes. I noticed that the fields I am using for my probe screen were not updated to the saved value, but went back to default. It seems that if at that stage I manually run M99998 then the fields get updated every time, but not automatically at start. Have not seen this before and not noticed if the machine is powered up before UCCNC, but in demo mode there seems to be an issue at least with user field updates.
My M99998.txt looks like this so it is really simple:
- Code: Select all
//This is the Constructor macro which executes once when the application gets loaded//
AS3.Setfield(Convert.ToDouble(exec.Readkey("UserTextfields", "20002", "0.0")), 20002); // Plate thickness
AS3.Validatefield(20002);
AS3.Setfield(Convert.ToDouble(exec.Readkey("UserTextfields", "20003", "1.0")), 20003); // Probe dia
AS3.Validatefield(20003);
AS3.Setfield(Convert.ToDouble(exec.Readkey("UserTextfields", "20004", "2.0")), 20004); // Probing area size
AS3.Validatefield(20004);
AS3.Setfield(Convert.ToDouble(exec.Readkey("UserTextfields", "20005", "3.0")), 20005); // Fixture clearance height
AS3.Validatefield(20005);
AS3.Setfield(Convert.ToDouble(exec.Readkey("UserTextfields", "20006", "4.0")), 20006); // Fast probing feed rate speed
AS3.Validatefield(20006);
AS3.Setfield(Convert.ToDouble(exec.Readkey("UserTextfields", "20007", "5.0")), 20007); // Fine probing feed rate speed. Set to zero if only single probing pass is needed.
AS3.Validatefield(20007);
AS3.Setfield(Convert.ToDouble(exec.Readkey("UserTextfields", "20008", "6.0")), 20008); // X and Y retract
AS3.Validatefield(20008);
AS3.Setfield(Convert.ToDouble(exec.Readkey("UserTextfields", "20009", "-3.0")), 20009); // Probing depth
AS3.Validatefield(20009);
The code is not run automatically, but every time after UCCNC start in demo I can run it in the MDI manually and then the fields are updated with the saved value. Values are saved in the pro file even in demo mode, so that part seems to work, but the constructor macro is not seems to run, or run before UCCNC is ready for it.