Commit 6cdc29a9 LN

入库时增加rfid参数

1 个父辈 bf17fbff
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<!--流水线监听端口--> <!--流水线监听端口-->
<add key="TCPServerPort" value="5246" /> <add key="TCPServerPort" value="5246" />
<!--AGV调度服务器地址--> <!--AGV调度服务器地址-->
<add key="AgvServerIp" value="192.168.103.12" /> <add key="AgvServerIp" value="10.80.160.20" />
<!--IO配置--> <!--IO配置-->
<add key ="DIMS" value ="60"/> <add key ="DIMS" value ="60"/>
<add key ="DOMS" value ="300"/> <add key ="DOMS" value ="300"/>
......
...@@ -112,23 +112,8 @@ namespace OnlineStore.AssemblyLine ...@@ -112,23 +112,8 @@ namespace OnlineStore.AssemblyLine
} }
} }
lblMoveInfo.Text = equipBean.GetMoveStr(); lblMoveInfo.Text = equipBean.GetMoveStr();
// string canOut = LineManager.Line.CanOutStore(equipBean.DeviceID) ? "可出库":"不可出库" ;
lblStoreStatus.Text = KTK_Store.GetRunStr(equipBean.lineStatus, equipBean.runStatus); lblStoreStatus.Text = KTK_Store.GetRunStr(equipBean.lineStatus, equipBean.runStatus);
lblThisSta.Text = equipBean.WarnMsg; lblThisSta.Text = equipBean.WarnMsg;
//string text = "";
//List<InOutParam> ps = new List<InOutParam>(equipBean.waitOutStoreList);
//if (ps.Count > 0)
//{
// text = "等待出料列表:\r";
// foreach (InOutParam param in ps)
// {
// text += param.ToStr() + "\r";
// }
//}
//if (!lblInstoreList.Text.Equals(text))
//{
// lblInstoreList.Text = text;
//}
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -250,5 +250,6 @@ namespace OnlineStore.Common ...@@ -250,5 +250,6 @@ namespace OnlineStore.Common
public static string rfidLoc = "rfidLoc"; public static string rfidLoc = "rfidLoc";
public static string barcode = "barcode"; public static string barcode = "barcode";
} }
} }
...@@ -422,7 +422,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -422,7 +422,7 @@ namespace OnlineStore.DeviceLibrary
msg += "LastTP:"+ TrayLine1.LastTrayPosition+" " + TrayLine2.LastTrayPosition + " " + Line3LastTrayP + " " + "\n"; msg += "LastTP:"+ TrayLine1.LastTrayPosition+" " + TrayLine2.LastTrayPosition + " " + Line3LastTrayP + " " + "\n";
msg += "LIsRun:"+ TrayLine1.IsInTurn() + " " + TrayLine2.IsInTurn() + " " +Line3Turn.InTurn + " " +"\n"; msg += "LIsRun:"+ TrayLine1.IsInTurn() + " " + TrayLine2.IsInTurn() + " " +Line3Turn.InTurn + " " +"\n";
msg += "L3CanRun:"+ TrayLine1.Line3CanRun + " " + TrayLine2.Line3CanRun + " " + "\n"; msg += "L3CanRun:"+ TrayLine1.Line3CanRun + " " + TrayLine2.Line3CanRun + " " + "\n";
msg += "LastWidth:" + LastWidth; msg += "LastWidth:" + LastWidth;
return msg; return msg;
} }
public override bool StartInStoreMove(InOutParam param) public override bool StartInStoreMove(InOutParam param)
......
...@@ -702,7 +702,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -702,7 +702,7 @@ namespace OnlineStore.DeviceLibrary
TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.InStore, param, "扫码失败"); TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.InStore, param, "扫码失败");
} }
//从服务器获取库位号 //从服务器获取库位号
string result = SServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth); string result = SServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth,CurrShelfId);
if (!result.Equals("")) if (!result.Equals(""))
{ {
InOutParam param = new InOutParam(currTrayNum, code, "", LastHeight, LastWidth, true); InOutParam param = new InOutParam(currTrayNum, code, "", LastHeight, LastWidth, true);
......
...@@ -195,8 +195,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -195,8 +195,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
public void InitTimer() public void InitTimer()
{ {
ledProcessTimer = new System.Timers.Timer(); ledProcessTimer = new System.Timers.Timer();
ledProcessTimer.Interval = 1000; ledProcessTimer.Interval = 1000;
ledProcessTimer.Elapsed += LedProcess; ledProcessTimer.Elapsed += LedProcess;
...@@ -296,12 +295,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -296,12 +295,9 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
// Task.Factory.StartNew(delegate
//{
bool result = moveEquip.StartRun(); bool result = moveEquip.StartRun();
// });
Thread.Sleep(60); Thread.Sleep(60);
} }
} }
private void RHomeOp() private void RHomeOp()
{ {
...@@ -313,8 +309,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -313,8 +309,7 @@ namespace OnlineStore.DeviceLibrary
isInSuddenDown = false; isInSuddenDown = false;
isNoAirCheck = false; isNoAirCheck = false;
TrayManager.TrayErrorMsg = ""; TrayManager.TrayErrorMsg = "";
SetWarnMsg(""); SetWarnMsg("");
PreIsHasProcess = true;
MoveInfo.NewMove(LineMoveType.Reset); MoveInfo.NewMove(LineMoveType.Reset);
MoveInfo.NextMoveStep(LineMoveStep.Wait); MoveInfo.NextMoveStep(LineMoveStep.Wait);
if (TrayManager.ErrorDeviceId > 0) if (TrayManager.ErrorDeviceId > 0)
...@@ -390,10 +385,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -390,10 +385,8 @@ namespace OnlineStore.DeviceLibrary
{ {
if (isNeedAllReset || TrayManager.ErrorDeviceId.Equals(equip.DeviceID) || (!NoAlarm())) if (isNeedAllReset || TrayManager.ErrorDeviceId.Equals(equip.DeviceID) || (!NoAlarm()))
{ {
LogUtil.info(Name + "收到复位信号," + equip.Name + " 需要复位"); LogUtil.info(Name + "收到复位信号," + equip.Name + " 需要复位");
// Task.Factory.StartNew(delegate { equip.Reset();
equip.Reset();
// });
Thread.Sleep(60); Thread.Sleep(60);
} }
else else
...@@ -451,52 +444,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -451,52 +444,7 @@ namespace OnlineStore.DeviceLibrary
} }
IOMove(IO_Type.Alarm_HddLed, IO_VALUE.HIGH); IOMove(IO_Type.Alarm_HddLed, IO_VALUE.HIGH);
} }
#region 休眠处理
private DateTime LastNoOperateTime = DateTime.Now;
public bool IsSleep = false;
private bool PreIsHasProcess = true;
private bool isHasProcess()
{
if (isInSuddenDown || isNoAirCheck)
{
return true;
}
if (!runStatus.Equals(LineRunStatus.Runing))
{
return true;
}
if (TrayManager.IsHasFullTray())
{
return true;
}
////判断是否有操作
//if (IOValue(IO_Type.InStore_TrayCheck1).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.InStore_TrayCheck2).Equals(IO_VALUE.HIGH))
//{
// return true;
//}
if (MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
return true;
}
if (SW41_MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
return true;
}
if (SW23_MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
return true;
}
foreach (EquipBase move in AllEquipMap.Values)
{
if (!move.IsDebug && (!move.runStatus.Equals(LineRunStatus.Runing)))
{
return true;
}
}
return false;
}
public void WriteDrivetMotorRun(IO_VALUE value) public void WriteDrivetMotorRun(IO_VALUE value)
{ {
...@@ -505,66 +453,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -505,66 +453,14 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.DriveMotor_Run3, value); IOMove(IO_Type.DriveMotor_Run3, value);
IOMove(IO_Type.DriveMotor_Run4, value); IOMove(IO_Type.DriveMotor_Run4, value);
} }
private void UpdateSleep(bool isS)
{
if (isS != IsSleep)
{
if (isS)
{
LogUtil.info(Name + "***********更新为休眠状态");
WriteDrivetMotorRun(IO_VALUE.LOW);
}
else
{
LogUtil.info(Name + "***********更新为工作状态");
WriteDrivetMotorRun(IO_VALUE.HIGH);
}
}
IsSleep = isS;
}
private void SleepProcess()
{
////休眠处理
////判断所有的盘的都是空盘
//bool isHasO = isHasProcess();
//if (!isHasO)
//{
// if (IsSleep)
// {
// return;
// }
// if (PreIsHasProcess.Equals(isHasO))
// {
// //判断时间是否需要休眠
// TimeSpan span = DateTime.Now - LastNoOperateTime;
// if (span.TotalSeconds > Config.Sleep_MSeconds)
// {
// LogUtil.info( Name + "***********已经【" + span.TotalSeconds + "】秒没有操作了,开始进入休眠状态");
// UpdateSleep(true);
// }
// }
// else
// {
// PreIsHasProcess = isHasO;
// LastNoOperateTime = DateTime.Now;
// }
//}
//else
//{
// PreIsHasProcess = isHasO;
// UpdateSleep(false);
//}
}
#endregion
#region 灯光处理 #region 灯光处理
private void LedProcess(object sender, ElapsedEventArgs e) private void LedProcess(object sender, ElapsedEventArgs e)
{ {
try try
{ {
DateTime time = DateTime.Now; DateTime time = DateTime.Now;
SleepProcess();
//黄灯 //黄灯
if ( runStatus.Equals(LineRunStatus.HomeMoving) || runStatus.Equals(LineRunStatus.Reset)) if ( runStatus.Equals(LineRunStatus.HomeMoving) || runStatus.Equals(LineRunStatus.Reset))
...@@ -580,20 +476,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -580,20 +476,20 @@ namespace OnlineStore.DeviceLibrary
} }
} }
//休眠状态黄灯常亮 //休眠状态黄灯常亮
else if (IsSleep) //else if (IsSleep)
{ //{
if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.LOW)) // if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.LOW))
{ // {
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH); // IOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH);
} // }
} //}
else //else
{ //{
if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.HIGH)) if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.HIGH))
{ {
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW); IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
} }
} //}
bool isNeedAlarmLed = false; bool isNeedAlarmLed = false;
bool isInOut = false; bool isInOut = false;
...@@ -654,7 +550,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -654,7 +550,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + "灯处理定时器出错:",ex); LogUtil.error(Name + "灯处理定时器出错:",ex);
} }
Thread.Sleep(5); Thread.Sleep(5);
} }
#endregion #endregion
private void IoCheckTimerProcess(object sender, ElapsedEventArgs e) private void IoCheckTimerProcess(object sender, ElapsedEventArgs e)
...@@ -681,31 +577,32 @@ namespace OnlineStore.DeviceLibrary ...@@ -681,31 +577,32 @@ namespace OnlineStore.DeviceLibrary
IO_VALUE airValue = CheckAir(airCheck, lastAir); IO_VALUE airValue = CheckAir(airCheck, lastAir);
//急停按钮和气压检测按钮需要一起使用 //急停按钮和气压检测按钮需要一起使用
if (suddenBtn .Equals( IO_VALUE.LOW)) if (suddenBtn.Equals(IO_VALUE.LOW))
{ {
Alarm(LineAlarmType.SuddenStop ); SetWarnMsg("收到急停信号,报警急停");
Alarm(LineAlarmType.SuddenStop);
} }
if (fuweiValue.Equals(IO_VALUE.HIGH) && (!fuweiValue.Equals(lastFuwei))) if (fuweiValue.Equals(IO_VALUE.HIGH) && (!fuweiValue.Equals(lastFuwei)))
{ {
if (suddenBtn.Equals(IO_VALUE.LOW)) if (suddenBtn.Equals(IO_VALUE.LOW))
{ {
SetWarnMsg("收到复位信号但急停未开,不处理复位"); SetWarnMsg("收到复位信号但急停未开,不处理复位");
} }
else if (airValue.Equals(IO_VALUE.LOW)) else if (airValue.Equals(IO_VALUE.LOW))
{ {
SetWarnMsg("收到复位信号但未检测到气压信号,不处理复位"); SetWarnMsg("收到复位信号但未检测到气压信号,不处理复位");
} }
else else
{ {
LogUtil.info( Name + "收到复位信号,开始复位!"); LogUtil.info(Name + "收到复位信号,开始复位!");
Reset(); Reset();
} }
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "定时检测报警出错:",ex); LogUtil.error(Name + "定时检测报警出错:", ex);
} }
Thread.Sleep(1); Thread.Sleep(1);
} }
...@@ -884,14 +781,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -884,14 +781,10 @@ namespace OnlineStore.DeviceLibrary
} }
MoveInfo.EndMove(); MoveInfo.EndMove();
WriteDrivetMotorRun(IO_VALUE.LOW); WriteDrivetMotorRun(IO_VALUE.LOW);
//IOMove(IO_Type.NGCylinder_After, IO_VALUE.LOW);
//IOMove(IO_Type.NGCylinder_Before, IO_VALUE.LOW);
IOMove(IO_Type.SW4_MotorRun, IO_VALUE.LOW); IOMove(IO_Type.SW4_MotorRun, IO_VALUE.LOW);
IOMove(IO_Type.SW4_TopCylinder_Down, IO_VALUE.LOW); IOMove(IO_Type.SW4_TopCylinder_Down, IO_VALUE.LOW);
IOMove(IO_Type.SW4_TopCylinder_Up, IO_VALUE.LOW); IOMove(IO_Type.SW4_TopCylinder_Up, IO_VALUE.LOW);
//IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
//IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
SideWayStop(); SideWayStop();
} }
...@@ -966,7 +859,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -966,7 +859,7 @@ namespace OnlineStore.DeviceLibrary
{ {
SetWarnMsg(""); SetWarnMsg("");
} }
PreIsHasProcess = false; // PreIsHasProcess = false;
//打开流水线 //打开流水线
WriteDrivetMotorRun(IO_VALUE.HIGH); WriteDrivetMotorRun(IO_VALUE.HIGH);
//所有原点重置完成 //所有原点重置完成
......
...@@ -175,10 +175,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -175,10 +175,7 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error(checkWaitInfo.Name + " [" + checkWaitInfo.MoveStep + "] CheckWait 出错:",ex); LogUtil.error(checkWaitInfo.Name + " [" + checkWaitInfo.MoveStep + "] CheckWait 出错:",ex);
} }
} }
#endregion #endregion
...@@ -313,19 +310,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -313,19 +310,12 @@ namespace OnlineStore.DeviceLibrary
sw23WaitWatch.Stop(); sw23WaitWatch.Stop();
sw41WaitWatch.Stop(); sw41WaitWatch.Stop();
SW41_MoveInfo.EndMove(); SW41_MoveInfo.EndMove();
SW23_MoveInfo.EndMove(); SW23_MoveInfo.EndMove();
IOMove(IO_Type.SW1_MotorRun, IO_VALUE.LOW); IOMove(IO_Type.SW1_MotorRun, IO_VALUE.LOW);
IOMove(IO_Type.SW2_MotorRun, IO_VALUE.LOW); IOMove(IO_Type.SW2_MotorRun, IO_VALUE.LOW);
IOMove(IO_Type.SW3_MotorRun, IO_VALUE.LOW); IOMove(IO_Type.SW3_MotorRun, IO_VALUE.LOW);
IOMove(IO_Type.SW4_MotorRun, IO_VALUE.LOW); IOMove(IO_Type.SW4_MotorRun, IO_VALUE.LOW);
}
}
//private DateTime SideWay41Ntime = DateTime.Now;
//private bool SideWay41IsWait = false;
//private DateTime SideWay23Ntime = DateTime.Now;
//private bool SideWay23IsWait = false;
private Stopwatch sw41WaitWatch = new Stopwatch(); private Stopwatch sw41WaitWatch = new Stopwatch();
private Stopwatch sw23WaitWatch = new Stopwatch(); private Stopwatch sw23WaitWatch = new Stopwatch();
private bool sdIsInprocess = false; private bool sdIsInprocess = false;
......
...@@ -220,8 +220,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -220,8 +220,8 @@ namespace OnlineStore.DeviceLibrary
{ {
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " ,等待编码信号稳定)"); CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " ,等待编码信号稳定)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_04_Wait); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_04_Wait);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime)); //SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
} }
else else
{ {
......
...@@ -150,9 +150,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -150,9 +150,9 @@ namespace OnlineStore.DeviceLibrary
public class RFIDData public class RFIDData
{ {
/// <summary> /// <summary>
/// RFID类型,区分是料架还是托盘,托盘E=69,A=65 /// RFID类型,区分是料架还是托盘,托盘E=69,包装料料架A=65,料串=B
/// </summary> /// </summary>
public int RFType = 0; public char RFType = 'E';
/// <summary> /// <summary>
/// 托盘编号,从1-32 /// 托盘编号,从1-32
/// </summary> /// </summary>
...@@ -160,7 +160,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -160,7 +160,7 @@ namespace OnlineStore.DeviceLibrary
public RFIDData(int num, int t) public RFIDData(int num, int t)
{ {
this.RFType = t; this.RFType = (char)t;
this.Num = num; this.Num = num;
} }
...@@ -170,8 +170,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -170,8 +170,8 @@ namespace OnlineStore.DeviceLibrary
{ {
if (data != null && data.Length > 2) if (data != null && data.Length > 2)
{ {
RFType = data[1]; RFType = (char)data[1];
Num = Convert.ToInt32(data[2]); Num = (int)(data[2]);
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -185,8 +185,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -185,8 +185,7 @@ namespace OnlineStore.DeviceLibrary
} }
public string NumStr() public string NumStr()
{ {
return "" + (char)RFType + "" + ((int)Num).ToString().PadLeft(2, '0'); return "" + RFType + "" + Num.ToString().PadLeft(2, '0') + "";
//return " [" + RFType + "],[" + Num + "] "; }
}
} }
} }
...@@ -47,7 +47,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -47,7 +47,7 @@ namespace OnlineStore.DeviceLibrary
} }
//## //##
private static string spiltStr = "##"; private static string spiltStr = "##";
public static string CodeReceived(string deviceName, int trayNum, List<string> codeList, int height, int width) public static string CodeReceived(string deviceName, int trayNum, List<string> codeList, int height, int width,string rfid)
{ {
string msg = ""; string msg = "";
try try
...@@ -75,10 +75,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -75,10 +75,11 @@ namespace OnlineStore.DeviceLibrary
Dictionary<string, string> paramMap = new Dictionary<string, string>(); Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("cids", LineServer.GetAllCID()); paramMap.Add("cids", LineServer.GetAllCID());
paramMap.Add("code", codeStr); paramMap.Add("code", codeStr);
paramMap.Add(ParamDefine.rfid, rfid);
string server = GetAddr(Addr_PosForPutin, paramMap); string server = GetAddr(Addr_PosForPutin, paramMap);
//string server = GetAddr(Addr_PosForPutin) + "?cids=" + LineServer.GetAllCID() + "&code=%3D" + codeStr; //string server = GetAddr(Addr_PosForPutin) + "?cids=" + LineServer.GetAllCID() + "&code=%3D" + codeStr;
LogUtil.info(deviceName + "托盘【" + trayNum + "】 条码<< " + codeStr + ",获取入库PosID:"); LogUtil.info(deviceName + "托盘【" + trayNum + "】 条码【 " + codeStr + "】料串【"+rfid+"】,获取入库库位:");
string resultStr = HttpHelper.Post(server, ""); string resultStr = HttpHelper.Post(server, "");
LogUtil.info("CodeReceived 【" + server + "】【" + resultStr + "】"); LogUtil.info("CodeReceived 【" + server + "】【" + resultStr + "】");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!