Hey folks, I'm writing some code into M99998 constructor macro to read from the .pro and load in the tool that I wrote to it in M99999. The issue is I'm writing to the DRO just fine but the program still thinks it doesn't have a tool in. Here's what I've tried:
int Loadedtool = Convert.ToInt16(exec.Readkey("MG103 Custom","CurrentTool",""));
exec.Setcurrenttool(Loadedtool);
exec.AddStatusmessage("program thinks its"+(exec.Getcurrenttool()));
As well as
string LoadedTool = exec.Readkey("MG103 Custom","CurrentTool","");
AS3.Setfield(Convert.ToDouble(LoadedTool),897);
AS3.Validatefield(897);
exec.AddStatusmessage("program thinks it's "+(exec.Getcurrenttool()));
In the second case I get the correct tool # in the DRO but both return "program thinks it's 0" in the dialog.
The odd thing is that if I run this M99998 manually from the dialog right after UCCNC starts up it works perfectly. It just doesn't seem to want to cooperate during start-up.
Any tips?