Commit 833f1d8e LN

皮带线逻辑优化

1 个父辈 938f54d5
...@@ -656,7 +656,7 @@ ...@@ -656,7 +656,7 @@
this.lblThisSta.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblThisSta.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblThisSta.Location = new System.Drawing.Point(406, 21); this.lblThisSta.Location = new System.Drawing.Point(406, 21);
this.lblThisSta.Name = "lblThisSta"; this.lblThisSta.Name = "lblThisSta";
this.lblThisSta.Size = new System.Drawing.Size(866, 330); this.lblThisSta.Size = new System.Drawing.Size(881, 330);
this.lblThisSta.TabIndex = 246; this.lblThisSta.TabIndex = 246;
this.lblThisSta.Text = "等待启动"; this.lblThisSta.Text = "等待启动";
this.lblThisSta.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblThisSta.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
......
20200610 20200623
入库,料仓与服务器 通信超时改为3秒。入库验证时如果超时重新发送。
入库NG的到达NG口时再调用下取消入库任务。
20200610
BUG:托盘一直显示有料 BUG:托盘一直显示有料
伺服SuddenStop方法调用3次,防止停止失败。 伺服SuddenStop方法调用3次,防止停止失败。
增加四条出料皮带线滚刷功能。 增加四条出料皮带线滚刷功能。
......
...@@ -317,7 +317,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -317,7 +317,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
//皮带线3出口有料,分盘定位装置无料 //皮带线3出口有料,分盘定位装置无料
if (Line3TurnIsStop() && IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.LOW) && StationInfo_NG.TrayValue.Equals(IO_VALUE.HIGH)&& ScanIsEnd()) if (Line3TurnIsStop() && IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.LOW) && StationInfo_NG.TrayValue.Equals(IO_VALUE.HIGH) && ScanIsEnd())
{ {
StartOutStoreMove(new InOutParam()); StartOutStoreMove(new InOutParam());
} }
...@@ -350,6 +350,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -350,6 +350,11 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.DLine_RunAlarm, IO_VALUE.HIGH); IOMove(IO_Type.DLine_RunAlarm, IO_VALUE.HIGH);
} }
if (MoveInfo.MoveType.Equals(LineMoveType.None) && SeparateStopTime < DateTime.Now && IOValue(IO_Type.SeparateDevice_Run).Equals(IO_VALUE.HIGH))
{
IOMove(IO_Type.SeparateDevice_Run, IO_VALUE.LOW);
}
} }
internal bool InStoreNgISBack() internal bool InStoreNgISBack()
{ {
......
...@@ -12,7 +12,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -12,7 +12,7 @@ namespace OnlineStore.DeviceLibrary
partial class DischargeLine partial class DischargeLine
{ {
private int LastWidth = 0; private int LastWidth = 0;
private DateTime SeparateStopTime = DateTime.Now;
protected override bool CheckWaitResult(LineMoveInfo moveInfo, WaitResultInfo wait) protected override bool CheckWaitResult(LineMoveInfo moveInfo, WaitResultInfo wait)
{ {
if (wait.WaitType.Equals(WaitEnum.W301_DLineScanCode)) if (wait.WaitType.Equals(WaitEnum.W301_DLineScanCode))
...@@ -186,9 +186,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -186,9 +186,12 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.SeparateDevice_Run, IO_VALUE.HIGH); IOMove(IO_Type.SeparateDevice_Run, IO_VALUE.HIGH);
if (IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.HIGH))
{ {
SeparateStopTime = DateTime.Now.AddSeconds(3);
int robotIndex = GetRobotIndex(); int robotIndex = GetRobotIndex();
LogUtil.info(hengyiName + MoveInfo.SLog + "送料,接驳台有料,调用arriveRobotLocation=" + robotIndex + "[" + StationInfo_Move.CodeStr + "]"); LogUtil.info(hengyiName + MoveInfo.SLog + "送料,接驳台有料,调用arriveRobotLocation=" + robotIndex + "[" + StationInfo_Move.CodeStr + "]");
SServerManager.arriveRobotLocation(Name, robotIndex, StationInfo_Move.CodeStr); SServerManager.arriveRobotLocation(Name, robotIndex, StationInfo_Move.CodeStr);
MoveEndS();
LogUtil.info(hengyiName + MoveInfo.SLog + "送料结束 ");
} }
else else
{ {
...@@ -197,17 +200,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -197,17 +200,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.TimeOutSeconds = 40; MoveInfo.TimeOutSeconds = 40;
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SeparateDevice_Check, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SeparateDevice_Check, IO_VALUE.HIGH));
} }
//}
//else if (span.TotalSeconds <= 60)
//{
// int robotIndex = GetRobotIndex();
// LogUtil.info(hengyiName + MoveInfo.SLog + "送料,接驳台应有料"+FormUtil.GetSpanStr(span)+",调用arriveRobotLocation=" + robotIndex + "[" + StationInfo_Move.CodeStr + "]");
// SServerManager.arriveRobotLocation(Name, robotIndex, StationInfo_Move.CodeStr);
//}
//else
//{
// LogUtil.info(hengyiName + MoveInfo.SLog + "送料,接驳台无料");
//}
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DON_08_CRun)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.DON_08_CRun))
{ {
......
...@@ -668,7 +668,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -668,7 +668,7 @@ namespace OnlineStore.DeviceLibrary
if (isNeed) if (isNeed)
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_05_WaitTime); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_05_WaitTime);
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 等待一秒钟)"); CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 等待200");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
} }
else else
...@@ -705,8 +705,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -705,8 +705,8 @@ namespace OnlineStore.DeviceLibrary
{ {
if (!LineServer.RightInPosId(DeviceID, SecondMoveInfo.MoveParam.PosId)) if (!LineServer.RightInPosId(DeviceID, SecondMoveInfo.MoveParam.PosId))
{ {
LogUtil.error(Name + " " + SecondMoveInfo.SLog + "[" + SecondMoveInfo.MoveParam.PosId + "]料仓未验证成功,等待3秒"); LogUtil.error(Name + " " + SecondMoveInfo.SLog + "[" + SecondMoveInfo.MoveParam.PosId + "]料仓未验证成功,等待9秒");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(9000));
} }
if (SecondMoveInfo.MoveParam.PlateH >= 30) if (SecondMoveInfo.MoveParam.PlateH >= 30)
{ {
......
...@@ -144,6 +144,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -144,6 +144,15 @@ namespace OnlineStore.DeviceLibrary
if (trayInfo.IsFull && trayInfo.InoutPar.InStoreNg && this.Config.SidesWayNum.Equals(4)) if (trayInfo.IsFull && trayInfo.InoutPar.InStoreNg && this.Config.SidesWayNum.Equals(4))
{ {
outMsg = "入料NG料"; outMsg = "入料NG料";
//如果分配了库位,需要调用取消
if (trayInfo.InoutPar.WareCode != "" && trayInfo.InoutPar.PosId != "")
{
Task.Factory.StartNew(delegate
{
SServerManager.cancelPutInTask(Name, trayInfo.InoutPar.WareCode);
});
}
//入料失败料 //入料失败料
return inoup; return inoup;
} }
...@@ -238,11 +247,34 @@ namespace OnlineStore.DeviceLibrary ...@@ -238,11 +247,34 @@ namespace OnlineStore.DeviceLibrary
//空闲且皮带线出料已结束 //空闲且皮带线出料已结束
if (kongxian && LineNotBusy()) if (kongxian && LineNotBusy())
{ {
//随机分配
Random r = new Random();
int value = r.Next(0, 100000) % 6;
if (lineNum.Equals(1))
{
if ((value.Equals(0) || value.Equals(1)))
{
outMsg = "随意放";
return inoup;
}
}
else if (lineNum.Equals(2))
{
if ((value.Equals(2) || value.Equals(3)))
{
outMsg = "随意放";
return inoup;
}
}
else
{
outMsg = "随意放"; outMsg = "随意放";
return inoup; return inoup;
} }
} }
} }
}
//TODO 判断是否是需要移栽出料的料盘 //TODO 判断是否是需要移栽出料的料盘
return null; return null;
......
...@@ -8,6 +8,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -8,6 +8,10 @@ namespace OnlineStore.DeviceLibrary
public class ACCMDManager public class ACCMDManager
{ {
/// <summary> /// <summary>
/// 0130h 选通输入(STB) 状态 ReadOnly 0: 输入 OFF 1: 输入 ON
/// </summary>
internal static string STB_State = "0130";
/// <summary>
/// 0132h 原点接近传感器输入 (HOME) 状态 ReadOnly 0: 输入 OFF 1: 输入 ON /// 0132h 原点接近传感器输入 (HOME) 状态 ReadOnly 0: 输入 OFF 1: 输入 ON
/// </summary> /// </summary>
public static string Home_Single = "0132"; public static string Home_Single = "0132";
......
...@@ -303,6 +303,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -303,6 +303,24 @@ namespace OnlineStore.DeviceLibrary
public static void OpenAndCloseSTB(string portName, int slvAddr) public static void OpenAndCloseSTB(string portName, int slvAddr)
{ {
if (GetBusyStatus(portName, slvAddr).Equals(1))
{
LogUtil.error("伺服【" + portName + "_" + slvAddr + "】OpenSTB时发现 busy=1,直接返回");
return;
}
System.Threading.Thread.Sleep(SleepMSendons);
if (GetSTBState(portName, slvAddr).Equals(1))
{
LogUtil.error("伺服【" + portName + "_" + slvAddr + "】OpenSTB时发现 STB=ON,先关闭STB");
CloseSTB(portName, slvAddr);
System.Threading.Thread.Sleep(SleepMSendons);
if (GetSTBState(portName, slvAddr).Equals(1))
{
LogUtil.error("伺服【" + portName + "_" + slvAddr + "】OpenSTB时发现 STB=ON,先关闭STB 后发现STB仍为ON,直接返回");
return;
}
}
OnlyOpenSTB(portName, slvAddr); OnlyOpenSTB(portName, slvAddr);
System.Threading.Thread.Sleep(200); System.Threading.Thread.Sleep(200);
CloseSTB(portName, slvAddr); CloseSTB(portName, slvAddr);
...@@ -494,6 +512,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -494,6 +512,19 @@ namespace OnlineStore.DeviceLibrary
return GetCoilData(portName, reviceData, ACCMDManager.Home_Single); return GetCoilData(portName, reviceData, ACCMDManager.Home_Single);
} }
/// <summary> /// <summary>
/// 获取STB信号值,1=On,0=OFF
/// </summary>
/// <param name="portName"></param>
/// <param name="slvAddr"></param>
/// <returns></returns>
public static int GetSTBState(string portName, int slvAddr)
{
PreReadCoilAddr = ACCMDManager.STB_State;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, ACCMDManager.STB_State, "0000", 1);
byte[] reviceData = SendCommand(portName, dataArray, ReviceOutTimeMS, 6);
return GetCoilData(portName, reviceData, ACCMDManager.STB_State);
}
/// <summary>
/// 负极限 /// 负极限
/// </summary> /// </summary>
public static int GetLimitNegativeSingle(string portName, int slvAddr) public static int GetLimitNegativeSingle(string portName, int slvAddr)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!