Commit a8778c87 LN

去掉料架检测到信号和托架前进后退

1 个父辈 758f33da
......@@ -2,6 +2,7 @@
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
......@@ -96,52 +97,53 @@ namespace OnlineStore.DeviceLibrary
public bool StartForward(StoreMoveInfo moveInfo)
{
string forwardIO = IO_Type.LeftShelf_Forward;
string backIO = IO_Type.LeftShelf_Back;
if (this.ShelfType.Equals(2))
{
forwardIO = IO_Type.RightShelf_Forward;
backIO = IO_Type.RightShelf_Back;
}
//如果门已打开直接返回
if (IOManager.IOValue(forwardIO).Equals(IO_VALUE.HIGH) &&
IOManager.IOValue(backIO).Equals(IO_VALUE.LOW))
{
return true;
}
//string forwardIO = IO_Type.LeftShelf_Forward;
//string backIO = IO_Type.LeftShelf_Back;
//if (this.ShelfType.Equals(2))
//{
// forwardIO = IO_Type.RightShelf_Forward;
// backIO = IO_Type.RightShelf_Back;
//}
////如果门已打开直接返回
//if (IOManager.IOValue(forwardIO).Equals(IO_VALUE.HIGH) &&
// IOManager.IOValue(backIO).Equals(IO_VALUE.LOW))
//{
// return true;
//}
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(forwardIO, IO_VALUE.HIGH));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(backIO, IO_VALUE.LOW));
}
return Start(forwardIO, backIO, forwardIO);
//if (moveInfo != null)
//{
// moveInfo.WaitList.Add(WaitResultInfo.WaitIO(forwardIO, IO_VALUE.HIGH));
// moveInfo.WaitList.Add(WaitResultInfo.WaitIO(backIO, IO_VALUE.LOW));
//}
//return Start(forwardIO, backIO, forwardIO);
return true;
}
public bool StartBack(StoreMoveInfo moveInfo)
{
string forwardIO = IO_Type.LeftShelf_Forward;
string backIO = IO_Type.LeftShelf_Back;
if (this.ShelfType.Equals(2))
{
forwardIO = IO_Type.RightShelf_Forward;
backIO = IO_Type.RightShelf_Back;
}
//如果门已打开直接返回
if (IOManager.IOValue(backIO).Equals(IO_VALUE.HIGH) &&
IOManager.IOValue(forwardIO).Equals(IO_VALUE.LOW))
{
return true;
}
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(backIO, IO_VALUE.HIGH));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(forwardIO, IO_VALUE.LOW));
}
return Start(backIO, forwardIO, backIO);
//string forwardIO = IO_Type.LeftShelf_Forward;
//string backIO = IO_Type.LeftShelf_Back;
//if (this.ShelfType.Equals(2))
//{
// forwardIO = IO_Type.RightShelf_Forward;
// backIO = IO_Type.RightShelf_Back;
//}
////如果门已打开直接返回
//if (IOManager.IOValue(backIO).Equals(IO_VALUE.HIGH) &&
// IOManager.IOValue(forwardIO).Equals(IO_VALUE.LOW))
//{
// return true;
//}
//if (moveInfo != null)
//{
// moveInfo.WaitList.Add(WaitResultInfo.WaitIO(backIO, IO_VALUE.HIGH));
// moveInfo.WaitList.Add(WaitResultInfo.WaitIO(forwardIO, IO_VALUE.LOW));
//}
//return Start(backIO, forwardIO, backIO);
return true;
}
}
}
......@@ -1641,14 +1641,14 @@ namespace OnlineStore.DeviceLibrary
{
return false;
}
if (door == 1 && IOManager.IOValue(IO_Type.LeftShelf_Check).Equals(IO_VALUE.HIGH))
{
return false;
}
if (door == 2 && IOManager.IOValue(IO_Type.RightShelf_Check).Equals(IO_VALUE.HIGH))
{
return false;
}
//if (door == 1 && IOManager.IOValue(IO_Type.LeftShelf_Check).Equals(IO_VALUE.HIGH))
//{
// return false;
//}
//if (door == 2 && IOManager.IOValue(IO_Type.RightShelf_Check).Equals(IO_VALUE.HIGH))
//{
// return false;
//}
return true;
}
......
......@@ -383,14 +383,14 @@ namespace OnlineStore.DeviceLibrary
ShelfBack(StoreMove.MoveParam.PosInfo.ShelfType, StoreMove);
if (StoreManager.UseShelfCheck)
{
if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(1))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.HIGH));
}
else
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.HIGH));
}
//if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(1))
//{
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.HIGH));
//}
//else
//{
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.HIGH));
//}
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_03_ToP1)
......@@ -418,14 +418,14 @@ namespace OnlineStore.DeviceLibrary
InStoreLog("入库: 判断是否拿到物料");
if (StoreManager.UseShelfCheck)
{
if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(1))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
}
else
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
}
//if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(1))
//{
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
//}
//else
//{
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
//}
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.HIGH));
}
}
......@@ -570,30 +570,35 @@ namespace OnlineStore.DeviceLibrary
//判断对应托架是否有料盒
int shelfType = param.PosInfo.ShelfType;
if (shelfType.Equals(1) && IOManager.IOValue(IO_Type.LeftShelf_Check).Equals(IO_VALUE.HIGH))
{
LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】【" + shelfType + "】出错,LeftShelf_Check 信号亮 ");
WarnMsg = $"启动出库[{posId}][{shelfType}]失败,左侧托架物料检测信号亮";
return false;
}
else if (shelfType.Equals(2) && IOManager.IOValue(IO_Type.RightShelf_Check).Equals(IO_VALUE.HIGH))
{
LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】【" + shelfType + "】出错,RightShelf_Check 信号亮 ");
WarnMsg = $"启动出库[{posId}][{shelfType}]失败,右侧托架物料检测信号亮";
return false;
//if (shelfType.Equals(1) && IOManager.IOValue(IO_Type.LeftShelf_Check).Equals(IO_VALUE.HIGH))
//{
// LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】【" + shelfType + "】出错,LeftShelf_Check 信号亮 ");
// WarnMsg = $"启动出库[{posId}][{shelfType}]失败,左侧托架物料检测信号亮";
// return false;
//}
//else if (shelfType.Equals(2) && IOManager.IOValue(IO_Type.RightShelf_Check).Equals(IO_VALUE.HIGH))
//{
// LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】【" + shelfType + "】出错,RightShelf_Check 信号亮 ");
// WarnMsg = $"启动出库[{posId}][{shelfType}]失败,右侧托架物料检测信号亮";
// return false;
}
else if (shelfType.Equals(0))
{
//如果两侧都有料
if (IOManager.IOValue(IO_Type.LeftShelf_Check).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.RightShelf_Check).Equals(IO_VALUE.HIGH))
//}
//else if (shelfType.Equals(0))
//{
// //如果两侧都有料
// if (IOManager.IOValue(IO_Type.LeftShelf_Check).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.RightShelf_Check).Equals(IO_VALUE.HIGH))
// {
// LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】【" + shelfType + "】出错,LeftShelf_Check信号亮, RightShelf_Check 信号亮 ");
// WarnMsg = $"启动出库[{posId}][{shelfType}]失败,左右两侧托架物料检测信号都亮";
// return false;
// }
//}
if (shelfType.Equals(0))
{
LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】【" + shelfType + "】出错,LeftShelf_Check信号亮, RightShelf_Check 信号亮 ");
WarnMsg = $"启动出库[{posId}][{shelfType}]失败,左右两侧托架物料检测信号都亮";
return false;
}
StoreMove.MoveParam.UpdateShelfType(1, Config);
}
clearWarmMsg("启动出库");
clearWarmMsg("启动入库");
......@@ -655,16 +660,16 @@ namespace OnlineStore.DeviceLibrary
{
if (StoreMove.MoveParam.PosInfo.ShelfType <= 0)
{
if (IOManager.IOValue(IO_Type.LeftShelf_Check).Equals(IO_VALUE.LOW))
{
StoreMove.MoveParam.UpdateShelfType(1, Config);
OutStoreLog(" 出库: 当前未设置ShelfType,默认ShelfType=" + StoreMove.MoveParam.PosInfo.ShelfType);
}
else
{
StoreMove.MoveParam.UpdateShelfType(2, Config);
OutStoreLog("出库: 当前未设置ShelfType,默认ShelfType=" + StoreMove.MoveParam.PosInfo.ShelfType);
}
//if (IOManager.IOValue(IO_Type.LeftShelf_Check).Equals(IO_VALUE.LOW))
//{
// StoreMove.MoveParam.UpdateShelfType(1, Config);
// OutStoreLog(" 出库: 当前未设置ShelfType,默认ShelfType=" + StoreMove.MoveParam.PosInfo.ShelfType);
//}
//else
//{
// StoreMove.MoveParam.UpdateShelfType(2, Config);
// OutStoreLog("出库: 当前未设置ShelfType,默认ShelfType=" + StoreMove.MoveParam.PosInfo.ShelfType);
//}
}
//把库位的物品放到取到叉子上之后是出仓完成
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PosInfo.PosId : "";
......@@ -779,6 +784,10 @@ namespace OnlineStore.DeviceLibrary
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
}
}
else
{
OutStoreLog($"出库: 出错,StoreMove.MoveParam.PosInfo.ShelfType=0 ");
}
}else if(StoreMove.MoveStep== StoreMoveStep.SO_12_WaitCanPut)
{
string msg = HttpServer.outIsReady(CID, StoreMove.MoveParam.PosInfo.PosId, StoreMove.MoveParam.PosInfo.ShelfType);
......@@ -817,14 +826,14 @@ namespace OnlineStore.DeviceLibrary
OutStoreLog("出库: 判断物料信号是否正确 ");
if (StoreManager.UseShelfCheck)
{
if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(1))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.HIGH));
}
else
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.HIGH));
}
//if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(1))
//{
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.HIGH));
//}
//else
//{
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.HIGH));
//}
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
}
}
......@@ -860,31 +869,31 @@ namespace OnlineStore.DeviceLibrary
private bool CheckLeft(StoreMoveStep sO_10_WaitNoTray)
{
if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(0))
{
if (IOManager.IOValue(IO_Type.LeftShelf_Check).Equals(IO_VALUE.LOW))
{
//StoreMove.MoveParam.PosInfo.ShelfType = 1;
StoreMove.MoveParam.UpdateShelfType(1, Config);
OutStoreLog(" 出库: 当前未设置ShelfType,默认ShelfType=" + StoreMove.MoveParam.PosInfo.ShelfType);
}
else if (IOManager.IOValue(IO_Type.RightShelf_Check).Equals(IO_VALUE.LOW))
{
//StoreMove.MoveParam.PosInfo.ShelfType = 2;
StoreMove.MoveParam.UpdateShelfType(2, Config);
OutStoreLog("出库: 当前未设置ShelfType,默认ShelfType=" + StoreMove.MoveParam.PosInfo.ShelfType);
}
else
{
StoreMove.NextMoveStep(StoreMoveStep.SO_10_WaitNoTray);
int shelfType = StoreMove.MoveParam.PosInfo.ShelfType;
OutStoreLog("出库: 再次 等待托架无料 [" + shelfType + "] ");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
StoreMove.OneWaitCanEndStep = true;
return false;
}
}
//if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(0))
//{
// if (IOManager.IOValue(IO_Type.LeftShelf_Check).Equals(IO_VALUE.LOW))
// {
// //StoreMove.MoveParam.PosInfo.ShelfType = 1;
// StoreMove.MoveParam.UpdateShelfType(1, Config);
// OutStoreLog(" 出库: 当前未设置ShelfType,默认ShelfType=" + StoreMove.MoveParam.PosInfo.ShelfType);
// }
// else if (IOManager.IOValue(IO_Type.RightShelf_Check).Equals(IO_VALUE.LOW))
// {
// //StoreMove.MoveParam.PosInfo.ShelfType = 2;
// StoreMove.MoveParam.UpdateShelfType(2, Config);
// OutStoreLog("出库: 当前未设置ShelfType,默认ShelfType=" + StoreMove.MoveParam.PosInfo.ShelfType);
// }
// else
// {
// StoreMove.NextMoveStep(StoreMoveStep.SO_10_WaitNoTray);
// int shelfType = StoreMove.MoveParam.PosInfo.ShelfType;
// OutStoreLog("出库: 再次 等待托架无料 [" + shelfType + "] ");
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
// StoreMove.OneWaitCanEndStep = true;
// return false;
// }
//}
return true;
}
......@@ -901,22 +910,22 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(step);
int shelfType = StoreMove.MoveParam.PosInfo.ShelfType;
OutStoreLog("出库:等待托架无料 [" + shelfType + "] ");
if (shelfType.Equals(1))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(300));
}
else if (shelfType.Equals(2))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(300));
}
if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(0))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
StoreMove.OneWaitCanEndStep = true;
}
//if (shelfType.Equals(1))
//{
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
// StoreMove.WaitList.Add(WaitResultInfo.WaitTime(300));
//}
//else if (shelfType.Equals(2))
//{
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
// StoreMove.WaitList.Add(WaitResultInfo.WaitTime(300));
//}
//if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(0))
//{
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
// StoreMove.OneWaitCanEndStep = true;
//}
}
public void AddWaitOutInfo(InOutPosInfo param)
{
......
......@@ -61,26 +61,26 @@ namespace OnlineStore.LoadCSVLibrary
/// DI,右取料口门开关信号,RightDoor_Close,6 0,右取料口门开关信号,X1-7,A7
/// </summary>
public static string RightDoor_Close = "RightDoor_Close";
/// <summary>
/// DI,出料下托架前进(左),LeftShelf_Forward,7 0,出料下托架前进(左),X1-8,A8
/// </summary>
public static string LeftShelf_Forward = "LeftShelf_Forward";
///// <summary>
///// DI,出料下托架前进(左),LeftShelf_Forward,7 0,出料下托架前进(左),X1-8,A8
///// </summary>
//public static string LeftShelf_Forward = "LeftShelf_Forward";
/// <summary>
/// DI,出料下托架后退(左),LeftShelf_Back,8 0,出料下托架后退(左),X2-1,A10
/// </summary>
public static string LeftShelf_Back = "LeftShelf_Back";
///// <summary>
///// DI,出料下托架后退(左),LeftShelf_Back,8 0,出料下托架后退(左),X2-1,A10
///// </summary>
//public static string LeftShelf_Back = "LeftShelf_Back";
/// <summary>
/// DI,出料下托架前进(右),RightShelf_Forward,9 0,出料下托架前进(右),X2-2,A11
/// </summary>
public static string RightShelf_Forward = "RightShelf_Forward";
///// <summary>
///// DI,出料下托架前进(右),RightShelf_Forward,9 0,出料下托架前进(右),X2-2,A11
///// </summary>
//public static string RightShelf_Forward = "RightShelf_Forward";
/// <summary>
///DI,出料下托架后退(右),RightShelf_Back,10 0,出料下托架后退(右),X2-3,A12
/// </summary>
public static string RightShelf_Back = "RightShelf_Back";
///// <summary>
/////DI,出料下托架后退(右),RightShelf_Back,10 0,出料下托架后退(右),X2-3,A12
///// </summary>
//public static string RightShelf_Back = "RightShelf_Back";
/// <summary>
......@@ -92,14 +92,14 @@ namespace OnlineStore.LoadCSVLibrary
/// DI,空气压力检测信号,Airpressure_Check,12 0,空气压力检测信号,X2-5,A14
/// </summary>
public static string Airpressure_Check = "Airpressure_Check";
/// <summary>
/// DI,托架物料检测(左),LeftShelf_Check,13 0,托架物料检测(左),X2-6,A15
/// </summary>
public static string LeftShelf_Check = "LeftShelf_Check";
/// <summary>
/// DI,托架物料检测(右),RightShelf_Check,14 0,托架物料检测(右),X2-7,A16
/// </summary>
public static string RightShelf_Check = "RightShelf_Check";
///// <summary>
///// DI,托架物料检测(左),LeftShelf_Check,13 0,托架物料检测(左),X2-6,A15
///// </summary>
//public static string LeftShelf_Check = "LeftShelf_Check";
///// <summary>
///// DI,托架物料检测(右),RightShelf_Check,14 0,托架物料检测(右),X2-7,A16
///// </summary>
//public static string RightShelf_Check = "RightShelf_Check";
/// <summary>
/// DO,信号灯绿色开机,AutoRun_HddLed,0 ,信号灯绿色开机,Y1-1,B1
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!