The Reset button: reset the alarm

In the event an axis encounters a problem that triggers an alarm, we use ResetAxis to reset the alarm. The function of this button is OnBnClickedBtnRest.

void CMFC_GUIDlg::OnBnClickedBtnRest()
{
   int Mindex = m_MotorList.GetCurSel();
   /*Makes the transition from the state ErrorStop to Standstill or Disabled by resetting all
     internal axis-related errors – it doesn't affect the output of the function instances.*/
   Command = WaitForCommand(1, TRUE, ResetAxis(Mindex));
   if (!Command.Done)
   {
     Str_Error.Format(_T("Failed to reset the axis: 0x%x\n"), Command.ErrorId);
     GetDlgItem(IDC_ERROR_RETURN)->SetWindowText(Str_Error);
     return;
   }
}