Commit 2b76268b LN

流水线启动停止优化

1 个父辈 d55e71af
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
// //
this.lblConInfo.AutoSize = true; this.lblConInfo.AutoSize = true;
this.lblConInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblConInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblConInfo.Location = new System.Drawing.Point(63, 62); this.lblConInfo.Location = new System.Drawing.Point(35, 62);
this.lblConInfo.Name = "lblConInfo"; this.lblConInfo.Name = "lblConInfo";
this.lblConInfo.Size = new System.Drawing.Size(70, 17); this.lblConInfo.Size = new System.Drawing.Size(70, 17);
this.lblConInfo.TabIndex = 0; this.lblConInfo.TabIndex = 0;
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
// //
this.lblRFID.AutoSize = true; this.lblRFID.AutoSize = true;
this.lblRFID.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblRFID.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblRFID.Location = new System.Drawing.Point(321, 62); this.lblRFID.Location = new System.Drawing.Point(282, 62);
this.lblRFID.Name = "lblRFID"; this.lblRFID.Name = "lblRFID";
this.lblRFID.Size = new System.Drawing.Size(71, 17); this.lblRFID.Size = new System.Drawing.Size(71, 17);
this.lblRFID.TabIndex = 1; this.lblRFID.TabIndex = 1;
......
using OnlineStore.DeviceLibrary; using Asa.RFID;
using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -46,8 +47,13 @@ namespace OnlineStore.AssemblyLine ...@@ -46,8 +47,13 @@ namespace OnlineStore.AssemblyLine
List<string> rfidList = new List<string>(DeviceConfig.ProRFIpMap.Values); List<string> rfidList = new List<string>(DeviceConfig.ProRFIpMap.Values);
foreach (string ip in rfidList) foreach (string ip in rfidList)
{ {
string con = RFIDManager.ReadRFID(ip) .NumStr() ; string errorCode = "?";
msg += ("RFID[" + ip + "]:").PadLeft(26, ' ') + con + "\n"; if (RFIDAutoReader.rfidErrorMap.ContainsKey(ip))
{
errorCode = "" + RFIDAutoReader.rfidErrorMap[ip];
}
// string con = RFIDManager.ReadRFID(ip) .NumStr() ;
msg += ("RFID[" + ip + "]:").PadLeft(26, ' ') + "ErrorCode=" + errorCode + "\n";
} }
lblRFID.Text += msg; lblRFID.Text += msg;
......
...@@ -277,7 +277,8 @@ PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,0X0=800 ...@@ -277,7 +277,8 @@ PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,0X0=800
上料机构优化。 上料机构优化。
托盘优化:阻挡下降后,可能等不到check1灭。 托盘优化:阻挡下降后,可能等不到check1灭。
20200309
流水线启动时先转动链条5秒,停止时最后停止流水线,防止托盘停留在rfid读卡器上方。
......
...@@ -253,27 +253,42 @@ namespace OnlineStore.DeviceLibrary ...@@ -253,27 +253,42 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
// ledProcessTimer.Enabled = false; // ledProcessTimer.Enabled = false;
IoCheckTimer.Enabled = false; IoCheckTimer.Enabled = false;
mainTimer.Enabled = false; mainTimer.Enabled = false;
ledProcessTimer.Enabled = true; ledProcessTimer.Enabled = true;
lineStatus = LineStatus.ResetMove; lineStatus = LineStatus.ResetMove;
runStatus = LineRunStatus.HomeMoving; runStatus = LineRunStatus.HomeMoving;
StartTime = DateTime.Now; StartTime = DateTime.Now;
LogUtil.info(Name + "开始启动,启动时间:" + StartTime.ToString()); LogUtil.info(Name + "开始启动,启动时间:" + StartTime.ToString() + "先转动链条");
WriteDrivetMotorRun(IO_VALUE.HIGH);
RFIDManager.Open();
Thread.Sleep(5); Thread.Sleep(5);
// AgvClient.SetCancelState(false);
LineServer.StartServer(ConfigAppSettings.GetIntValue(Setting_Init.TCPServerPort)); LineServer.StartServer(ConfigAppSettings.GetIntValue(Setting_Init.TCPServerPort));
RHomeOp(); RHomeOp();
foreach (EquipBase moveEquip in this.AllEquipMap.Values) foreach (EquipBase moveEquip in this.AllEquipMap.Values)
{ {
//如果已经转动5秒,先停止链条
TimeSpan span = DateTime.Now - StartTime;
if (span.TotalSeconds > 5)
{
LogUtil.info(Name + "链条转动超过5秒,先停止链条转动");
WriteDrivetMotorRun(IO_VALUE.LOW);
}
if (runStatus.Equals(LineRunStatus.Wait))
{
LogUtil.error(Name + "启动过程中发现 runStatus=Wait,中断启动");
return false;
}
EquipStartRun(moveEquip); EquipStartRun(moveEquip);
} }
if (runStatus.Equals(LineRunStatus.Wait))
{ return false; }
RFIDManager.Open();
// WriteDrivetMotorRun(IO_VALUE.LOW);
IoCheckTimer.Enabled = true; IoCheckTimer.Enabled = true;
mainTimer.Enabled = true; mainTimer.Enabled = true;
return true; return true;
...@@ -314,7 +329,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -314,7 +329,6 @@ namespace OnlineStore.DeviceLibrary
} }
TrayManager.ErrorDeviceId = -1; TrayManager.ErrorDeviceId = -1;
WriteDrivetMotorRun(IO_VALUE.LOW);
//横移轨道下降 //横移轨道下降
SideWayStop(); SideWayStop();
...@@ -360,14 +374,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -360,14 +374,21 @@ namespace OnlineStore.DeviceLibrary
lineStatus = LineStatus.ResetMove; lineStatus = LineStatus.ResetMove;
runStatus = LineRunStatus.Reset; runStatus = LineRunStatus.Reset;
WriteDrivetMotorRun(IO_VALUE.LOW);
//重置通用处理 //重置通用处理
RHomeOp(); RHomeOp();
foreach (EquipBase equip in AllEquipMap.Values) foreach (EquipBase equip in AllEquipMap.Values)
{ {
if (runStatus.Equals(LineRunStatus.Wait))
{
LogUtil.error(Name + "复位过程中发现 runStatus=Wait,中断启动");
return false;
}
EquipReset(equip, isNeedAllReset); EquipReset(equip, isNeedAllReset);
} }
if (runStatus.Equals(LineRunStatus.Wait))
{ return false; }
IoCheckTimer.Enabled = true; IoCheckTimer.Enabled = true;
mainTimer.Enabled = true; mainTimer.Enabled = true;
return true; return true;
...@@ -401,13 +422,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -401,13 +422,13 @@ namespace OnlineStore.DeviceLibrary
IoCheckTimer.Enabled = false; IoCheckTimer.Enabled = false;
mainTimer.Enabled = false; mainTimer.Enabled = false;
AgvClient.SetCancelState(true); AgvClient.SetCancelState(true);
WriteDrivetMotorRun(IO_VALUE.LOW);
//停止运行时,把阻挡气缸上升 //停止运行时,把阻挡气缸上升
StopMove(); StopMove();
runStatus = LineRunStatus.Wait; runStatus = LineRunStatus.Wait;
ledProcessTimer.Enabled = false; ledProcessTimer.Enabled = false;
CloseLed(); CloseLed();
WriteDrivetMotorRun(IO_VALUE.LOW);
LineServer.StopServer(); LineServer.StopServer();
RFIDManager.Close(); RFIDManager.Close();
......
using log4net; using log4net;
using OnlineStore.Common;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -14,26 +15,40 @@ namespace Asa.RFID ...@@ -14,26 +15,40 @@ namespace Asa.RFID
private static Dictionary<string, RFIDAuto> rfidMap = new Dictionary<string, RFIDAuto>(); private static Dictionary<string, RFIDAuto> rfidMap = new Dictionary<string, RFIDAuto>();
public static Dictionary<string, int> rfidErrorMap = new Dictionary<string, int>();
/// <summary> /// <summary>
/// 打开所有 /// 打开所有
/// </summary> /// </summary>
/// <param name="ipArr"></param> /// <param name="ipArr"></param>
/// <param name="OnReceive"></param> /// <param name="OnReceive"></param>
/// <param name="ip"></param> /// <param name="ip"></param>
public static void Open(Received_Event OnReceive, params string[] ipArr) public static void Open(Received_Event OnReceive, params string[] ipArr)
{ {
foreach(var ip in ipArr) rfidErrorMap = new Dictionary<string, int>();
foreach (var ip in ipArr)
{ {
int code = 0;
if (rfidMap.ContainsKey(ip)) if (rfidMap.ContainsKey(ip))
{ {
rfidMap[ip].StartAutoScan(OnReceive); code = rfidMap[ip].StartAutoScan(OnReceive);
} }
else else
{ {
RFIDAuto rfid = new RFIDAuto(ip); RFIDAuto rfid = new RFIDAuto(ip);
rfid.StartAutoScan(OnReceive); code = rfid.StartAutoScan(OnReceive);
rfidMap.Add(ip, rfid); rfidMap.Add(ip, rfid);
} }
if (rfidErrorMap.ContainsKey(ip))
{
rfidErrorMap.Remove(ip);
}
rfidErrorMap.Add(ip, code);
if (code.Equals(0).Equals(false))
{
LogUtil.error("连接RFID【" + ip + "】ErrorCode=" + code);
}
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!