Commit d03fe7e8 几米阳光

1

1 个父辈 7daf9d25
......@@ -234,7 +234,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(LOGGER, StoreName + "到待机状态,进出轴到P1,压紧轴先相对走-2000");
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
ComBeforeHomeMove();
ResetCloseDoor();
ResetCloseDoor();
}
public override void Reset()
{
......@@ -369,7 +369,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_Door_P7, Config.UpDownAxis_P7_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position);
ResetCloseDoor();
CloseDoorAndWait();
break;
case StoreMoveStep.BOX_H_MiddleAxisToP1:
LogUtil.info(LOGGER, StoreName + "复位完成");
......@@ -397,6 +397,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_Door_P7, Config.UpDownAxis_P7_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position);
CloseDoorAndWait();
break;
case StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1:
LogUtil.info(LOGGER, StoreName + "到待机状态完成");
......@@ -537,7 +538,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_Door_P7, Config.UpDownAxis_P7_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position);
ResetCloseDoor();
CloseDoorAndWait();
break;
case StoreMoveStep.BOX_H_MiddleAxisToP1:
LogUtil.info(LOGGER, StoreName + "回原点完成");
......
......@@ -116,7 +116,7 @@ namespace OnlineStore.DeviceLibrary
int errorCount = Math.Abs(outCount - InOut_P1);
if (errorCount <= Config.InOut_Axis.CanErrorCountMin)
{
LogUtil.info("进出轴当前位置:" + outCount + ",已经在P1,不需要再回P1");
LogUtil.debug("进出轴当前位置:" + outCount + ",已经在P1,不需要再回P1");
}
else
{
......@@ -324,20 +324,20 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.error(LOGGER, StoreName + " 启动【" + posId + "】入库出错,当前状态,storeStatus=" + storeRunStatus);
LogUtil.error(LOGGER, StoreName + " 启动【" + posId + "】入库出错,当前 storeStatus=" + storeRunStatus);
return false;
}
}
private void SI_02_Move(LineMoveP moveP)
{
InStoreLog("入库:SI_02_ 进出轴(叉子)动作至P1,打开舱门");
InStoreLog("入库:SI_02_ 进出轴(叉子)动作至P1");
StoreMove.NextMoveStep(StoreMoveStep.SI_02_InOutAxisHome);
InOutBackToP1(moveP.InOut_P1);
}
private void SI_04_DeviceToDoor()
{
InStoreLog("入库:SI_04 叉子进入入料口,进出轴至P2(进料口取料点) ");
InStoreLog("入库:SI_04 叉子进入入料口,进出轴至P2 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_04_DeviceToDoor);
ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P2, Config.InOutAxis_P2_Speed);
......@@ -360,7 +360,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_02_InOutAxisHome)
{
InStoreLog("入库:SI_03 所有轴回到待机点,轴2、轴1 动作到P1,轴4动作至P3");
InStoreLog("入库:SI_03 所有轴回到待机点,轴2、轴1 动作到P1, 轴4动作至P3");
StoreMove.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
ComMoveToPosition(moveP.ComPress_P3);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
......@@ -372,7 +372,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_04_DeviceToDoor)
{
InStoreLog("入库:SI_05 拿物品,批量入库, 等待吸盘放下物品");
InStoreLog("入库:SI_05 等待吸盘放下物品");
StoreMove.NextMoveStep(StoreMoveStep.SI_05_DoorWarToDevice);
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(1000));
......@@ -382,7 +382,7 @@ namespace OnlineStore.DeviceLibrary
{
if (StoreMove.IsBatchInOutStore && (!StoreMove.IsNeedInStore))
{
InStoreLog("入库:SI_21不需要入库,需要操作人员拿走料盘,叉子到门口位置P7 ");
InStoreLog("送出料盘:SI_21 ,需要操作人员拿走料盘,进出轴(叉子)到门口位置P7 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_21_DeviceToDoor);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_Door_P7, Config.UpDownAxis_P7_Speed);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SafetyLightCurtains, IO_VALUE.HIGH));
......@@ -391,13 +391,13 @@ namespace OnlineStore.DeviceLibrary
{
if (IsHasCompress_Axis)
{
InStoreLog("入库:SI_06 压紧轴压紧,到压紧点 ");
InStoreLog("入库:SI_06 压紧轴压紧,压紧轴到P2 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_06_CompressWork);
ComMoveToPosition(moveP.ComPress_P2);
}
else
{
InStoreLog("入库:SI_07 叉子 从入料口抽出,进出轴至P1(待机点) ");
InStoreLog("入库:SI_07 叉子返回,进出轴至P1(待机点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_07_DeviceBackFromDoor);
InOutBackToP1(moveP.InOut_P1);
}
......@@ -405,7 +405,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_06_CompressWork)
{
InStoreLog("入库:SI_07 叉子 从入料口抽出,进出轴至P1(待机点) ");
InStoreLog("入库:SI_07 叉子返回,进出轴至P1(待机点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_07_DeviceBackFromDoor);
InOutBackToP1(moveP.InOut_P1);
}
......@@ -427,7 +427,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_08_LocationCylinder_Up)
{
InStoreLog("入库:SI_09 移动到库位点,旋转轴至P2(库位点),升降轴至P3(库位入库前点)),关闭舱门 ");
InStoreLog("入库:SI_09 移动到库位点,旋转轴至P2(库位点),升降轴至P3(库位入库前点)) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_09_MoveToBag);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
......@@ -464,7 +464,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_12_PutWareToBag)
{
InStoreLog("入库:SI_13 叉子从库位中返回,进出轴动作至P1(待机点) ");
InStoreLog("入库:SI_13 叉子从库位中返回,进出轴至P1(待机点) ");
// 5= 入仓位完成(料仓Box把料盘放入对应的库位中,装置还未恢复原始状态)
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
lastPosId = posId;
......@@ -478,7 +478,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_13_InoutBack)
{
InStoreLog("入库:SI_14 返回待机点,轴2/轴1/轴4动作至P1(待机点)),检测门关闭");
InStoreLog("入库:SI_14 返回待机点,轴2/轴1/轴4动作至P1(待机点))");
StoreMove.NextMoveStep(StoreMoveStep.SI_14_GoBack);
ComMoveToPosition(moveP.ComPress_P1);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
......@@ -498,36 +498,31 @@ namespace OnlineStore.DeviceLibrary
#region 送出料盘处理
else if (StoreMove.MoveStep == StoreMoveStep.SI_21_DeviceToDoor)
{
if (KND.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
{
InStoreLog("入库:SI_21不需要入库,打开仓门 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_22_OpenDoor);
OpenDoorAndWait();
}
InStoreLog("送出料盘:SI_22 ,打开仓门 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_22_OpenDoor);
OpenDoorAndWait();
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SI_22_OpenDoor))
{
InStoreLog("入库:SI_23不需要入库,等待操作人员拿走料盘 ");
InStoreLog("送出料盘:SI_23 ,等待操作人员拿走料盘 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_23_WaitTrayGo);
StoreMove.TimeOutSeconds = 120;
AutomaticBaiting.IsGetTrayGo = false;
AutomaticBaiting.IsWaitTragGo = true;
StoreMove.WaitList.Add(WaitResultInfo.WaitTakeTray());
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_23_WaitTrayGo)
{
if (KND.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
{
InStoreLog("入库:SI_13 叉子从库位中返回,进出轴动作至P1(待机点) ");
// 5= 入仓位完成(料仓Box把料盘放入对应的库位中,装置还未恢复原始状态)
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
lastPosId = "";
lastPosIdStatus = StoreStatus.InStoreEnd;
storeStatus = StoreStatus.InStoreEnd;
StoreMove.NextMoveStep(StoreMoveStep.SI_13_InoutBack);
InOutBackToP1(moveP.InOut_P1);
CloseDoorAndWait();
}
{
InStoreLog("送出料盘:SI_13 叉子从库位中返回,进出轴动作至P1(待机点) ");
// 5= 入仓位完成(料仓Box把料盘放入对应的库位中,装置还未恢复原始状态)
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
lastPosId = "";
lastPosIdStatus = StoreStatus.InStoreEnd;
storeStatus = StoreStatus.InStoreEnd;
StoreMove.NextMoveStep(StoreMoveStep.SI_13_InoutBack);
InOutBackToP1(moveP.InOut_P1);
CloseDoorAndWait();
}
#endregion
......@@ -602,7 +597,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.error(LOGGER, StoreName + " 启动出库出错,当前状态,storeStatus=" + storeRunStatus);
LogUtil.error(LOGGER, StoreName + logMsg+ "出错,当前storeStatus=" + storeRunStatus);
return false;
}
}
......@@ -686,7 +681,7 @@ namespace OnlineStore.DeviceLibrary
else
{
StoreMove.NextMoveStep(StoreMoveStep.SO_09_LocationCylinder_Down);
OutStoreLog("出库:SO_09 定位气缸退回,定位气缸退回 ");
OutStoreLog("出库:SO_09 定位气缸退回 ");
LocationDownAndWait();
}
}
......@@ -700,37 +695,32 @@ namespace OnlineStore.DeviceLibrary
if (StoreMove.IsBatchInOutStore)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_11_PutTray);
OutStoreLog("出库:SO_11_PutTray 放下料盘,升降轴下降到_OutLow_P8,压紧轴放松");
OutStoreLog("出库:SO_11_PutTray 放下料盘,升降轴到P8(出库低点),压紧轴至P3(压紧前点)");
ComMoveToPosition(StoreMove.MoveParam.MoveP.ComPress_P3);
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_OutLow_P8, Config.UpDownAxis_P8_Speed);
}
else
{
if (KND.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
{
StoreMove.NextMoveStep(StoreMoveStep.SO_21_OpenDoor);
OutStoreLog("出库:SO_21打开仓门,压紧轴放松,,定位气缸下降");
ComMoveToPosition(StoreMove.MoveParam.MoveP.ComPress_P3);
OpenDoorAndWait();
LocationDownAndWait();
}
StoreMove.NextMoveStep(StoreMoveStep.SO_21_OpenDoor);
OutStoreLog("出库:SO_21打开仓门,压紧轴至P3(压紧前点),定位气缸下降");
ComMoveToPosition(StoreMove.MoveParam.MoveP.ComPress_P3);
OpenDoorAndWait();
LocationDownAndWait();
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_21_OpenDoor)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_22_WaitTrayGo);
OutStoreLog("出库:SO_22等待操作人员拿走料盘 ");
OutStoreLog("出库:SO_22 等待操作人员拿走料盘 ");
StoreMove.TimeOutSeconds = 120;
AutomaticBaiting.IsWaitTragGo = true;
AutomaticBaiting.IsGetTrayGo = false;
StoreMove.WaitList.Add(WaitResultInfo.WaitTakeTray());
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_22_WaitTrayGo))
{
if (KND.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
{
SO_13_InoutBack();
CloseDoorAndWait();
}
{
SO_13_InoutBack();
CloseDoorAndWait();
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_11_PutTray)
{
......@@ -740,20 +730,20 @@ namespace OnlineStore.DeviceLibrary
{
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
storeStatus = StoreStatus.StoreOnline;
LogUtil.info(LOGGER, StoreName + " 【" + posId + "】 整个出库流程结束,耗时【" + FormUtil.GetSpanStr(InOutWatch.Elapsed) + "】!");
LogUtil.info(LOGGER, StoreName + " 【" + posId + "】 出库结束,耗时【" + FormUtil.GetSpanStr(InOutWatch.Elapsed) + "】!");
StoreMove.EndMove();
storeRunStatus = StoreRunStatus.Runing;
InOutEndProcess(StoreMoveType.OutStore);
}
else
{
LogUtil.error(LOGGER, StoreName + " 出库处理,moveStatus=" + StoreMove.MoveStep + ",没有对应的处理!");
LogUtil.error(LOGGER, StoreName + " 出库 moveStatus=" + StoreMove.MoveStep + ",没有对应的处理!");
}
}
private void SO_02_DeviceBack()
{
StoreMove.NextMoveStep(StoreMoveStep.SO_02_DeviceBack);
OutStoreLog("出库:SO_02 叉子先运动到P1 , 开始");
OutStoreLog("出库:SO_02 叉子运动到P1 ");
InOutBackToP1(StoreMove.MoveParam.MoveP.InOut_P1);
if (StoreMove.IsBatchInOutStore)
{
......@@ -762,7 +752,7 @@ namespace OnlineStore.DeviceLibrary
{
StoreMove.TimeOutSeconds = 120;
ACAxisMove(Config.Batch_Axis, Config.BatchAxis_P1, Config.BatchAxis_P1_Speed);
OutStoreLog("出库:SO_02 批量上下料轴到P1点【"+Config.BatchAxis_P1+"】 ");
OutStoreLog("出库:SO_02 批量上下料轴到P1点【"+Config.BatchAxis_P1+"】 ");
}
}
}
......@@ -809,7 +799,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.SO_08_ToDoorPosition);
if (StoreMove.IsBatchInOutStore)
{
OutStoreLog("出库:SO_08 升降轴到出料高点OutHigh_P2,旋转轴至P1(待机点) ");
OutStoreLog("出库:SO_08 升降轴到出料高点P2,旋转轴至P1(待机点) ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_OutHigh_P2, Config.UpDownAxis_P2_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
BatchAxisUpTrayHeight();
......
......@@ -213,16 +213,8 @@ namespace OnlineStore.DeviceLibrary
{
AutoBaitingStatus = StoreRunStatus.Busy;
StoreMove.NewMove(StoreMoveType.InStore);
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I00_MoveToUp);
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
{
LogUtil.error(Name + " 启动入料 ,已检测到料盘,轴不需要上升");
}
else
{
LogUtil.error(Name + " 启动入料 ,轴上升到检测到料盘");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.Batch_Axis.TargetSpeed);
}
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I01_Wait);
LogUtil.info(Name + "启动入料");
return true;
}
else
......@@ -243,34 +235,47 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I00_MoveToUp))
if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I01_Wait))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I02_MoveToUp);
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
{
LogUtil.info(Name + " 入料 ,已检测到料盘,轴不需要上升");
}
else
{
LogUtil.info(Name + " 入料 ,轴上升到检测到料盘");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.Batch_Axis.TargetSpeed);
}
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I02_MoveToUp))
{
IsNeedScanCode();
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I01_ScanCode))
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I03_ScanCode))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I02_SuckingDisc_Down);
LogUtil.info(Name + "入料: 检测到料盘, 吸盘开始下降");
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I04_SuckingDisc_Down);
LogUtil.info(Name + "入料: 扫码结束,二维码【" + LastCode + "】 吸盘开始下降");
CylinderMove(IO_Type.SuckingDisc_Down, IO_Type.SuckingDisc_Up, true);
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I02_SuckingDisc_Down))
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I04_SuckingDisc_Down))
{
SuckingDiscWork();
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I03_SuckingDisc_Work))
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I05_SuckingDisc_Work))
{
if (KND.IOValue(IO_Type.SuckingDisc_Air).Equals(IO_VALUE.HIGH))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I04_SuckingDisc_Up);
LogUtil.info(Name + "入料: 吸盘上升,等待宽度到达"+StoreManager.Config.Default_TrayWidth);
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I06_SuckingDisc_Up);
LogUtil.info(Name + "入料: 吸盘上升,等待宽度到达" + StoreManager.Config.Default_TrayWidth);
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, true);
if (StoreManager.Config.Default_TrayWidth.Equals(7))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.WidthCheck1, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.WidthCheck2, IO_VALUE.LOW));
}else if (StoreManager.Config.Default_TrayWidth.Equals(13))
{
}
else if (StoreManager.Config.Default_TrayWidth.Equals(13))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.WidthCheck1, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.WidthCheck2, IO_VALUE.HIGH));
}
......@@ -285,13 +290,14 @@ namespace OnlineStore.DeviceLibrary
WarnMsg = "吸盘已经尝试三次,仍然吸不到物料!";
StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, "吸盘吸料失败", WarnMsg, StoreMoveType.InStore);
}
}else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I04_SuckingDisc_Up))
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I06_SuckingDisc_Up))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I05_BatchAxisUp);
LogUtil.info(Name + "入料: 批量上下料轴上升");
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I07_BatchAxisUp);
LogUtil.info(Name + "入料: 批量上下料轴上升");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.Batch_Axis.TargetSpeed);
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I05_BatchAxisUp))
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I07_BatchAxisUp))
{
if (StoreManager.Store.CanStarInOut())
{
......@@ -304,26 +310,25 @@ namespace OnlineStore.DeviceLibrary
}
else
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I06_GetPosId);
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I08_GetPosId);
//计算高度
EndMovePosition = ACServerManager.GetActualtPosition(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
LastHeight = Math.Abs(EndMovePosition - StartMovePosition) / AxisChangeValue;
LogUtil.info(Name + "入料: 计算高度:上升前位置【" + StartMovePosition + "】实时位置【" + EndMovePosition + "】,计算后高度【" + LastHeight + "】");
LastSize = StoreManager.Config.Default_TrayWidth;
LastSize = StoreManager.Config.Default_TrayWidth;
LogUtil.info(Name + "入料: 从服务器获取入库PosId,尺寸:【" + LastSize + "*" + LastHeight + "】二维码【" + LastCode + "】");
GetInStorePosId(ProcessMsg());
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
StoreMove.OneWaitCanEndStep = true;
}
}
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I06_GetPosId))
{
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I08_GetPosId))
{
//判断是否开始入库
if (StoreManager.Store.StoreMove.MoveType.Equals(StoreMoveType.InStore) || (!LastPosId.Equals("")))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I07_WaitTrayLeave);
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I09_WaitTrayLeave);
LogUtil.info(Name + "入料: 开始入料【" + LastPosId + "】,等待料盘拿走");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Air, IO_VALUE.LOW));
}
......@@ -335,7 +340,7 @@ namespace OnlineStore.DeviceLibrary
StoreManager.Store.StartInStoreMove(new InOutStoreParam("", posId), true, false);
}
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I07_WaitTrayLeave))
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I09_WaitTrayLeave))
{
if (StoreManager.Store.StoreMove.MoveStep >= StoreMoveStep.SI_07_DeviceBackFromDoor)
{
......@@ -348,7 +353,14 @@ namespace OnlineStore.DeviceLibrary
{
IsNeedScanCode();
}
}
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I11_BatchAxisHome))
{
//TODO
LogUtil.info(Name + "入料:已经没有料盘,批量上料结束");
StoreMove.EndMove();
AutoBaitingStatus = StoreRunStatus.Runing;
}
else
{
LogUtil.error(Name + "未找到步骤:" + StoreMove.MoveType);
......@@ -357,7 +369,7 @@ namespace OnlineStore.DeviceLibrary
private static void SuckingDiscWork()
{
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I03_SuckingDisc_Work);
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I05_SuckingDisc_Work);
SuckingDisc_WorkCount++;
LogUtil.info(Name + "入料: 吸盘开始第" + SuckingDisc_WorkCount + "次工作");
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.HIGH);
......@@ -375,19 +387,19 @@ namespace OnlineStore.DeviceLibrary
// if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(0))
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I01_ScanCode);
LogUtil.info(Name + "入料: 开始扫码 ");
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I03_ScanCode);
LogUtil.info(Name + "入料: 开始扫码,最多等待两秒钟 ");
StoreMove.OneWaitCanEndStep = true;
StoreMove.WaitList.Add(WaitResultInfo.WaitCodeOK());
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
GetCameraCode();
StoreMove.OneWaitCanEndStep = true;
}
else
{
//TODO
LogUtil.info(Name + "入料:已经没有料盘,入料结束");
StoreMove.EndMove();
AutoBaitingStatus = StoreRunStatus.Runing;
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I11_BatchAxisHome);
LogUtil.info(Name + "入料:已经没有料盘,批量上下轴回原点");
StoreMove.TimeOutSeconds = 120;
ACAxisHomeMove(StoreManager.Config.Batch_Axis);
}
}
......
......@@ -72,87 +72,88 @@ namespace OnlineStore.DeviceLibrary
StoreMove.EndStepWait();
return;
}
try {
//当等待超过一分钟时,需要打印提示
TimeSpan span = DateTime.Now - StoreMove.LastSetpTime;
string NotOkMsg = "";
bool isOk = !StoreMove.OneWaitCanEndStep;
foreach (WaitResultInfo wait in list)
try
{
if (wait.IsEnd)
{
continue;
}
NotOkMsg = wait.ToStr();
if (wait.WaitType == (int)Wait_Type.AxisMove_1)
//当等待超过一分钟时,需要打印提示
TimeSpan span = DateTime.Now - StoreMove.LastSetpTime;
string NotOkMsg = "";
bool isOk = !StoreMove.OneWaitCanEndStep;
foreach (WaitResultInfo wait in list)
{
wait.IsEnd = AxisMoveISEnd(wait);
}
else if (wait.WaitType == (int)Wait_Type.IOMove_2)
{
wait.IsEnd = KND.IOValue(wait.IoType).Equals(wait.IoValue);
int timeOutMs = StoreManager.Config.IOSingle_TimerOut;
if (wait.IsEnd)
{
continue;
}
NotOkMsg = wait.ToStr();
if (wait.WaitType == (int)Wait_Type.AxisMove_1)
{
wait.IsEnd = AxisMoveISEnd(wait);
}
else if (wait.WaitType == (int)Wait_Type.IOMove_2)
{
wait.IsEnd = KND.IOValue(wait.IoType).Equals(wait.IoValue);
int timeOutMs = StoreManager.Config.IOSingle_TimerOut;
if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs)
if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs)
{
ConfigIO io = StoreManager.Config.getWaitIO(wait.IoType);
WarnMsg = Name + " 等待信号" + io.DisplayStr + "=" + wait.IoValue + "超时!";
StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType);
LogUtil.error(WarnMsg);
isOk = false;
break;
}
}
else if (wait.WaitType == (int)Wait_Type.Time_3)
{
ConfigIO io = StoreManager.Config.getWaitIO(wait.IoType);
WarnMsg = Name + " 等待信号" + io.DisplayStr + "=" + wait.IoValue + "超时!";
StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType);
LogUtil.error(WarnMsg);
isOk = false;
break;
wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds);
}
}
else if (wait.WaitType == (int)Wait_Type.Time_3)
{
wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds);
}
else if (wait.WaitType == (int)Wait_Type.ShuoKe_5)
{
}
else if (wait.WaitType == (int)Wait_Type.AxisHomeSingle_6)
{
IO_VALUE value = (IO_VALUE)ACServerManager.GetHomeSingle(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
wait.IsEnd = wait.IoValue.Equals(value);
}
//else if (wait.WaitType == (int)Wait_Type.WaitHeight_7)
//{
//}
//else if (wait.WaitType == (int)Wait_Type.AxisLimitNegativeSingle_8)
//{
// IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitNegativeSingle(wait.AxisInfo);
// wait.IsEnd = wait.IoValue.Equals(value);
//}
//else if (wait.WaitType == (int)Wait_Type.AxisLimitPositiveSingle_9)
//{
// IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitPositiveSingle(wait.AxisInfo);
// wait.IsEnd = wait.IoValue.Equals(value);
//}
else if (wait.WaitType == (int)Wait_Type.BatchAxisMove_10)
{
wait.IsEnd = BatchAxisIsEnd(wait);
}
else if (wait.WaitType == (int)Wait_Type.ScanCode_11)
{
wait.IsEnd = !String.IsNullOrEmpty(LastCode);
}
if (wait.IsEnd)
{
if (StoreMove.OneWaitCanEndStep)
else if (wait.WaitType == (int)Wait_Type.ShuoKe_5)
{
isOk = true;
break;
}
}
else
{
if (!StoreMove.OneWaitCanEndStep)
else if (wait.WaitType == (int)Wait_Type.AxisHomeSingle_6)
{
isOk = false;
break;
IO_VALUE value = (IO_VALUE)ACServerManager.GetHomeSingle(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
wait.IsEnd = wait.IoValue.Equals(value);
}
//else if (wait.WaitType == (int)Wait_Type.WaitHeight_7)
//{
//}
//else if (wait.WaitType == (int)Wait_Type.AxisLimitNegativeSingle_8)
//{
// IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitNegativeSingle(wait.AxisInfo);
// wait.IsEnd = wait.IoValue.Equals(value);
//}
//else if (wait.WaitType == (int)Wait_Type.AxisLimitPositiveSingle_9)
//{
// IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitPositiveSingle(wait.AxisInfo);
// wait.IsEnd = wait.IoValue.Equals(value);
//}
else if (wait.WaitType == (int)Wait_Type.BatchAxisMove_10)
{
wait.IsEnd = BatchAxisIsEnd(wait);
}
else if (wait.WaitType == (int)Wait_Type.ScanCode_11)
{
wait.IsEnd = (LastCode.Equals("").Equals(false));
}
if (wait.IsEnd)
{
if (StoreMove.OneWaitCanEndStep)
{
isOk = true;
break;
}
}
else
{
if (!StoreMove.OneWaitCanEndStep)
{
isOk = false;
break;
}
}
}
}
if (isOk)
{
StoreMove.EndStepWait();
......@@ -161,7 +162,7 @@ namespace OnlineStore.DeviceLibrary
{
WarnMsg = Name + "【" + StoreMove.MoveType + "】【" + StoreMove.MoveStep + "】等待超时 [" + NotOkMsg
+ "]已等待[" + Math.Round(span.TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg);
LogUtil.error(WarnMsg);
StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, "", WarnMsg, StoreMove.MoveType);
}
}
......@@ -291,12 +292,11 @@ namespace OnlineStore.DeviceLibrary
if (LastCode.Equals(""))
{
LastCode = "NoCode";
LogUtil.info(Name + "未扫到二维码,默认为NoCode");
LogUtil.info(Name + "模拟二维码:NoCode");
}
if (LastCode.Equals(""))
{
LogUtil.error("未扫到二维码,请拿走料盘");
WarnMsg = "未扫到二维码,请拿走料盘";
LogUtil.error("未扫到二维码,需要将料盘送出");
}
else
{
......@@ -353,7 +353,7 @@ namespace OnlineStore.DeviceLibrary
if (StoreManager.Store.IsDebug)
{
string posId = "1#AC1_1_1_4";
LogUtil.info(Name + "调试模式,不需要连接服务器,直接模拟库位号【" + posId + "】");
LogUtil.info(Name + "调试模式,模拟库位号【" + posId + "】");
string plateH = "8";
string plateW = "7";
if (StoreManager.Store.CanStarInOut())
......
......@@ -407,73 +407,58 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 自动上下料上料功能
/// <summary>
/// 开始自动上料
/// </summary>
AUTO_I01_Wait=1201,
/// <summary>
/// 先上升到料盘检测1(上料机构)信号亮
/// </summary>
AUTO_I00_MoveToUp=1200,
AUTO_I02_MoveToUp=1202,
/// <summary>
/// 扫码
/// </summary>
AUTO_I01_ScanCode=1201,
AUTO_I03_ScanCode=1203,
/// <summary>
/// 吸盘下降
/// </summary>
AUTO_I02_SuckingDisc_Down=1202,
AUTO_I04_SuckingDisc_Down=1204,
/// <summary>
/// 吸盘吸料盘
/// </summary>
AUTO_I03_SuckingDisc_Work=1203,
AUTO_I05_SuckingDisc_Work=1205,
/// <summary>
/// 吸盘上升 ,
/// </summary>
AUTO_I04_SuckingDisc_Up=1204,
AUTO_I06_SuckingDisc_Up=1206,
/// <summary>
/// 批量上下料料轴上升
/// </summary>
AUTO_I05_BatchAxisUp=1205,
AUTO_I07_BatchAxisUp=1207,
/// <summary>
/// 从服务器获取PosID
/// </summary>
AUTO_I06_GetPosId=1206,
AUTO_I08_GetPosId=1208,
/// <summary>
/// 等待料盘被叉子拿走
/// </summary>
AUTO_I07_WaitTrayLeave=1207,
AUTO_I09_WaitTrayLeave=1209,
/// <summary>
/// 未扫到码:等待操作人员拿走料盘
/// </summary>
AUTO_I10_WaitTrayGo=1210,
///// <summary>
/////未扫到码: 把料盘放到叉子上
///// </summary>
//AUTO_I11_PutTrayToInout,
///// <summary>
///// 未扫到码:叉子进入门槛
///// </summary>
//AUTO_I12_InoutToDoor,
///// <summary>
///// 未扫到码:把料盘放到门口
///// </summary>
//AUTO_I13_PutTrayToDoor,
///// <summary>
///// 未扫到码:等待拿走料盘
///// </summary>
//AUTO_I14_WaitTakeTray,
///// <summary>
///// 未扫到码:料盘已手动拿走,需要等一秒钟后关闭仓门
///// </summary>
//AUTO_I15_TrayLeaveWaitTime,
AUTO_I10_WaitTrayGo=1210,
/// <summary>
/// 批量上下轴开始回原点
/// </summary>
AUTO_I11_BatchAxisHome=1211,
///// <summary>
///// 未扫到码:关闭仓门
///// </summary>
//AUTO_I16_CloseDoor,
#endregion
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!