I am still working at ATC and probing macro and I would like to disable / enable the password inside the macro.
I have tested the following code but UCCNC still ask for password.
- Code: Select all
string Password = DisablePassword();
DisableSoftLimits();
MessageBox.Show("Softlimits disabled.");
EnableSoftLimits();
MessageBox.Show("Softlimits enabled.");
EnablePassword(Password);
#Events
private void EnableSoftLimits(){
AS3.Setcheckboxstate(true, 75);
exec.Callbutton(168);
}
private void DisableSoftLimits(){
AS3.Setcheckboxstate(false, 75);
exec.Callbutton(168);
}
private string DisablePassword(){
string Password = exec.Readkey("Operatorlock","Password","");
if(Password!=""){
exec.Writekey("Operatorlock","Password","");
}
return Password;
}
private void EnablePassword(string Password){
exec.Writekey("Operatorlock","Password",Password);
}
It's like UCCNC remember a password has been set without checking the key Password during macro.
Do you know how can I fix it ?
Thanks a lot,