XY运动不到位时,增加报警功能

8Nozzle
lhiven 1 year ago
parent 5d14fa61f9
commit b258f911b3

@ -250,5 +250,10 @@ namespace Rs.MotionPlat.Flow
/// </summary> /// </summary>
public const int InputEmpty = 1050; public const int InputEmpty = 1050;
/// <summary>
/// 轴未到位异常
/// </summary>
public const int = 1051;
} }
} }

@ -180,7 +180,12 @@ namespace Rs.MotionPlat.Flow.NormalFlow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if(alarmEntity!=null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
step = ECalibrationFlowStep.;
}
} }
} }
break; break;
@ -346,11 +351,16 @@ namespace Rs.MotionPlat.Flow.NormalFlow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
logInfo = $"{GetClassName()}轴不在目标位置"; logInfo = $"{GetClassName()}轴不在目标位置";
MessageQueue.Instance.Warn(logInfo); MessageQueue.Instance.Warn(logInfo);
step = ECalibrationFlowStep.; step = ECalibrationFlowStep.;
} }
} }
}
break; break;
case ECalibrationFlowStep.: case ECalibrationFlowStep.:
@ -516,11 +526,16 @@ namespace Rs.MotionPlat.Flow.NormalFlow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
logInfo = $"{GetClassName()}轴不在目标位置"; logInfo = $"{GetClassName()}轴不在目标位置";
MessageQueue.Instance.Warn(logInfo); MessageQueue.Instance.Warn(logInfo);
checkStep = ECalibrationCheckFlowStep.; checkStep = ECalibrationCheckFlowStep.;
} }
} }
}
break; break;
case ECalibrationCheckFlowStep.: case ECalibrationCheckFlowStep.:

@ -632,9 +632,16 @@ namespace Rs.MotionPlat.Flow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
logInfo = $"{GetClassName()}轴不在目标位置";
MessageQueue.Instance.Warn(logInfo);
flowStep = EDischargeFlowStep.; flowStep = EDischargeFlowStep.;
} }
} }
}
break; break;
case EDischargeFlowStep.: case EDischargeFlowStep.:
if (NozzleManager.GetNozzlesByStatus(ENozzleStatus.ToUnload).Count==3) if (NozzleManager.GetNozzlesByStatus(ENozzleStatus.ToUnload).Count==3)

@ -263,8 +263,16 @@ namespace Rs.MotionPlat.Flow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
logInfo = $"{GetClassName()}轴不在目标位置";
MessageQueue.Instance.Warn(logInfo);
flowStep = EGrrFlowStep.; flowStep = EGrrFlowStep.;
} }
}
} }
break; break;
case EGrrFlowStep.: case EGrrFlowStep.:

@ -102,9 +102,16 @@ namespace Rs.MotionPlat.Flow.NormalFlow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
logInfo = $"{GetClassName()}轴不在目标位置";
MessageQueue.Instance.Warn(logInfo);
step = EThreePointLocationFlowStep.; step = EThreePointLocationFlowStep.;
} }
} }
}
break; break;
case EThreePointLocationFlowStep.: case EThreePointLocationFlowStep.:
if (GlobalVar.RunSpace) if (GlobalVar.RunSpace)

@ -4,6 +4,7 @@ using Rs.Motion;
using Rs.MotionPlat.Commom; using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Entitys; using Rs.MotionPlat.Entitys;
using Rs.MotionPlat.Flow.Common; using Rs.MotionPlat.Flow.Common;
using Rs.MotionPlat.Flow.NormalFlow;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -177,9 +178,16 @@ namespace Rs.MotionPlat.Flow.SafePosFlow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
logInfo = $"{GetClassName()}轴不在目标位置";
MessageQueue.Instance.Warn(logInfo);
moveXStep = EDischargeModuleGoSafePosFlowStep.; moveXStep = EDischargeModuleGoSafePosFlowStep.;
} }
} }
}
break; break;
default: default:
break; break;
@ -230,9 +238,16 @@ namespace Rs.MotionPlat.Flow.SafePosFlow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
logInfo = $"{GetClassName()}轴不在目标位置";
MessageQueue.Instance.Warn(logInfo);
moveY1Step = EDischargeModuleGoSafePosFlowStep.; moveY1Step = EDischargeModuleGoSafePosFlowStep.;
} }
} }
}
break; break;
default: default:
break; break;

@ -114,9 +114,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
step = EFixedGrabProductFlowStep.; step = EFixedGrabProductFlowStep.;
} }
} }
}
break; break;
case EFixedGrabProductFlowStep.: case EFixedGrabProductFlowStep.:
if(hasProdcutCheck) if(hasProdcutCheck)

