/// <summary> /// 等待轴停止 /// </summary> /// <param name="card"></param> /// <param name="axis"></param> /// <returns></returns> public static short WaitAxisStop(AxisConfig axisC) { int intAxisStatus = 0; short shrResult = 0; NewCtrlCardBase Base_ = tag_NewCtrlCardBase[(int)axisC.tag_MotionCardManufacturer]; if (Base_ == null) { MessageBoxLog.Show(NewCtrlCardBase.GetManufacturerName((int)axisC.tag_MotionCardManufacturer) + "控制卡初始化失败!"); return(shrFail); } short ret = 0; do { //程序是否正常运行 if (IsExit()) { Base_.SR_AxisEmgStop(axisC.CardNum, axisC.AxisNum); return(shrFail); } //读轴状态 shrResult = Base_.SR_GetAxisStatus(axisC.CardNum, axisC.AxisNum, out intAxisStatus); if (shrResult != shrGtsSuccess) { return(shrFail); } Thread.Sleep(5); } while (intAxisStatus != 0); //运动中 return(shrSuccess); }
/// <summary> /// 设置单轴紧急停止 /// </summary> /// <param name="card"></param> /// <param name="axis"></param> /// <returns></returns> public static short SR_AxisEmgStop(int Cardtype, short card, short axis) { short shrResult; NewCtrlCardBase Base_ = tag_NewCtrlCardBase[Cardtype]; if (Base_ == null || Base_.SR_AxisEmgStop == null) { MessageBoxLog.Show(NewCtrlCardBase.GetManufacturerName((int)Cardtype) + "控制卡初始化失败!"); return(shrFail); } shrResult = Base_.SR_AxisEmgStop(card, axis); if (shrResult != shrGtsSuccess) { return(-1); } return(0); }