Commit 71c6157f LN

超时时间单位改为秒

1 个父辈 67deef22
...@@ -43,7 +43,7 @@ namespace OnlineStore.AssemblyLine ...@@ -43,7 +43,7 @@ namespace OnlineStore.AssemblyLine
List<string> rfidList = new List<string>(LineManager.Line. rfidList); List<string> rfidList = new List<string>(LineManager.Line. rfidList);
foreach (string ip in rfidList) foreach (string ip in rfidList)
{ {
string con = RFIDManager.ReadRFID(ip) .ToStr() ; string con = RFIDManager.ReadRFID(ip) .NumStr() ;
msg += ("RFID[" + ip + "]:").PadLeft(26, ' ') + con + "\n"; msg += ("RFID[" + ip + "]:").PadLeft(26, ' ') + con + "\n";
} }
lblRFID.Text += msg; lblRFID.Text += msg;
......
...@@ -73,7 +73,7 @@ namespace OnlineStore.AssemblyLine ...@@ -73,7 +73,7 @@ namespace OnlineStore.AssemblyLine
string resul = ""; string resul = "";
if (data != null) if (data != null)
{ {
resul = data.ToStr(); resul = data.NumStr();
numNum.Value = data.Num; numNum.Value = data.Num;
int selIndex = data.RFType - 64; int selIndex = data.RFType - 64;
if (selIndex >= 0 && selIndex <= comboxType.Items.Count) if (selIndex >= 0 && selIndex <= comboxType.Items.Count)
...@@ -105,7 +105,7 @@ namespace OnlineStore.AssemblyLine ...@@ -105,7 +105,7 @@ namespace OnlineStore.AssemblyLine
string resul = ""; string resul = "";
if (data != null) if (data != null)
{ {
resul = data.ToStr(); resul = data.NumStr();
numNum.Value = data.Num; numNum.Value = data.Num;
int selIndex = data.RFType - 64; int selIndex = data.RFType - 64;
if (selIndex >= 0 && selIndex <= comboxType.Items.Count) if (selIndex >= 0 && selIndex <= comboxType.Items.Count)
......
...@@ -66,7 +66,7 @@ PRO,0,入料流水线3-上料模块-RFID-IP,PRO_RFIP_103-1,192.168.210.115,,,,, ...@@ -66,7 +66,7 @@ PRO,0,入料流水线3-上料模块-RFID-IP,PRO_RFIP_103-1,192.168.210.115,,,,,
,,,,,,,,, ,,,,,,,,,
PRO,0,当多久没操作时流水线休眠(秒),Sleep_MSeconds,600,,,,, PRO,0,当多久没操作时流水线休眠(秒),Sleep_MSeconds,600,,,,,
PRO,0,气压检测信号关闭需要持续的时间,AirCheckSeconds,600,,,,, PRO,0,气压检测信号关闭需要持续的时间,AirCheckSeconds,600,,,,,
PRO,0,IO信号超时时间(毫秒),IOSingle_TimerOut,15000,,,,, PRO,0,IO信号超时时间(秒),IOSingle_TimerOut,15,,,,,
PRO,0,IO模块对应的DI数量,IO_DILength,192.168.101.33#8;192.168.101.35#8;192.168.101.37#8;192.168.101.39#8;192.168.101.41#8;,,,,, PRO,0,IO模块对应的DI数量,IO_DILength,192.168.101.33#8;192.168.101.35#8;192.168.101.37#8;192.168.101.39#8;192.168.101.41#8;,,,,,
PRO,0,模块对应的DO数量,IO_DOLength,192.168.101.33#8;192.168.101.35#8;192.168.101.37#8;192.168.101.39#8;192.168.101.41#8;,,,,, PRO,0,模块对应的DO数量,IO_DOLength,192.168.101.33#8;192.168.101.35#8;192.168.101.37#8;192.168.101.39#8;192.168.101.41#8;,,,,,
,,,,,,,,, ,,,,,,,,,
......
...@@ -184,7 +184,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -184,7 +184,7 @@ namespace OnlineStore.DeviceLibrary
Line3LastTrayP++; Line3LastTrayP++;
LogInfo(hengyiName + "出口有料,等待料盘到达分盘装置位置"); LogInfo(hengyiName + "出口有料,等待料盘到达分盘装置位置");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Location_Check3, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SeparateDevice_Check, IO_VALUE.HIGH));
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_06_Wait_SeparateDevice_Check)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_06_Wait_SeparateDevice_Check))
{ {
......
...@@ -251,7 +251,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -251,7 +251,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return true; return true;
} }
else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalMilliseconds < LineManager.Config.IOSingle_TimerOut * 2) else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2)
{ {
preRWTime = DateTime.Now; preRWTime = DateTime.Now;
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH); IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
...@@ -271,7 +271,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -271,7 +271,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return true; return true;
} }
else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalMilliseconds < LineManager.Config.IOSingle_TimerOut * 2) else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2)
{ {
IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.HIGH); IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.HIGH);
IOMove(IO_Type.FL_StopCylinder_Down2, IO_VALUE.HIGH); IOMove(IO_Type.FL_StopCylinder_Down2, IO_VALUE.HIGH);
...@@ -423,14 +423,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -423,14 +423,14 @@ namespace OnlineStore.DeviceLibrary
{ {
TimeSpan rwSpan = DateTime.Now - preRWTime; TimeSpan rwSpan = DateTime.Now - preRWTime;
//一分钟还未检测到 //一分钟还未检测到
if (span.TotalMilliseconds > LineManager.Config.IOSingle_TimerOut && NoAlarm()) if (span.TotalSeconds > LineManager.Config.IOSingle_TimerOut && NoAlarm())
{ {
ConfigIO io = baseConfig.getWaitIO(wait.IoType); ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = Name + "等待" + NotOkMsg + " 超时"; WarnMsg = Name + "等待" + NotOkMsg + " 超时";
Alarm(LineAlarmType.IoSingleTimeOut); Alarm(LineAlarmType.IoSingleTimeOut);
LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID + 13); LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID + 13);
} }
else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalMilliseconds < LineManager.Config.IOSingle_TimerOut * 2) else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2)
{ {
preRWTime = DateTime.Now; preRWTime = DateTime.Now;
string msg = moveInfo.Name + " " + NotOkMsg + "已等待 " + Math.Abs(span.TotalSeconds) + "秒,重写DO:"; string msg = moveInfo.Name + " " + NotOkMsg + "已等待 " + Math.Abs(span.TotalSeconds) + "秒,重写DO:";
......
...@@ -704,21 +704,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -704,21 +704,23 @@ namespace OnlineStore.DeviceLibrary
try try
{ {
//判断料架的编码是否正确 //判断料架的编码是否正确
byte[] data = null; RFIDData rfidD = RFIDManager.GetShelfId(DeviceID);
CurrShelfId = RFIDManager.GetShelfId(DeviceID, out data); CurrShelfId = rfidD.NumStr();
if (CurrShelfId.Equals("")) byte[] data = rfidD.ToData();
{ //if (CurrShelfId.Equals(""))
//MoveInfo.EndMove(); //{
//runStatus = LineRunStatus.Runing; // //MoveInfo.EndMove();
LogUtil.info(" 定位工位料架检测到料架,获取料架号失败"); // //runStatus = LineRunStatus.Runing;
return false; // LogUtil.info(" 定位工位料架检测到料架,获取料架号失败");
} // return false;
//}
//发送料架信息给调度系统 //发送料架信息给调度系统
AgvClient.SendRFID(Config.AgvInName, data); AgvClient.SendRFID(Config.AgvInName, data);
LogUtil.info(Name + "定位工位料架编号:" + CurrShelfId); LogUtil.info(Name + "定位工位料架编号:" + CurrShelfId);
}catch(Exception ex) }
catch (Exception ex)
{ {
LogUtil.error(Name+ "UpdateShelfId出错:"+ex.ToString()); LogUtil.error(Name + "UpdateShelfId出错:" + ex.ToString());
} }
return true; return true;
} }
......
...@@ -170,6 +170,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -170,6 +170,7 @@ namespace OnlineStore.DeviceLibrary
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
LogUtil.info(Name + "开始连接IO模块 ");
IOManager.instance.ConnectionIOList(cioList); IOManager.instance.ConnectionIOList(cioList);
//Thread.Sleep(5); //Thread.Sleep(5);
//Task.Factory.StartNew(delegate //Task.Factory.StartNew(delegate
...@@ -915,7 +916,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -915,7 +916,7 @@ namespace OnlineStore.DeviceLibrary
SetWarnMsg(moveEquip.Name + "下降阻挡气缸超时,已等待" + FormUtil.GetSpanStr(span)); SetWarnMsg(moveEquip.Name + "下降阻挡气缸超时,已等待" + FormUtil.GetSpanStr(span));
LogUtil.error(moveEquip.Name + "下降阻挡气缸超时,已等待" + FormUtil.GetSpanStr(span), 112); LogUtil.error(moveEquip.Name + "下降阻挡气缸超时,已等待" + FormUtil.GetSpanStr(span), 112);
} }
else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalMilliseconds < LineManager.Config.IOSingle_TimerOut * 2) else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2)
{ {
preRWTime = DateTime.Now; preRWTime = DateTime.Now;
LogUtil.error(Name + "复位中:等待" + msg + "已【" + FormUtil.GetSpanStr(span) + "】重新调用OpenStopCylinder方法"); LogUtil.error(Name + "复位中:等待" + msg + "已【" + FormUtil.GetSpanStr(span) + "】重新调用OpenStopCylinder方法");
......
...@@ -182,7 +182,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -182,7 +182,7 @@ namespace OnlineStore.DeviceLibrary
{ {
TimeSpan rwSpan = DateTime.Now - preRWTime; TimeSpan rwSpan = DateTime.Now - preRWTime;
//一分钟还未检测到 //一分钟还未检测到
if (span.TotalMilliseconds > LineManager.Config.IOSingle_TimerOut && NoAlarm()) if (span.TotalSeconds > LineManager.Config.IOSingle_TimerOut && NoAlarm())
{ {
ConfigIO io = baseConfig.getWaitIO(wait.IoType); ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = Name + "等待" + NotOkMsg + " 超时"; WarnMsg = Name + "等待" + NotOkMsg + " 超时";
...@@ -190,7 +190,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -190,7 +190,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID + 13); LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID + 13);
} }
//超过报警时长 //超过报警时长
else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalMilliseconds < LineManager.Config.IOSingle_TimerOut * 2) else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2)
{ {
preRWTime = DateTime.Now; preRWTime = DateTime.Now;
string msg = checkWaitInfo.Name + " " + NotOkMsg + "已等待 " + Math.Abs(span.TotalSeconds) + "秒,重写DO:"; string msg = checkWaitInfo.Name + " " + NotOkMsg + "已等待 " + Math.Abs(span.TotalSeconds) + "秒,重写DO:";
...@@ -257,8 +257,31 @@ namespace OnlineStore.DeviceLibrary ...@@ -257,8 +257,31 @@ namespace OnlineStore.DeviceLibrary
} }
} }
/// <summary>
/// 判断指定的皮带线是否可用
/// </summary>
/// <param name="lineNum"></param>
/// <returns></returns>
internal bool ProvidingCanUse(List<int> lineList)
{
//有一条线可用就返回true
foreach (int lineNum in lineList)
{
int deviceN = 200 + lineNum;
if (ProvidingEquipMap.ContainsKey(deviceN))
{
ProvidingEquip pro = ProvidingEquipMap[deviceN];
if (pro.runStatus >= LineRunStatus.HomeMoving && pro.isInSuddenDown.Equals(false) && pro.isNoAirCheck.Equals(false))
{
return true;
}
}
}
return false;
}
#endregion #endregion
#region 出库 #region 出库
......
...@@ -343,12 +343,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -343,12 +343,14 @@ namespace OnlineStore.DeviceLibrary
InTurn = false; InTurn = false;
} }
} }
private int canWhileCount = 3;
public void StartLineRun(string moveDO, string checkDI, TurnEndDel endProcess, int timeOutMS = 30000) public void StartLineRun(string moveDO, string checkDI, TurnEndDel endProcess, int timeOutMS = 30000)
{ {
InTurn = true; InTurn = true;
this.turnEnd = endProcess; this.turnEnd = endProcess;
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
canWhileCount = 3;
LineRunAndWait(moveDO, checkDI, timeOutMS); LineRunAndWait(moveDO, checkDI, timeOutMS);
}); });
} }
...@@ -357,7 +359,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -357,7 +359,7 @@ namespace OnlineStore.DeviceLibrary
{ {
LastMoveDO = moveDO; LastMoveDO = moveDO;
LastCheckDI = checkDI; LastCheckDI = checkDI;
LogUtil.debug("开始转动:" + moveDO+",等待信号:"+checkDI+""); LogUtil.debug(subType+ "开始转动:" + moveDO+",等待信号:"+checkDI+"");
IOManager.IOMove(moveDO, IO_VALUE.HIGH, subType); IOManager.IOMove(moveDO, IO_VALUE.HIGH, subType);
InTurn = true; InTurn = true;
DateTime startTime = DateTime.Now; DateTime startTime = DateTime.Now;
...@@ -387,12 +389,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -387,12 +389,12 @@ namespace OnlineStore.DeviceLibrary
{ {
if (result.Equals("")) if (result.Equals(""))
{ {
LogUtil.debug("验证" + checkDI + "=Low结束:" + result); LogUtil.debug(subType + "验证" + checkDI + "=Low结束:" + result);
} }
else else
{ {
LogUtil.info("[" + moveDO + "] [" + checkDI + "] 验证" + checkDI + "=Low结束:" + result); LogUtil.info(subType + "[" + moveDO + "] [" + checkDI + "] 验证" + checkDI + "=Low结束:" + result);
} }
break; break;
} }
...@@ -416,17 +418,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -416,17 +418,23 @@ namespace OnlineStore.DeviceLibrary
//判断Buzy及位置是否结束 //判断Buzy及位置是否结束
else if (IOManager.IOValue(checkDI, subType).Equals(IO_VALUE.HIGH)) else if (IOManager.IOValue(checkDI, subType).Equals(IO_VALUE.HIGH))
{ {
if (canWhileCount > 0 && span.TotalMilliseconds < 500)
{
canWhileCount--;
LogUtil.info(subType + " 异常停止,重新开始转动:[" + moveDO + "] [" + checkDI + "] 耗时 [" + FormUtil.GetSpanStr(span) + "]["+canWhileCount+"]");
LineRunAndWait(moveDO, checkDI, timeOutMS);
}
isStop = true; isStop = true;
} }
if (isStop) if (isStop)
{ {
if (result.Equals("")) if (result.Equals(""))
{ {
LogUtil.debug("停止运动:" + result + " " + moveDO); LogUtil.info(subType + "停止运动:[" + moveDO + "] [" + checkDI + "] 耗时 ["+FormUtil.GetSpanStr(span)+ "][" + canWhileCount + "]");
} }
else else
{ {
LogUtil.info("[" + moveDO + "] [" + checkDI + "] 停止运动:" + result + " " + moveDO); LogUtil.info(subType + "[" + moveDO + "] [" + checkDI + "] 停止运动:" + result + " " + moveDO);
} }
LastEndTime = DateTime.Now; LastEndTime = DateTime.Now;
IOManager.IOMove(moveDO, IO_VALUE.LOW, subType); IOManager.IOMove(moveDO, IO_VALUE.LOW, subType);
......
...@@ -80,8 +80,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -80,8 +80,9 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down); CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
} }
} }
private InOutParam CheckIsNeedOutStore() private InOutParam CheckIsNeedOutStore( )
{ {
int lineNum = DeviceID % 100;
TrayInfo trayInfo = TrayManager.GetTrayInfo(currTrayNum); TrayInfo trayInfo = TrayManager.GetTrayInfo(currTrayNum);
if (!trayInfo.IsFull) if (!trayInfo.IsFull)
{ {
...@@ -90,13 +91,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -90,13 +91,15 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span = DateTime.Now - trayInfo.LastUpdateTime; TimeSpan span = DateTime.Now - trayInfo.LastUpdateTime;
int youxianS = 180; int youxianS = 180;
InOutParam inoup = trayInfo.InoutPar; InOutParam inoup = trayInfo.InoutPar;
//入料失败料
if (trayInfo.IsFull && trayInfo.InoutPar.InStoreNg && this.Config.SidesWayNum.Equals(4)) if (trayInfo.IsFull && trayInfo.InoutPar.InStoreNg && this.Config.SidesWayNum.Equals(4))
{ {
//入料失败料
return inoup; return inoup;
} }
else if (trayInfo.InOrOutStore.Equals(ReelType.OutStore) && inoup.urgentReel.Equals(false) && inoup.cutReel.Equals(false)) else if (trayInfo.InOrOutStore.Equals(ReelType.OutStore) && inoup.urgentReel.Equals(false) && inoup.cutReel.Equals(false))
{ {
List<int> mustLine = new List<int> ();
List<int> firstLine = new List<int> ();
//urgentReel: true 表示紧急料,需要出到料串上 //urgentReel: true 表示紧急料,需要出到料串上
//cutReel: true 表示分盘料,需要出到料串上 //cutReel: true 表示分盘料,需要出到料串上
//smallReel: true 小料(7x8),放置到小料架上 //smallReel: true 小料(7x8),放置到小料架上
...@@ -104,69 +107,70 @@ namespace OnlineStore.DeviceLibrary ...@@ -104,69 +107,70 @@ namespace OnlineStore.DeviceLibrary
//rfidLoc: //rfidLoc:
//是否是小盘 //是否是小盘
if (inoup.smallReel) if (inoup.smallReel)
{ {
if (inoup.rfidLoc >= 70 && inoup.rfidLoc <= 72) if (inoup.rfidLoc >= 70 && inoup.rfidLoc <= 72)
{ {
// 70,71,72时只能分配到3 / 4号皮带线; // 70,71,72时只能分配到3 / 4号皮带线;
if (DeviceID.Equals(203) || DeviceID.Equals(204)) mustLine = new List<int> { 3,4};
{ }
return inoup;
}
}
else if (span.TotalSeconds > youxianS || inoup.rfidLoc.Equals(-1))
{
//,值为 - 1时,可以自由分配皮带线,,超过指定时间后随机分配
if (MoveInfo.MoveType.Equals(LineMoveType.None))
{
return inoup;
}
}
else if (inoup.rfidLoc <= 46) else if (inoup.rfidLoc <= 46)
{ {
// 小料时,架位为1 - 46优先走1 / 2号皮带线 // 小料时,架位为1 - 46优先走1 / 2号皮带线
if (DeviceID.Equals(201) || DeviceID.Equals(202)) firstLine = new List<int> { 1, 2 };
{
return inoup;
}
} }
else if (inoup.rfidLoc >= 47) else if (inoup.rfidLoc >= 47)
{ {
// ,47 - 92优先走3 / 4号皮带线, // ,47 - 92优先走3 / 4号皮带线,
if (DeviceID.Equals(203) || DeviceID.Equals(204)) firstLine = new List<int> { 3, 4 };
{
return inoup;
}
} }
} }
else else
{ {
// 料架的架位大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3 / 4号皮带线 //大料12号只能走1号2后皮带线
if (span.TotalSeconds > youxianS || inoup.rfidLoc.Equals(-1)) // 料架的架位大料时,架位1 - 6,12号优先走1 / 2号皮带线,
//7 - 11优先走3 / 4号皮带线
if (inoup.Equals(12))
{ {
//,值为 - 1时,可以自由分配皮带线, // 大料12号只能走1号2后皮带线
if (MoveInfo.MoveType.Equals(LineMoveType.None)) mustLine = new List<int> { 1, 2 };
{
return inoup;
}
} }
else if (inoup.rfidLoc <= 6) else if (inoup.rfidLoc <= 6)
{ {
if (DeviceID.Equals(201) || DeviceID.Equals(202)) firstLine = new List<int> { 1, 2 };
{
return inoup;
}
} }
else if (inoup.rfidLoc >= 7) else if (inoup.rfidLoc >= 7)
{ {
if (DeviceID.Equals(203) || DeviceID.Equals(204)) firstLine = new List<int> { 3, 4 };
{ }
return inoup; }
}
if (mustLine.Count > 0)
{
if (mustLine.Contains(lineNum))
{
return inoup;
}
}else if (firstLine.Count > 0)
{
if (firstLine.Contains(lineNum))
{
return inoup;
}else if (LineManager.Line.ProvidingCanUse(firstLine).Equals(false))
{
//优先线不可用
return inoup;
}else if(span.TotalSeconds > youxianS)
{
//超过指定的时间
return inoup;
} }
} }
else
{
return inoup;
}
} }
//TODO 判断是否是需要移栽出料的料盘 //TODO 判断是否是需要移栽出料的料盘
return null; return null;
} }
...@@ -231,8 +235,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -231,8 +235,8 @@ namespace OnlineStore.DeviceLibrary
{ {
TrayManager.UpdateTrayNumError(-1, ""); TrayManager.UpdateTrayNumError(-1, "");
} }
//出料中,需要拦盘 //出料中,需要拦盘
InOutParam param = CheckIsNeedOutStore(); InOutParam param = CheckIsNeedOutStore( );
if(param != null) if(param != null)
{ {
SecondMoveInfo.MoveParam = param; SecondMoveInfo.MoveParam = param;
......
...@@ -63,30 +63,31 @@ namespace OnlineStore.DeviceLibrary ...@@ -63,30 +63,31 @@ namespace OnlineStore.DeviceLibrary
} }
else if (data.RFType > 0) else if (data.RFType > 0)
{ {
LogUtil.error("RFID [ " + ip + " ] 读到数据 " + data.ToStr() + " 返回盘号 0"); LogUtil.error("RFID [ " + ip + " ] 读到数据 " + data.NumStr() + " 返回盘号 0");
} }
else else
{ {
LogUtil.debug("RFID [ " + ip + " ] 读到数据 " + data.ToStr() + " 返回盘号 0"); LogUtil.debug("RFID [ " + ip + " ] 读到数据 " + data.NumStr() + " 返回盘号 0");
} }
return 0; return 0;
} }
return 0; return 0;
} }
public static string GetShelfId(int subType,out byte[] bytedata) public static RFIDData GetShelfId(int subType )
{ {
string ip = GetRFIP(subType, 1); string ip = GetRFIP(subType, 1);
RFIDData data= ReadRFID(ip); RFIDData data= ReadRFID(ip,true);
bytedata = data.ToData(); //此处料串为B料架
if (data.RFType.Equals('B')) //bytedata = data.ToData();
{ //if (data.RFType.Equals('B'))
return data.RFType.ToString() + "" + data.Num.ToString().PadLeft(2, '0'); //{
}else if (data.Num > 0) // return data.RFType.ToString() + "" + data.Num.ToString().PadLeft(2, '0');
{ //}else if (data.Num > 0)
LogUtil.error("RFID [ " + ip + " ] 读到数据 " + data.ToStr() + " 返回料架号为空"); //{
} // LogUtil.error("RFID [ " + ip + " ] 读到数据 " + data.ToStr() + " 返回料架号为空");
return ""; //}
return data;
} }
public static RFIDData ReadRFID(string ip, bool isClear = false) public static RFIDData ReadRFID(string ip, bool isClear = false)
...@@ -109,11 +110,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -109,11 +110,7 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error("RFID [ " + ip + " ] 读到数据=null"); LogUtil.error("RFID [ " + ip + " ] 读到数据=null");
} }
RFIDData data = new RFIDData(bdata); RFIDData data = new RFIDData(bdata);
//if (isClear)
//{
// RFIDReader.Clear(ip);
//}
return data; return data;
} }
} }
...@@ -186,7 +183,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -186,7 +183,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return new byte[] { (byte)RFType, (byte)Num }; return new byte[] { (byte)RFType, (byte)Num };
} }
public string ToStr() public string NumStr()
{ {
return "" + RFType + "" + ((int)Num).ToString().PadLeft(2, '0'); return "" + RFType + "" + ((int)Num).ToString().PadLeft(2, '0');
//return " [" + RFType + "],[" + Num + "] "; //return " [" + RFType + "],[" + Num + "] ";
......
...@@ -50,7 +50,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -50,7 +50,7 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary> /// <summary>
/// PRO IO信号超时时间(秒) IOSingle_TimerOut 5000 /// PRO IO信号超时时间(秒) IOSingle_TimerOut 5000
/// </summary> /// </summary>
[ConfigProAttribute("IOSingle_TimerOut",false)] [ConfigProAttribute("IOSingle_TimerOut",false)]
public int IOSingle_TimerOut { get; set; } public int IOSingle_TimerOut { get; set; }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!