Hi all. I'm trying to use a button and a Macro to activate a relay on Port 1, Pin 1. I used a macro that Ger21 had written and posted on this forum for another member and modified it for my purposes and made a button to call it. It worked as expected. The problem was my expectations were incorrect. The function of the relay is to be an override for a safety circuit so I can recover from a Reset condition. Like I said, in normal operation it works as expected, closing the relay on the first push, releasing it on the second. The problem is that it needs to work when the software is in Reset. UCCNC wont allow me to push the button when its in Reset. Here is the text of the macro:
bool buttonstate = AS3.Getbuttonstate(20001);
int Port=1;
int Pin=1;
if (buttonstate)
{
exec.Setoutpin(Port,Pin);
exec.AddStatusmessage(" OSSD NORMAL");
AS3.Switchbutton(false,20001);
}
else
{
exec.Clroutpin(Port,Pin);
exec.AddStatusmessage(" OSSD OVERRIDDEN");
AS3.Switchbutton(true,20001);
}
while (exec.IsMoving()){} // Wait for exec.Code to finish
Is it possible to make this work while in Reset?