| | |
| | | if (m_nAxisCount<1) return; |
| | | |
| | | //Alive |
| | | if (ReadAddressValue(50, m_nMotorAlive)) |
| | | { |
| | | if (m_nMotorAlivePrev != m_nMotorAlive) |
| | | { |
| | | dwLastAliveTick = GetTickCount(); |
| | | } |
| | | m_nAutoEnablePrev = m_nAutoEnable; |
| | | |
| | | if (GetTickCount() - dwLastAliveTick >15000 && dwLastAliveTick != 0) |
| | | { |
| | | m_pMC2P->IMC2P_SendMotorAliveErrorAlram(); |
| | | m_pMC2P->IMC2P_DisplayMessage(m_nIndex, _T("Motor Alive Error!")); |
| | | dwLastAliveTick = GetTickCount(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | m_pMC2P->IMC2P_SendMotorAliveErrorAlram(); |
| | | m_pMC2P->IMC2P_DisplayMessage(m_nIndex, _T("Motor Alive Read Fail!")); |
| | | dwLastAliveTick = GetTickCount(); |
| | | } |
| | | // if (ReadAddressValue(50, m_nMotorAlive)) |
| | | // { |
| | | // if (m_nMotorAlivePrev != m_nMotorAlive) |
| | | // { |
| | | // dwLastAliveTick = GetTickCount(); |
| | | // } |
| | | // m_nAutoEnablePrev = m_nAutoEnable; |
| | | // |
| | | // if (GetTickCount() - dwLastAliveTick >15000 && dwLastAliveTick != 0) |
| | | // { |
| | | // m_pMC2P->IMC2P_SendMotorAliveErrorAlram(); |
| | | // m_pMC2P->IMC2P_DisplayMessage(m_nIndex, _T("Motor Alive Error!")); |
| | | // dwLastAliveTick = GetTickCount(); |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // m_pMC2P->IMC2P_SendMotorAliveErrorAlram(); |
| | | // m_pMC2P->IMC2P_DisplayMessage(m_nIndex, _T("Motor Alive Read Fail!")); |
| | | // dwLastAliveTick = GetTickCount(); |
| | | // } |
| | | |
| | | // auto enable |
| | | const CMotorCommonAddr *pAddr = m_ControlInfo.GetMotorCommonAddr(); |