@ -109,9 +109,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
flowStep = EFixturePlaceFlowStep.; flowStep = EFixturePlaceFlowStep.;
} }
} }
}
break; break;
case EFixturePlaceFlowStep.: case EFixturePlaceFlowStep.:
logInfo = $"{GetClassName()} 通知相机拍照"; logInfo = $"{GetClassName()} 通知相机拍照";
@ -187,9 +192,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
flowStep = EFixturePlaceFlowStep.; flowStep = EFixturePlaceFlowStep.;
} }
} }
}
break; break;
case EFixturePlaceFlowStep.1: case EFixturePlaceFlowStep.1:
targetPosition.NozzleZ = NozzleManager.GetFixtureTakeProductPos(curFixture.Index, curNozzle.NozzleIndex); targetPosition.NozzleZ = NozzleManager.GetFixtureTakeProductPos(curFixture.Index, curNozzle.NozzleIndex);

@ -120,9 +120,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
flowStep = EFixtureTakeFlowStep.; flowStep = EFixtureTakeFlowStep.;
} }
} }
}
break; break;
case EFixtureTakeFlowStep.1: case EFixtureTakeFlowStep.1:
targetPosition.NozzleZ = NozzleManager.GetFixtureTakeProductPos(curFixture.Index, curNozzle.NozzleIndex); targetPosition.NozzleZ = NozzleManager.GetFixtureTakeProductPos(curFixture.Index, curNozzle.NozzleIndex);

@ -118,11 +118,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
else else
{ {
logInfo = $"{GetClassName()} 轴不在目标位置,重新运动一次"; AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
MessageQueue.Instance.Warn(logInfo); if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
flowStep = EProductLocationFlowStep.; flowStep = EProductLocationFlowStep.;
} }
} }
}
break; break;
case EProductLocationFlowStep.: case EProductLocationFlowStep.:
if (grabEndSlot != null) if (grabEndSlot != null)
@ -155,11 +158,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
else else
{ {
logInfo = $"{GetClassName()} 轴不在目标位置,重新运动一次"; AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
MessageQueue.Instance.Warn(logInfo); if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
flowStep = EProductLocationFlowStep.; flowStep = EProductLocationFlowStep.;
} }
} }
}
break; break;
case EProductLocationFlowStep.: case EProductLocationFlowStep.:
if (GlobalVar.RunSpace) if (GlobalVar.RunSpace)

@ -107,11 +107,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
else else
{ {
logInfo = $"{GetClassName()} 轴不在目标位置,重新运动一次"; AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
MessageQueue.Instance.Warn(logInfo); if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
flowStep = EStockLocationFlowStep.; flowStep = EStockLocationFlowStep.;
} }
} }
}
break; break;
case EStockLocationFlowStep.: case EStockLocationFlowStep.:
if (grabEndSlot != null) if (grabEndSlot != null)
@ -143,11 +146,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
else else
{ {
logInfo = $"{GetClassName()} 轴不在目标位置,重新运动一次"; AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
MessageQueue.Instance.Warn(logInfo); if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
flowStep = EStockLocationFlowStep.; flowStep = EStockLocationFlowStep.;
} }
} }
}
break; break;
case EStockLocationFlowStep.: case EStockLocationFlowStep.:
//VisionResult vr = VisionHelper.Grab(Vision.EVisionScene.TrayLocation); //VisionResult vr = VisionHelper.Grab(Vision.EVisionScene.TrayLocation);

@ -160,9 +160,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
flowStep = EStockPlaceFlowStep.; flowStep = EStockPlaceFlowStep.;
} }
} }
}
break; break;
case EStockPlaceFlowStep.: case EStockPlaceFlowStep.:
if(VisionHelper.trayLocationVision.ClearQueue()) if(VisionHelper.trayLocationVision.ClearQueue())
@ -250,9 +255,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
flowStep = EStockPlaceFlowStep.; flowStep = EStockPlaceFlowStep.;
} }
} }
}
break; break;
case EStockPlaceFlowStep.: case EStockPlaceFlowStep.:
targetPosition.StockZ = NozzleManager.GetNozzleToTrayTakeProductPos(trayType, curNozzle.NozzleIndex)-GlobalVar.PlaceProdcutToStockTrayOffsetHeight; targetPosition.StockZ = NozzleManager.GetNozzleToTrayTakeProductPos(trayType, curNozzle.NozzleIndex)-GlobalVar.PlaceProdcutToStockTrayOffsetHeight;

@ -146,9 +146,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
else else
{ {
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.);
if (alarmEntity != null)
{
Msgbox.ShowDialog(alarmEntity, EButtonType.Ok, true);
flowStep = EStockTakeFlowStep.; flowStep = EStockTakeFlowStep.;
} }
} }
}
break; break;
case EStockTakeFlowStep.: case EStockTakeFlowStep.:

@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
// //
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
[assembly: AssemblyVersion("20.25.39.1")] [assembly: AssemblyVersion("20.25.40.1")]
//[assembly: AssemblyVersion("1.0.0.0")] //[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")] //[assembly: AssemblyFileVersion("1.0.0.0")]

@ -147,6 +147,7 @@ namespace Rs.MotionPlat
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
step++; step++;
} }
//Thread.Sleep(1000); //Thread.Sleep(1000);
} }

Loading…
Cancel
Save