Page 1 of 1

De Ref on Reset

PostPosted: Sat Mar 03, 2018 10:18 am
by Alberto FUL
I cannot find where I can DE-REF all axis upon RESET.
Is it possible ?

Re: De Ref on Reset

PostPosted: Sat Mar 03, 2018 3:37 pm
by dezsoe
Save the code below to a macro and set as autorun macroloop. It will de-ref (or unhome) the axes on reset.

Code: Select all
// ================================================================================================
// Automatic Unhome v1.0
// ================================================================================================

if (exec.GetLED(ResetLED))
{
  if (NeedCheck)
  {
    NeedCheck = false;
    for (int i = 0; i <= 5; i++)
    {
      if (exec.GetLED(XhomedLED + i))
        exec.Setaxishomestate(i, false);
    }
  }
}
else
{
  NeedCheck = true;
}

// ================================================================================================

#Events

// ================================================================================================

const int ResetLED = 25;
const int XhomedLED = 56;

static bool NeedCheck = true;

// ================================================================================================

Re: De Ref on Reset

PostPosted: Sat Mar 03, 2018 6:14 pm
by Alberto FUL
Alain
Thanks

Re: De Ref on Reset

PostPosted: Sun Mar 04, 2018 12:18 am
by Alberto FUL
Again, I wanted to say

Re: De Ref on Reset

PostPosted: Sun Mar 04, 2018 7:56 am
by dezsoe
Yes, I thought. :)