Commit cece86de LN

1

1 个父辈 6bb3f77f
......@@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2024
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ACServoDriveTest", "source\ACServoDriveTest\ACServoDriveTest.csproj", "{7FA84E1E-BCDE-49F6-BE42-0BC397AF65B8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "source\Common\Common.csproj", "{43CDD09E-FCF3-4960-A01D-3BBFE9933122}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceLibrary", "source\DeviceLibrary\DeviceLibrary.csproj", "{513BC1C9-800D-43A6-9499-3700BAEC3554}"
......@@ -25,10 +23,6 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7FA84E1E-BCDE-49F6-BE42-0BC397AF65B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FA84E1E-BCDE-49F6-BE42-0BC397AF65B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FA84E1E-BCDE-49F6-BE42-0BC397AF65B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7FA84E1E-BCDE-49F6-BE42-0BC397AF65B8}.Release|Any CPU.Build.0 = Release|Any CPU
{43CDD09E-FCF3-4960-A01D-3BBFE9933122}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{43CDD09E-FCF3-4960-A01D-3BBFE9933122}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43CDD09E-FCF3-4960-A01D-3BBFE9933122}.Release|Any CPU.ActiveCfg = Release|Any CPU
......
......@@ -13,7 +13,7 @@ namespace OnlineStore.AssemblyLine
{
internal partial class FrmBase : Form
{
internal static string GetVersion()
internal static string GetVersion(bool IsShow=false)
{
string str = "";
string version = "";
......@@ -38,7 +38,10 @@ namespace OnlineStore.AssemblyLine
str = version;
LogUtil.error("解析版本号【" + str + "】出错:" + ex.ToString());
}
LogUtil.info("版本号[" + version + "][" + str + "]["+GetCodeNum()+"]");
if (IsShow)
{
LogUtil.info("版本号[" + version + "][" + str + "][" + GetCodeNum() + "]");
}
return str;
}
internal static string GetCodeNum(string codeName = "RC1250-AssemblyLine")
......
......@@ -66,6 +66,8 @@
this.扫码测试ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.二维码学习ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.托盘初始化ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.帮助ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.版本号ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
......@@ -74,8 +76,6 @@
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.listView1 = new System.Windows.Forms.ListView();
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.托盘初始化ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
......@@ -318,9 +318,9 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.lblWarnMsg.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWarnMsg.ForeColor = System.Drawing.Color.Red;
this.lblWarnMsg.Location = new System.Drawing.Point(261, 4);
this.lblWarnMsg.Location = new System.Drawing.Point(307, 4);
this.lblWarnMsg.Name = "lblWarnMsg";
this.lblWarnMsg.Size = new System.Drawing.Size(1491, 69);
this.lblWarnMsg.Size = new System.Drawing.Size(1445, 69);
this.lblWarnMsg.TabIndex = 96;
this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
......@@ -358,61 +358,61 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(141, 6);
//
// 启动AToolStripMenuItem
//
this.启动AToolStripMenuItem.Name = "启动AToolStripMenuItem";
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.启动AToolStripMenuItem.Text = "启动 ";
this.启动AToolStripMenuItem.Click += new System.EventHandler(this.启动所有料仓AToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator4.Size = new System.Drawing.Size(141, 6);
//
// 复位RToolStripMenuItem
//
this.复位RToolStripMenuItem.Name = "复位RToolStripMenuItem";
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.复位RToolStripMenuItem.Text = "复位";
this.复位RToolStripMenuItem.Click += new System.EventHandler(this.复位RToolStripMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(141, 6);
//
// 停止TToolStripMenuItem
//
this.停止TToolStripMenuItem.Name = "停止TToolStripMenuItem";
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.停止TToolStripMenuItem.Text = "停止";
this.停止TToolStripMenuItem.Click += new System.EventHandler(this.停止所有料仓TToolStripMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator5.Size = new System.Drawing.Size(141, 6);
//
// 入库模式ToolStripMenuItem
//
this.入库模式ToolStripMenuItem.Name = "入库模式ToolStripMenuItem";
this.入库模式ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.入库模式ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.入库模式ToolStripMenuItem.Text = "入库模式";
this.入库模式ToolStripMenuItem.Visible = false;
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(141, 6);
this.toolStripSeparator2.Visible = false;
//
// 退出ToolStripMenuItem
//
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.退出ToolStripMenuItem.Text = "退出";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click_1);
//
......@@ -431,22 +431,34 @@
// 扫码测试ToolStripMenuItem
//
this.扫码测试ToolStripMenuItem.Name = "扫码测试ToolStripMenuItem";
this.扫码测试ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.扫码测试ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.扫码测试ToolStripMenuItem.Text = "扫码测试";
this.扫码测试ToolStripMenuItem.Click += new System.EventHandler(this.扫码测试ToolStripMenuItem_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(157, 6);
//
// 二维码学习ToolStripMenuItem
//
this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem";
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.二维码学习ToolStripMenuItem.Text = "二维码学习";
this.二维码学习ToolStripMenuItem.Click += new System.EventHandler(this.二维码学习ToolStripMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(157, 6);
//
// 托盘初始化ToolStripMenuItem
//
this.托盘初始化ToolStripMenuItem.Name = "托盘初始化ToolStripMenuItem";
this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.托盘初始化ToolStripMenuItem.Text = "托盘编码";
this.托盘初始化ToolStripMenuItem.Click += new System.EventHandler(this.托盘初始化ToolStripMenuItem_Click);
//
// 帮助ToolStripMenuItem
//
this.帮助ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
......@@ -515,18 +527,6 @@
this.listView1.View = System.Windows.Forms.View.Details;
this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6);
//
// 托盘初始化ToolStripMenuItem
//
this.托盘初始化ToolStripMenuItem.Name = "托盘初始化ToolStripMenuItem";
this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.托盘初始化ToolStripMenuItem.Text = "托盘编码";
this.托盘初始化ToolStripMenuItem.Click += new System.EventHandler(this.托盘初始化ToolStripMenuItem_Click);
//
// FrmLineStore
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......
......@@ -100,8 +100,8 @@ namespace OnlineStore.AssemblyLine
}
private void FrmMain_Load(object sender, EventArgs e)
{
FrmBase. GetVersion();
if(!LineManager.Init())
FrmBase.GetVersion(true);
if (!LineManager.Init())
{
LogUtil.error("加载配置失败,直接退出程序");
Application.Exit();
......
......@@ -38,7 +38,7 @@ namespace OnlineStore.DeviceLibrary
public override bool StartRun(bool isDebug = false)
{
preTrayNum = 0;
currMoveTrayNum = 0;
currTrayNum = 0;
mainTimer.Enabled = false;
MoveInfo.EndMove();
SecondMoveInfo.EndMove();
......@@ -252,12 +252,13 @@ namespace OnlineStore.DeviceLibrary
public override bool StartInStoreMove(InOutParam param)
{
return false;
}
protected override void InStoreProcess()
{
}
protected override void CheckFixtureProcess()
{
}
}
}
......@@ -11,31 +11,8 @@ namespace OnlineStore.DeviceLibrary
{
partial class DischargeLine
{
#region 托盘检测
private void StartCheckFixture()
{
#region 是否可移栽料盘
}
private bool CheckIsNeedOutStore()
{
return false;
}
protected override void CheckFixtureProcess()
{
if (!LineManager.Line.LineCanRun())
{
return;
}
if (SecondMoveInfo.IsInWait)
{
CheckWait(SecondMoveInfo);
}
if (SecondMoveInfo.IsInWait)
{
return;
}
}
internal bool CanStartOut(int lineNum)
{
......@@ -118,9 +95,7 @@ namespace OnlineStore.DeviceLibrary
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : "";
if (MoveInfo.MoveStep.Equals(LineMoveStep.DL_R_LineCheck))
{
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DL_R_LineCheck))
{
LogInfo("出料【" + posId + "】处理完成!");
......
......@@ -13,12 +13,12 @@ namespace OnlineStore.DeviceLibrary
{
private bool IsIntSlvBlock = false;
public bool IsDebug = false;
public AxisAlarmInfo AxisAlarm = new AxisAlarmInfo();
internal AxisAlarmInfo AxisAlarm = new AxisAlarmInfo();
public bool UseAxis = false;
public List<InOutParam> waitOutStoreList = new List<InOutParam>();
public List<InOutParam> waitInStoreList = new List<InOutParam>();
public object waitInListLock = "";
public object waitOutListLock = "";
internal object waitInListLock = "";
internal object waitOutListLock = "";
/// <summary>
///移栽装置后面分为两条移动线
/// </summary>
......@@ -26,11 +26,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 上一个盘号
/// </summary>
public int preTrayNum = 0;
internal int preTrayNum = 0;
/// <summary>
/// 当前正在通过的托盘号
/// </summary>
protected int currMoveTrayNum = 0;
protected int currTrayNum = 0;
protected abstract void ReturnHomeProcess();
protected virtual void StopMoveProcess()
......
......@@ -361,7 +361,7 @@ namespace OnlineStore.DeviceLibrary
{
return true;
}
if (TrayManager.IsHasFull())
if (TrayManager.IsHasFullTray())
{
return true;
}
......@@ -600,23 +600,6 @@ namespace OnlineStore.DeviceLibrary
// FeederProcess();
//如果驱动电机正转过程中,驱动电机INV1状态 驱动电机INV2状态 有信号,需要报警
//if (IOValue(IO_Type.DriveMotor_Run).Equals(IO_VALUE.HIGH))
//{
// if (IOValue(IO_Type.DriveMotor_INV1).Equals(IO_VALUE.LOW))
// {
// WarnMsg = "驱动电机INV1状态异常";
// LogUtil.error("驱动电机正转过程中,DriveMotor_INV1 信号LOW,需要报警", 300);
// //Alarm(LineAlarmType.SuddenStop, "1", WarnMsg, LineMoveType.None);
// }
// else if (IOValue(IO_Type.DriveMotor_INV2).Equals(IO_VALUE.LOW))
// {
// WarnMsg = "驱动电机INV2状态异常";
// LogUtil.error("驱动电机正转过程中,DriveMotor_INV2 信号LOW,需要报警", 301);
// // Alarm(LineAlarmType.SuddenStop, "1", WarnMsg, LineMoveType.None);
// }
//}
}
}
catch (Exception ex)
......@@ -625,21 +608,6 @@ namespace OnlineStore.DeviceLibrary
}
Thread.Sleep(1);
}
//public string GetINVMsg()
//{
// if (IOValue(IO_Type.DriveMotor_Run).Equals(IO_VALUE.HIGH))
// {
// if (IOValue(IO_Type.DriveMotor_INV1).Equals(IO_VALUE.LOW))
// {
// return " 驱动电机INV1状态异常";
// }
// else if (IOValue(IO_Type.DriveMotor_INV2).Equals(IO_VALUE.LOW))
// {
// return " 驱动电机INV2状态异常";
// }
// }
// return "";
//}
/// <summary>
/// 定时处理,监听信号,监听IO
/// </summary>
......
......@@ -949,86 +949,6 @@ namespace OnlineStore.DeviceLibrary
}
#endregion
#region 高度传感器处理
public int GetWidth()
{
////根据料盘检测信号
//if (IOValue(IO_Type.InStore_TrayCheck2).Equals(IO_VALUE.HIGH))
//{
// return 13;
//}
return 7;
}
public int GetHeight()
{
if (GetWidth().Equals(13))
{
return Get13Height();
}
return Get7Height();
}
private int Get7Height()
{
int result = 0;
//if (IOValue(IO_Type.InStore_TrayCheck1).Equals(IO_VALUE.LOW))
//{
// return result;
//}
//int ai1 = AIManager.GetAIValue(Config.AIDI1_Addr);
//int ai2 = AIManager.GetAIValue(Config.AIDI2_Addr);
//double ai1Value = AIManager.ConvertAI(ai1, Config.AIDI1_DefaultPosition);
//double ai2Value = AIManager.ConvertAI(ai2, Config.AIDI2_DefaultPosition);
//result = CalHeight(ai1Value, ai2Value);
return result;
}
private int Get13Height()
{
int result = 0;
//if (IOValue(IO_Type.InStore_TrayCheck2).Equals(IO_VALUE.LOW))
//{
// return result;
//}
//double ai1Value = AIManager.ConvertAI(AIManager.GetAIValue(Config.AIDI3_Addr), Config.AIDI3_DefaultPosition);
//double ai2Value = AIManager.ConvertAI(AIManager.GetAIValue(Config.AIDI4_Addr), Config.AIDI4_DefaultPosition);
//result = CalHeight(ai1Value, ai2Value);
return result;
}
private int CalHeight(double ai1Value, double ai2Value)
{
int result = 0;
double Value = Math.Round((ai1Value + ai2Value) / 2, 1);
if (Value > 10)
{
int mo = (int)Value % 4;
if (!mo.Equals(0))
{
result = ((int)(Value + 2) / 4) * 4;
}
else
{
result = (int)Value;
}
}
else if (Value >= 4)
{
if (ai1Value >= 9 || ai2Value >= 9)
{
result = 12;
}
else
{
result = 8;
}
}
return result;
}
#endregion
#region 料仓出入库逻辑处理
......
......@@ -48,7 +48,7 @@ namespace OnlineStore.DeviceLibrary
public override bool StartRun(bool isDebug=false)
{
preTrayNum = 0;
currMoveTrayNum = 0;
currTrayNum = 0;
mainTimer.Enabled = false;
MoveInfo.EndMove();
SecondMoveInfo.EndMove();
......@@ -65,7 +65,7 @@ namespace OnlineStore.DeviceLibrary
public override void StopRun()
{
preTrayNum = 0;
currMoveTrayNum = 0;
currTrayNum = 0;
if (mainTimer != null)
{
mainTimer.Enabled = false;
......@@ -185,7 +185,7 @@ namespace OnlineStore.DeviceLibrary
alarmType = LineAlarmType.None;
//重置时清理盘号,从头开始判断
preTrayNum = 0;
currMoveTrayNum = 0;
currTrayNum = 0;
LogInfo("开始重置:清空托盘号,(上下气缸回原点,阻挡1气缸上升 )开始;");
runStatus = LineRunStatus.Reset;
SecondMoveInfo.EndMove();
......
......@@ -323,7 +323,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否是自己排队列表中的入库信息
foreach (InOutParam cc in waitInStoreList)
{
if (cc.TrayNumber.Equals(currMoveTrayNum) && (!cc.WareCode.Equals("")))
if (cc.TrayNumber.Equals(currTrayNum) && (!cc.WareCode.Equals("")))
{
return true;
}
......@@ -340,13 +340,13 @@ namespace OnlineStore.DeviceLibrary
/// <returns></returns>
private bool CheckIsNeedOutStore()
{
bool isFull = TrayManager.IsFixTureFull(currMoveTrayNum);
bool isFull = TrayManager.TrayIsFull(currTrayNum);
if (MoveInfo.MoveType.Equals(LineMoveType.OutStore) && (MoveInfo.MoveStep >= LineMoveStep.MO_56_BeforeAfterCylinderAfter)
&& (!MoveInfo.MoveStep.Equals(LineMoveStep.MO_60_UpDownCylinderUp)))
{
if (isFull.Equals(false))
{
LogInfo(" 托盘号【" + preTrayNum + "】,当前托盘号【(isFull=" + isFull + "):" + currMoveTrayNum + "】需要出库,不顶升直接让移栽放盘~");
LogInfo(" 托盘号【" + preTrayNum + "】,当前托盘号【(isFull=" + isFull + "):" + currTrayNum + "】需要出库,不顶升直接让移栽放盘~");
return true;
}
//去掉直接丢料盘处理
......@@ -364,8 +364,8 @@ namespace OnlineStore.DeviceLibrary
/// <returns></returns>
private bool CheckIsNeedInStore()
{
bool isfull = TrayManager.IsFixTureFull(currMoveTrayNum);
LogInfo("***************入库*****验证入库编号,托盘号【" + currMoveTrayNum + "】,isfull【" + isfull + "】");
bool isfull = TrayManager.TrayIsFull(currTrayNum);
LogInfo("***************入库*****验证入库编号,托盘号【" + currTrayNum + "】,isfull【" + isfull + "】");
//FixtureCodeInfo code = GetBox().currInOutFixture;
if (!isfull)
{
......@@ -382,11 +382,11 @@ namespace OnlineStore.DeviceLibrary
for (int i = 0; i < waitInStoreList.Count; i++)
{
InOutParam cc = waitInStoreList[i];
if (cc.TrayNumber.Equals(currMoveTrayNum) && (!cc.WareCode.Equals("")))
if (cc.TrayNumber.Equals(currTrayNum) && (!cc.WareCode.Equals("")))
{
reIndex = i;
currCode = cc;
LogInfo("*******托盘" + currMoveTrayNum + "需要入库【" + currCode.ToStr() + "】 ,开始入库移栽");
LogInfo("*******托盘" + currTrayNum + "需要入库【" + currCode.ToStr() + "】 ,开始入库移栽");
SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW);
break;
}
......@@ -396,7 +396,7 @@ namespace OnlineStore.DeviceLibrary
waitInStoreList.RemoveAt(reIndex);
if (!LineServer.BoxCanInStore(DeviceID))
{
LogUtil.info(Name + "*******托盘" + currMoveTrayNum + "需要入库【" + currCode.ToStr() + "】,BoxCanInStore验证失败,先移栽再等待料仓可入库,开始入库移栽");
LogUtil.info(Name + "*******托盘" + currTrayNum + "需要入库【" + currCode.ToStr() + "】,BoxCanInStore验证失败,先移栽再等待料仓可入库,开始入库移栽");
return true;
}
else
......@@ -490,15 +490,16 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要顶升
bool isNeed = false;
//此处先对托盘号进行验证
currMoveTrayNum = TrayManager.GetTrayNum(DeviceID);
bool isFull = TrayManager.IsFixTureFull(currMoveTrayNum);
if (TrayManager.RightTrayCode(currMoveTrayNum, preTrayNum, false))
preTrayNum = currTrayNum;
currTrayNum = TrayManager.GetTrayNum(DeviceID);
bool isFull = TrayManager.TrayIsFull(currTrayNum);
if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false))
{
//出库中,需要拦盘
if (CheckIsNeedOutStore())
{
//preTrayNum = currMoveTrayNum;
SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum);
SecondMoveInfo.MoveParam = new InOutParam(currTrayNum);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait();
return;
......@@ -510,7 +511,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
string msg = Name + " 托盘顺序错乱,上个托盘号【" + preTrayNum + "】当前托盘号 【" + currMoveTrayNum + "】最大盘号【" + TrayManager.MaxTrayNum + "】";
string msg = Name + " 托盘顺序错乱,上个托盘号【" + preTrayNum + "】当前托盘号 【" + currTrayNum + "】最大盘号【" + TrayManager.MaxTrayNum + "】";
TrayManager.UpdateTrayNumError(DeviceID, msg);
LogUtil.error(msg);
return;
......@@ -523,7 +524,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogInfo(SecondMoveInfo.MoveNum + "***************上个托盘号【" + preTrayNum + "】,当前" + (isFull ? "有料托盘" : "空托盘") + "【" + currMoveTrayNum + "】没有出入库任务,放盘通过~");
LogInfo(SecondMoveInfo.MoveNum + "***************上个托盘号【" + preTrayNum + "】,当前" + (isFull ? "有料托盘" : "空托盘") + "【" + currTrayNum + "】没有出入库任务,放盘通过~");
// preTrayNum = currMoveTrayNum;
if (TrayManager.ErrorStoreId.Equals(DeviceID))
{
......@@ -552,7 +553,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_06_TopCylinderUp))
{
CheckLog("托盘检测(流水线阻挡)*************** 托盘号【" + currMoveTrayNum + "】");
CheckLog("托盘检测(流水线阻挡)*************** 托盘号【" + currTrayNum + "】");
//托盘号正确
//preTrayNum = num;
......@@ -560,9 +561,9 @@ namespace OnlineStore.DeviceLibrary
//判断盘是空盘,空盘并且编号正确才需要放料盘过去
if (CheckIsNeedOutStore())
{
SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum);
SecondMoveInfo.MoveParam = new InOutParam(currTrayNum);
isNeedMove = true;
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currMoveTrayNum + "】可以放出库托盘,正在出库中,移栽料盘");
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】可以放出库托盘,正在出库中,移栽料盘");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait();
}
......@@ -570,13 +571,13 @@ namespace OnlineStore.DeviceLibrary
{
if (CheckIsNeedInStore())
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currMoveTrayNum + "】不是空盘,有对应的入库任务,等待移栽");
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】不是空盘,有对应的入库任务,等待移栽");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_08_WaitInStore);
isNeedMove = true;
}
else
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currMoveTrayNum + "】不是空盘, 放盘通过");
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】不是空盘, 放盘通过");
}
}
if (!isNeedMove)
......@@ -586,7 +587,7 @@ namespace OnlineStore.DeviceLibrary
{
TrayManager.UpdateTrayNumError(-1, "");
}
CheckLog("托盘检测 SecondMove:(MO_13_TopCylinder_Down ,托盘号【" + currMoveTrayNum + "】,直接放盘通过,顶升气缸下降)");
CheckLog("托盘检测 SecondMove:(MO_13_TopCylinder_Down ,托盘号【" + currTrayNum + "】,直接放盘通过,顶升气缸下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopCylinder_Down);
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
}
......@@ -637,7 +638,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_18_StopCylinder_Back))
{
preTrayNum = currMoveTrayNum;
preTrayNum = currTrayNum;
CheckLog("托盘放行 SecondMove:(托盘放行结束) ");
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo.EndMove();
......
......@@ -47,7 +47,7 @@ namespace OnlineStore.DeviceLibrary
public override bool StartRun(bool isDebug=false)
{
preTrayNum = 0;
currMoveTrayNum = 0;
currTrayNum = 0;
mainTimer.Enabled = false;
MoveInfo.EndMove();
SecondMoveInfo.EndMove();
......@@ -128,7 +128,7 @@ namespace OnlineStore.DeviceLibrary
WarnMsg = "";
alarmType = LineAlarmType.None;
preTrayNum = 0;
currMoveTrayNum = 0;
currTrayNum = 0;
LogInfo("开始重置:清理盘号,(上下气上升,阻挡气缸上升 )开始 ");
runStatus = LineRunStatus.Reset;
MoveInfo.EndMove();
......
......@@ -103,9 +103,9 @@ namespace OnlineStore.DeviceLibrary
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_04_Wait))
{
//此处先对托盘号进行验证
currMoveTrayNum = TrayManager.GetTrayNum(DeviceID);
bool isFull = TrayManager.IsFixTureFull(currMoveTrayNum);
if (TrayManager.RightTrayCode(currMoveTrayNum, preTrayNum, false))
preTrayNum = currTrayNum;
currTrayNum = TrayManager.GetTrayNum(DeviceID);
if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false))
{
if (TrayManager.ErrorStoreId.Equals(DeviceID))
{
......@@ -114,8 +114,8 @@ namespace OnlineStore.DeviceLibrary
//出料中,需要拦盘
if (CheckIsNeedOutStore())
{
TrayInfo trayInfo = TrayManager.GetTrayInfo(currMoveTrayNum);
InOutParam param = new InOutParam(currMoveTrayNum, trayInfo.WareCode, trayInfo.PosId, trayInfo.PlateH, trayInfo.PlateW);
TrayInfo trayInfo = TrayManager.GetTrayInfo(currTrayNum);
InOutParam param = new InOutParam(currTrayNum, trayInfo.WareCode, trayInfo.PosId, trayInfo.PlateH, trayInfo.PlateW);
CheckLog("托盘检测(流水线阻挡)是需要出库" + param.ToStr() + ":(MIO_05_WaitTime 等待1秒后顶升上升 )");
SecondMoveInfo.MoveParam = param;
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_05_WaitTime);
......@@ -126,15 +126,15 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogInfo(SecondMoveInfo.MoveNum + "***************上个托盘号【" + preTrayNum + "】,当前" + (isFull ? "有料托盘" : "空托盘") + "【" + currMoveTrayNum + "】没有出入料任务,放盘通过~");
bool isFull = TrayManager.TrayIsFull(currTrayNum);
LogInfo(SecondMoveInfo.MoveNum + "***************上个托盘号【" + preTrayNum + "】,当前" + (isFull ? "有料托盘" : "空托盘") + "【" + currTrayNum + "】没有出入料任务,放盘通过~");
CheckLog("托盘放行 SecondMove:(MO_14_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_15_WaitCanGo);
}
}
else
{
string msg = Name + " 托盘顺序错乱,上个托盘号【" + preTrayNum + "】当前托盘号 【" + currMoveTrayNum + "】最大盘号【" + TrayManager.MaxTrayNum + "】";
string msg = Name + " 托盘顺序错乱,上个托盘号【" + preTrayNum + "】当前托盘号 【" + currTrayNum + "】最大盘号【" + TrayManager.MaxTrayNum + "】";
TrayManager.UpdateTrayNumError(DeviceID, msg);
LogUtil.error(msg);
return;
......@@ -152,8 +152,8 @@ namespace OnlineStore.DeviceLibrary
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_06_TopCylinderUp))
{
SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum);
LogInfo(SecondMoveInfo.MoveNum + " 托盘号【" + currMoveTrayNum + "】等待移栽料盘");
SecondMoveInfo.MoveParam = new InOutParam(currTrayNum);
LogInfo(SecondMoveInfo.MoveNum + " 托盘号【" + currTrayNum + "】等待移栽料盘");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait();
}
......@@ -198,7 +198,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_18_StopCylinder_Back))
{
preTrayNum = currMoveTrayNum;
preTrayNum = currTrayNum;
CheckLog("托盘放行 SecondMove:(托盘放行结束) ");
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo.EndMove();
......
......@@ -57,7 +57,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// <param name="trayNum">盘号1-6</param>
/// <returns>盘上是否有料盘</returns>
internal static bool IsFixTureFull(int trayNum)
internal static bool TrayIsFull(int trayNum)
{
lock (fixtureMapLock)
{
......@@ -129,7 +129,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 是否还有有料仓的盘
/// </summary>
internal static bool IsHasFull()
internal static bool IsHasFullTray()
{
foreach (int key in fixtureCodeFullMap.Keys)
{
......
......@@ -379,7 +379,45 @@ namespace OnlineStore.DeviceLibrary
MO_60_UpDownCylinderUp = 3160,
#region 入料模块,紧急出料移栽处理
/// <summary>
/// 紧急出料移栽:升降伺服到P1点
/// </summary>
MO_201_UpDownToP1 = 3201,
/// <summary>
/// 紧急出料移栽:上料横移机构到放料端
/// /// </summary>
MO_202_MoveCylinder_Give = 3202,
/// <summary>
/// 紧急出料移栽:上料横移机构下降
/// /// </summary>
MO_203_MoveCylinder_Down = 3203,
/// <summary>
/// 紧急出料移栽:升降伺服下降到指定位置
/// /// </summary>
MO_204_UpdownAxisToP2= 3204,
/// <summary>
/// 紧急出料移栽:上料气缸夹紧
/// /// </summary>
MO_205_MoveCylinder_Tighten = 3205,
/// <summary>
/// 紧急出料移栽:升降伺服到P1
/// /// </summary>
MO_206_UpdownAxisToP1= 3206,
/// <summary>
/// 紧急出料移栽:上料横移机构上升
/// /// </summary>
MO_207_MoveCylinder_Up= 3207,
/// <summary>
/// 紧急出料移栽:上料横移机构到取料端
/// /// </summary>
MO_208_MoveCylinder_Take = 3208,
/// <summary>
/// 紧急出料移栽:等待料架准备好
/// /// </summary>
MO_209_Wait = 3209,
#endregion
#endregion
......@@ -387,7 +425,7 @@ namespace OnlineStore.DeviceLibrary
#region 横移轨道处理 5000 开始
SW00_Wait=5000,
SW00_Wait = 5000,
/// <summary>
/// 定位气缸下降
/// </summary>
......@@ -664,10 +702,122 @@ namespace OnlineStore.DeviceLibrary
#region 入料装置出料处理,12000开始
/// <summary>
/// 出料流程:升降盘定位气缸后退
/// </summary>
FO_01_TrayLocation_After = 12001,
/// <summary>
/// 出料流程:定位气缸下降
/// </summary>
FO_02_LocationCylinder_Down = 12002,
/// <summary>
/// 入口流水线转动,等待出料检测信号消失
/// </summary>
FO_03_LineStart = 12003,
/// <summary>
/// 入口流水线转动,等待阻挡气缸信号到位
/// </summary>
FO_04_LineRunCheck = 12004,
/// <summary>
/// 入口流水线转动,等待出料阻挡信号消失
/// </summary>
FO_05_LineStart = 12005,
/// <summary>
/// 入口流水线转动,等待定位工位检测到位
/// </summary>
FO_06_LineRunCheck = 12006,
/// <summary>
///出料检测: 工位检测信号,定位气缸上升
/// </summary>
FO_07_LocationCylinder_Up = 12007,
/// <summary>
/// 出料检测:提升轴下降到位P2
/// </summary>
FO_08_BatchAxisToP2 = 12008,
/// <summary>
/// 出料检测:升降盘定位气缸前进
/// </summary>
FO_09_TrayLocation_Before = 12009,
/// <summary>
/// 出料检测:上料轴开始慢速上升到P3点
/// </summary>
FO_10_AxisUpMove = 12010,
/// <summary>
/// 料盘移栽:上料轴下降指定的高度
/// </summary>
FO_11_AxisDownMove = 12011,
/// <summary>
/// 料盘移栽:出料横移机构下降
/// </summary>
FO_12_MoveCylinder_Down = 12012,
/// <summary>
/// 料盘移栽:出料横移机构放松
/// </summary>
FO_13_MoveCylinder_Slack = 12013,
/// <summary>
/// 料盘移栽:出料横移机构上升
/// </summary>
FO_14_MoveCylinder_Up = 12014,
/// <summary>
/// 出料完成,料盘已放入料架,提升伺服到P2点
/// </summary>
FO_31_BatchAxisToP2 = 12031,
/// <summary>
/// 出料完成,升降盘定位气缸后退
/// </summary>
FO_32_TrayLocationCylinder_After = 12032,
/// <summary>
/// 出料完成,提升伺服到P1点
/// </summary>
FO_33_BatchAxisToP1 = 12033,
/// <summary>
/// 出料完成,判断出料线体是否有料架
/// </summary>
FO_34_OutCheck = 12034,
/// <summary>
/// 出料完成,出口顶升气缸上升
/// </summary>
FO_35_OutTopCylinder_Up = 12035,
/// <summary>
///出料完成, 线体横移电机运转,等待料架到达出口
/// </summary>
FO_36_SideWayLineRun = 12036,
/// <summary>
///出料完成, 料架到达出口,线体横移电机停止
/// </summary>
FO_37_LineStop = 12037,
/// <summary>
///出料完成, 料架到达出口,出口顶升下降,定位气缸下降,
/// </summary>
FO_38_TopCylinderDown = 12038,
/// <summary>
///出料完成, 出口线体运转,料架到达出口处, 通知AGV取空料架
/// </summary>
FO_39_OutLineRun = 12039,
/// <summary>
///出料完成, AGV到达,继续转动出口线体,送走出料料架,
/// </summary>
FO_40_OutLineRun = 12040,
/// <summary>
///
///出料完成, 料架送出,
/// </summary>
FO_01_OutLineStart = 12000,
FO_41_OutLineRun = 12041,
#endregion
#region 出料装置移栽出料,20000开始
......
......@@ -58,7 +58,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public int PlateW { get; set; }
public bool EmergencyOut = false;
}
/// <summary>
/// 托盘上的物料的类型
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!