Page 1 of 1

issue with macro restart

PostPosted: Wed Aug 31, 2022 9:22 am
by girogiri
Hi All,

I'd like to ask support to know why this M3 macro is not working.
in particular the line that restart the G-code execution
Code: Select all
exec.Callbutton(128);

is not executed if this code is executed first
Code: Select all
if(!AS3.Getbuttonstate(ATC_SEALED_BUTTON)){
        exec.Callbutton(ATC_SEALED_BUTTON);
   while(exec.Ismacrorunning(ATC_SEALED_BUTTON) > 1 ){Thread.Sleep(20);}
 }


thanks
Giorgio

Re: issue with macro restart

PostPosted: Fri Sep 02, 2022 7:35 am
by girogiri
no replies?
attached is the "ATC_SEALED_BUTTON" macro ( aka M20044.txt) called in the IF cycle described in previous post.
It works with no issues, I'm attaching it to better understand the whole process
this is the relevant part of it:
Code: Select all
if(Convert.ToBoolean(exec.Readkey("UserCheckboxes", Convert.ToString(ENABLE_ATC_CHECKBOX), "False"))){

   if(!AS3.GetLED(ATC_LIFE_LED)){
      exec.Informplugin("Messages.dll", (object)"#Ok: Raffreddamento ATC (M20044)|ATC Offline.");
   }
   else if(!SendDataBin(ATC,1, !my_status, ATC_WRITE_SEALED_BIT)){
      exec.Informplugin("Messages.dll", (object)"#Ok: Raffreddamento ATC (M20044)|Invio comando sealed fallito.");
   }
   else{
      AS3.Switchbutton(!my_status, ATC_SEALED_BUTTON);
   }
}
else{
   exec.Informplugin("Messages.dll", (object)"Ok: Raffreddamento ATC (M20044)|ATC non abilitato.");
}


I don't see reasons why this code should block the
Code: Select all
exec.Callbutton(128);
statement


thanks
Giorgio