De Ref on Reset

Post anything you want to discuss with others about the software.

De Ref on Reset

Postby Alberto FUL » Sat Mar 03, 2018 10:18 am

I cannot find where I can DE-REF all axis upon RESET.
Is it possible ?
Alberto FUL
 
Posts: 39
Joined: Thu Jan 12, 2017 1:48 pm
Location: Italy

Re: De Ref on Reset

Postby dezsoe » Sat Mar 03, 2018 3:37 pm

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;

// ================================================================================================
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: De Ref on Reset

Postby Alberto FUL » Sat Mar 03, 2018 6:14 pm

Alain
Thanks
Alberto FUL
 
Posts: 39
Joined: Thu Jan 12, 2017 1:48 pm
Location: Italy

Re: De Ref on Reset

Postby Alberto FUL » Sun Mar 04, 2018 12:18 am

Again, I wanted to say
Alberto FUL
 
Posts: 39
Joined: Thu Jan 12, 2017 1:48 pm
Location: Italy

Re: De Ref on Reset

Postby dezsoe » Sun Mar 04, 2018 7:56 am

Yes, I thought. :)
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary


Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: No registered users and 10 guests