Commit 2b76268b LN

流水线启动停止优化

1 个父辈 d55e71af
......@@ -47,7 +47,7 @@
//
this.lblConInfo.AutoSize = true;
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.Size = new System.Drawing.Size(70, 17);
this.lblConInfo.TabIndex = 0;
......@@ -57,7 +57,7 @@
//
this.lblRFID.AutoSize = true;
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.Size = new System.Drawing.Size(71, 17);
this.lblRFID.TabIndex = 1;
......
using OnlineStore.DeviceLibrary;
using Asa.RFID;
using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
......@@ -46,8 +47,13 @@ namespace OnlineStore.AssemblyLine
List<string> rfidList = new List<string>(DeviceConfig.ProRFIpMap.Values);
foreach (string ip in rfidList)
{
string con = RFIDManager.ReadRFID(ip) .NumStr() ;
msg += ("RFID[" + ip + "]:").PadLeft(26, ' ') + con + "\n";
string errorCode = "?";
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;
......
......@@ -277,7 +277,8 @@ PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,0X0=800
上料机构优化。
托盘优化:阻挡下降后,可能等不到check1灭。
20200309
流水线启动时先转动链条5秒,停止时最后停止流水线,防止托盘停留在rfid读卡器上方。
......
......@@ -253,27 +253,42 @@ namespace OnlineStore.DeviceLibrary
}
else
{
// ledProcessTimer.Enabled = false;
// ledProcessTimer.Enabled = false;
IoCheckTimer.Enabled = false;
mainTimer.Enabled = false;
ledProcessTimer.Enabled = true;
lineStatus = LineStatus.ResetMove;
runStatus = LineRunStatus.HomeMoving;
StartTime = DateTime.Now;
LogUtil.info(Name + "开始启动,启动时间:" + StartTime.ToString());
LogUtil.info(Name + "开始启动,启动时间:" + StartTime.ToString() + "先转动链条");
WriteDrivetMotorRun(IO_VALUE.HIGH);
RFIDManager.Open();
Thread.Sleep(5);
// AgvClient.SetCancelState(false);
LineServer.StartServer(ConfigAppSettings.GetIntValue(Setting_Init.TCPServerPort));
RHomeOp();
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);
}
if (runStatus.Equals(LineRunStatus.Wait))
{ return false; }
RFIDManager.Open();
// WriteDrivetMotorRun(IO_VALUE.LOW);
IoCheckTimer.Enabled = true;
mainTimer.Enabled = true;
return true;
......@@ -314,7 +329,6 @@ namespace OnlineStore.DeviceLibrary
}
TrayManager.ErrorDeviceId = -1;
WriteDrivetMotorRun(IO_VALUE.LOW);
//横移轨道下降
SideWayStop();
......@@ -360,14 +374,21 @@ namespace OnlineStore.DeviceLibrary
lineStatus = LineStatus.ResetMove;
runStatus = LineRunStatus.Reset;
WriteDrivetMotorRun(IO_VALUE.LOW);
//重置通用处理
RHomeOp();
foreach (EquipBase equip in AllEquipMap.Values)
{
if (runStatus.Equals(LineRunStatus.Wait))
{
LogUtil.error(Name + "复位过程中发现 runStatus=Wait,中断启动");
return false;
}
EquipReset(equip, isNeedAllReset);
}
if (runStatus.Equals(LineRunStatus.Wait))
{ return false; }
IoCheckTimer.Enabled = true;
mainTimer.Enabled = true;
return true;
......@@ -401,13 +422,13 @@ namespace OnlineStore.DeviceLibrary
IoCheckTimer.Enabled = false;
mainTimer.Enabled = false;
AgvClient.SetCancelState(true);
WriteDrivetMotorRun(IO_VALUE.LOW);
//停止运行时,把阻挡气缸上升
StopMove();
runStatus = LineRunStatus.Wait;
ledProcessTimer.Enabled = false;
CloseLed();
WriteDrivetMotorRun(IO_VALUE.LOW);
LineServer.StopServer();
RFIDManager.Close();
......
using log4net;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -14,26 +15,40 @@ namespace Asa.RFID
private static Dictionary<string, RFIDAuto> rfidMap = new Dictionary<string, RFIDAuto>();
public static Dictionary<string, int> rfidErrorMap = new Dictionary<string, int>();
/// <summary>
/// 打开所有
/// </summary>
/// <param name="ipArr"></param>
/// <param name="OnReceive"></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))
{
rfidMap[ip].StartAutoScan(OnReceive);
code = rfidMap[ip].StartAutoScan(OnReceive);
}
else
{
RFIDAuto rfid = new RFIDAuto(ip);
rfid.StartAutoScan(OnReceive);
code = rfid.StartAutoScan(OnReceive);
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!