//--------------------------------------------------------------------------- bool PCIM114GL::IsLastPosDone(int nAxis) { double dPos=m_dLastTargetPos[nAxis]; double dP=GetFeedbackPos(nAxis); if(dP>dPos-0.1 && dP<dPos+0.1) return true; else if(GetAxisStatus(nAxis,Axis_Const::INP)) AbsMove(nAxis,dPos); else return false; return false; }
//--------------------------------------------------------------------------- bool PCIM114GL::WaitMotionDone(int nAxis, DWORD nWaitTime, bool bProcessMessage) { if(!m_bInitOK) return false; DWORD dwStartTime=GetTickCount(); while(1) { if(IsMotionDone(nAxis)) break; if(GetTickCount()-dwStartTime>nWaitTime) return false; /* if(!GetDI(DI::SafetyDoor) ) { StopMove(nAxis); return false; } */ if(GetAxisStatus(nAxis,Axis_Const::ALM)) return false; if(bProcessMessage) ProcessMessage(); else ::Sleep(10); } return true; }
//This procedure is called (from Back-end) in order to verify if motor is moving //-------------------------------------------------------------- bool CMotorsBase::IsMotorMoving(TMotorAxis Axis) { GetAxisStatus(Axis); return GetAxisIfMotorIsMoving(Axis); }