Commit 5838f53a LN

出库等待时间是0时,必须等待料盘拿走才结束出库

1 个父辈 57508026
......@@ -135,19 +135,23 @@ namespace OnlineStore.DeviceLibrary
public override double GetAIValue(string ioiP, int index)
{
if (AIValList != null && index >= 0 && AIValList.Count > index)
for (int i = 1; i <= 3; i++)
{
return AIValList[index];
try
{
if (AIValList != null && index >= 0 && AIValList.Count > index)
{
return AIValList[index];
}
}
catch (Exception ex)
{
LogUtil.error("GetAIValue第【" + i + "】次获取 " + ioiP + "_" + index + "出错:" + ex.ToString());
}
Thread.Sleep(1);
}
return 0;
}
//public override double ConvertAI(double aiValue, double defaultValue)
//{
// double xishu = (double)ConfigAppSettings.GetNumValue(Setting_Init.AI_ConvertPosition);
// double result = Math.Round((aiValue - defaultValue) / xishu, 2);
// return result;
//}
}
}
......@@ -430,30 +430,31 @@ namespace OnlineStore.DeviceLibrary
public override IO_VALUE GetDOValue(string ioIP, byte slaveId, ushort StartAddress)
{
IO_VALUE value = IO_VALUE.LOW;
try
for (int i = 1; i <= 3; i++)
{
AIOBOX aioBox = getAIO(ioIP);
if (aioBox != null)
try
{
Box_Sta sta = Box_Sta.Off;
// Box_Addr addr = GetAddr(StartAddress);
// int index = (int)StartAddress - (int)StoreManager.Config.GetDILength(ioIP);
if (DOValueMap.ContainsKey(ioIP) && DOValueMap[ioIP].Count > StartAddress)
{
sta = DOValueMap[ioIP][StartAddress];
}
else
{ sta = aioBox.ReadDO(StartAddress); }
if (sta.Equals(Box_Sta.On))
AIOBOX aioBox = getAIO(ioIP);
if (aioBox != null)
{
value = IO_VALUE.HIGH;
Box_Sta sta = Box_Sta.Off;
if (DOValueMap.ContainsKey(ioIP) && DOValueMap[ioIP].Count > StartAddress)
{
sta = DOValueMap[ioIP][StartAddress];
}
else
{ sta = aioBox.ReadDO(StartAddress); }
if (sta.Equals(Box_Sta.On))
{
value = IO_VALUE.HIGH;
}
break;
}
}
}
catch (Exception ex)
{
LogUtil.error("GetDOValue [" + ioIP + "] [" + StartAddress + "] 出错:" + ex.ToString());
catch (Exception ex)
{
LogUtil.error("GetDOValue [" + ioIP + "] [" + StartAddress + "] [" + i + "] 出错:" + ex.ToString());
}
}
return value;
}
......@@ -483,6 +484,7 @@ namespace OnlineStore.DeviceLibrary
{
value = IO_VALUE.HIGH;
}
break;
}
}
catch (Exception ex)
......
......@@ -48,6 +48,7 @@ namespace OnlineStore.DeviceLibrary
//public ScanSocket scanSocket = new ScanSocket();
private System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
private System.Timers.Timer IoCheckTimer = new System.Timers.Timer();
private int OutStoreWaitSeconds = ConfigAppSettings.GetIntValue(Setting_Init.OutStoreWaitSeconds);
public AC_SA_BoxBean(AC_SA_Config config)
{
// int value= CalHeight(37);
......@@ -113,6 +114,8 @@ namespace OnlineStore.DeviceLibrary
IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
LogUtil.info(StoreName + " 初始化完成,OutStoreWaitSeconds=" + OutStoreWaitSeconds);
}
private void IoCheckTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
......
......@@ -187,6 +187,18 @@ namespace OnlineStore.DeviceLibrary
else if (wait.WaitType == 7)
{
wait.IsEnd = (wait.HeightValue.Equals(GetHeight()));
if (wait.IsEnd && (StoreMove.MoveStep == StoreMoveStep.SO_15_WaitTake) && wait.HeightValue.Equals(0))
{
if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
{
LogUtil.info(StoreMove.MoveStep + " 等待height=" + wait.HeightValue + "完成,且当前TrayCheck_Door=LOW");
}
else
{
LogUtil.info(StoreMove.MoveStep + " 等待height=" + wait.HeightValue + "完成,但当前TrayCheck_Door=High,继续等待门口无料盘信号");
wait.IsEnd = false;
}
}
if (wait.IsEnd)
{
LogUtil.debug("等待height=" + wait.HeightValue + "完成");
......@@ -570,7 +582,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.SO_03_ToBagPosition);
OutStoreLog("出库:SO_03 走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点)");
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
ACAxisMove(Config.Middle_Axis, StoreMove.MoveParam.MoveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P5, Config.UpDownAxis_P5_Speed);
}
......@@ -607,15 +619,15 @@ namespace OnlineStore.DeviceLibrary
{
StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckTray);
OutStoreLog("出库:SO_07 等待TrayCheck_Fixture=High ");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.HIGH));
}
else
{
StoreMove.NextMoveStep(StoreMoveStep.SO_08_ToDoorPosition);
OutStoreLog("出库:SO_08 走到料门口,旋转轴至P1(待机点)升降轴至P2(进料口出料前点),打开舱门 ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P2, Config.UpDownAxis_P2_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
}
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckTray)
{
......@@ -662,7 +674,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.SO_11_DevicePutWare);
NeedCheckSafetyLight = 0;
ComMoveToPosition(moveP.ComPress_P1, Config.CompAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P8, Config.UpDownAxis_P8_Speed);
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_11_DevicePutWare)
......@@ -691,37 +703,50 @@ namespace OnlineStore.DeviceLibrary
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_14_GoBack)
{
int OutStoreWaitSeconds = ConfigAppSettings.GetIntValue(Setting_Init.OutStoreWaitSeconds);
if (OutStoreWaitSeconds <= 0)
{
OutStoreWaitSeconds = 600;
}
int ms = OutStoreWaitSeconds * 1000;
StoreMove.NextMoveStep(StoreMoveStep.SO_15_WaitTake);
if (!IsInOutStoreAuto)
{
OutStoreLog("出库:SO_14_WaitTake 等待拿走物品,最多等待" + OutStoreWaitSeconds + "秒");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(ms));
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
if (OutStoreWaitSeconds > 0)
{
int ms = OutStoreWaitSeconds * 1000;
OutStoreLog("出库:SO_15_WaitTake 等待拿走物品,最多等待" + OutStoreWaitSeconds + "秒");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(ms));
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
StoreMove.OneWaitCanEndStep = true;
}
else
{
OutStoreLog("出库:SO_15_WaitTake 等待拿走物品 ");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
}
}
else
{
OutStoreLog("出库:SO_14_WaitTake 放置物品,最多等待" + "3秒");
OutStoreLog("出库:SO_15_WaitTake 自动出入库中,等待3秒后继续");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(3000));
}
StoreMove.OneWaitCanEndStep = true;
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_15_WaitTake)
{
TimeSpan span = DateTime.Now - startOutStoreTime;
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
storeStatus = StoreStatus.StoreOnline;
LogUtil.info(LOGGER, StoreName + " 【" + posId + "】出库结束[" + FormUtil.GetSpanStr(span) + "]", storeMoveColor);
StoreMove.EndMove();
storeRunStatus = StoreRunStatus.Runing;
//InOutEndProcess(StoreMoveType.OutStore);
//如果配置是0,再次验证是否拿走物品
if (OutStoreWaitSeconds <= 0)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_16_CheckIsTake);
OutStoreLog("出库:SO_16_CheckIsTake 再次等待物品是否已拿走 ");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(200));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
}
else
{
OutStoreEnd();
}
}else if (StoreMove.MoveStep == StoreMoveStep.SO_16_CheckIsTake)
{
OutStoreEnd();
}
else
{
......@@ -729,11 +754,20 @@ namespace OnlineStore.DeviceLibrary
}
}
private void OutStoreEnd()
{
TimeSpan span = DateTime.Now - startOutStoreTime;
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
storeStatus = StoreStatus.StoreOnline;
LogUtil.info(LOGGER, StoreName + " 【" + posId + "】出库结束[" + FormUtil.GetSpanStr(span) + "]", storeMoveColor);
StoreMove.EndMove();
storeRunStatus = StoreRunStatus.Runing;
//InOutEndProcess(StoreMoveType.OutStore);
}
private void SO_14_GoBack()
{
StoreMove.NextMoveStep(StoreMoveStep.SO_14_GoBack);
OutStoreLog("出库:SO_13 升降轴返回,轴2至P1(待机点) ,关闭舱门,更改状态为出库完成");
OutStoreLog("出库:SO_14 升降轴返回,轴2至P1(待机点) ,关闭舱门,更改状态为出库完成");
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
CloseDoorAndWait();
......
......@@ -253,6 +253,11 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
SO_15_WaitTake=115,
/// <summary>
/// 料仓出库。。。等待200毫秒再次验证料盘是否拿走
/// </summary>
SO_16_CheckIsTake=116,
#endregion
#region 料仓内部入库步骤
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!