Commit 2795400b LN

增加接驳台横移

1 个父辈 0c1f0ca5
......@@ -94,12 +94,6 @@
<Compile Include="agvtest\FrmAgvTest.Designer.cs">
<DependentUpon>FrmAgvTest.cs</DependentUpon>
</Compile>
<Compile Include="FrmIOMsg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmIOMsg.Designer.cs">
<DependentUpon>FrmIOMsg.cs</DependentUpon>
</Compile>
<Compile Include="FrmHYEquip.cs">
<SubType>Form</SubType>
</Compile>
......@@ -184,9 +178,6 @@
<EmbeddedResource Include="agvtest\FrmAgvTest.resx">
<DependentUpon>FrmAgvTest.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmIOMsg.resx">
<DependentUpon>FrmIOMsg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmHYEquip.resx">
<DependentUpon>FrmHYEquip.cs</DependentUpon>
</EmbeddedResource>
......
namespace OnlineStore.AssemblyLine
{
partial class FrmIOMsg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.lblBox = new System.Windows.Forms.Label();
this.lblMsg = new System.Windows.Forms.Label();
this.btnUpdate = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// timer1
//
this.timer1.Interval = 10000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// lblBox
//
this.lblBox.AutoSize = true;
this.lblBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblBox.Location = new System.Drawing.Point(570, 62);
this.lblBox.Name = "lblBox";
this.lblBox.Size = new System.Drawing.Size(80, 17);
this.lblBox.TabIndex = 2;
this.lblBox.Text = "料仓连接信息";
//
// lblMsg
//
this.lblMsg.AutoSize = true;
this.lblMsg.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMsg.Location = new System.Drawing.Point(56, 26);
this.lblMsg.Name = "lblMsg";
this.lblMsg.Size = new System.Drawing.Size(94, 17);
this.lblMsg.TabIndex = 3;
this.lblMsg.Text = "10秒钟刷新一次";
//
// btnUpdate
//
this.btnUpdate.Location = new System.Drawing.Point(383, 18);
this.btnUpdate.Name = "btnUpdate";
this.btnUpdate.Size = new System.Drawing.Size(115, 33);
this.btnUpdate.TabIndex = 4;
this.btnUpdate.Text = "刷新";
this.btnUpdate.UseVisualStyleBackColor = true;
this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click);
//
// btnExit
//
this.btnExit.Location = new System.Drawing.Point(504, 18);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(115, 33);
this.btnExit.TabIndex = 5;
this.btnExit.Text = "退出";
this.btnExit.UseVisualStyleBackColor = true;
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// FrmIOMsg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(990, 708);
this.Controls.Add(this.btnExit);
this.Controls.Add(this.btnUpdate);
this.Controls.Add(this.lblMsg);
this.Controls.Add(this.lblBox);
this.Name = "FrmIOMsg";
this.Text = "IO连接状态";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FrmIOMsg_FormClosed);
this.Load += new System.EventHandler(this.FrmIOMsg_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Label lblBox;
private System.Windows.Forms.Label lblMsg;
private System.Windows.Forms.Button btnUpdate;
private System.Windows.Forms.Button btnExit;
}
}
\ No newline at end of file
using Asa.RFID;
using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnlineStore.AssemblyLine
{
internal partial class FrmIOMsg : FrmBase
{
public FrmIOMsg()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
if (this.Visible)
{
UpdateData();
}
}
private void UpdateData()
{
lblMsg.Text = "自动刷新时间:" + timer1.Interval + "毫秒,最后更新时间:" + DateTime.Now.ToLongTimeString();
//lblConInfo.Text = "IO连接信息:\r\n";
string msg = "";
List<string> tList = new List<string>(LineManager.Line.cioList);
foreach (string ip in tList)
{
//string con = (IOManager.instance.IsConnect(ip)) ? " ✔" : " ✘";
//msg += ("IO模块[" + ip + "]").PadLeft(26, ' ') + con + "\n";
}
//lblConInfo.Text += msg;
//lblRFID.Text = "RFID信息:\r\n";
//msg = "";
//List<string> rfidList = new List<string>(DeviceConfig.ProRFIpMap.Values);
//foreach (string ip in rfidList)
//{
// 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;
lblBox.Text = "料仓连接信息:\r\n";
msg = "";
List<int> list = new List<int>(LineManager.Line.MoveEquipMap.Keys);
foreach (int storeId in list)
{
if (LineServer. BoxConnected(storeId))
{
string doorTray = "仓门口:未知";
BoxInfo box= LineServer.GetBoxInfo(storeId);
if (box != null )
{
if (box.HasTray.Equals(1))
{
doorTray = "仓门口:有料";
}
else
{
doorTray = "仓门口:无料";
}
}
msg += ("BOX[" + storeId + "]").PadLeft(16, ' ') + " ✔ "+LineServer.ClientMap[storeId].AddStr + " "+doorTray+"\n";
}
else
{
msg += ("BOX[" + storeId + "]").PadLeft(16, ' ') + " ✘ " + "\n";
}
}
lblBox.Text += msg;
}
private void FrmIOMsg_Load(object sender, EventArgs e)
{
UpdateData();
timer1.Start();
}
private void btnExit_Click(object sender, EventArgs e)
{
timer1.Stop();
this.Close();
}
private void btnUpdate_Click(object sender, EventArgs e)
{
UpdateData();
}
private void FrmIOMsg_FormClosed(object sender, FormClosedEventArgs e)
{
timer1.Stop();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
......@@ -839,9 +839,9 @@
this.toolStripSeparator7,
this.托盘初始化ToolStripMenuItem,
this.toolStripSeparator9,
this.iO模块状态ToolStripMenuItem,
this.toolStripSeparator13,
this.toolStripMenuItem2,
this.toolStripSeparator13,
this.iO模块状态ToolStripMenuItem,
this.toolStripSeparator14,
this.查看托盘信息ToolStripMenuItem,
this.toolStripSeparator12,
......@@ -853,73 +853,73 @@
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator6.Visible = false;
//
// 二维码学习ToolStripMenuItem
//
this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem";
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(180, 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(173, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6);
//
// 托盘初始化ToolStripMenuItem
//
this.托盘初始化ToolStripMenuItem.Name = "托盘初始化ToolStripMenuItem";
this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.托盘初始化ToolStripMenuItem.Text = "托盘编码";
this.托盘初始化ToolStripMenuItem.Click += new System.EventHandler(this.托盘初始化ToolStripMenuItem_Click);
//
// toolStripSeparator9
//
this.toolStripSeparator9.Name = "toolStripSeparator9";
this.toolStripSeparator9.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator9.Size = new System.Drawing.Size(177, 6);
//
// iO模块状态ToolStripMenuItem
//
this.iO模块状态ToolStripMenuItem.Name = "iO模块状态ToolStripMenuItem";
this.iO模块状态ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.iO模块状态ToolStripMenuItem.Text = "IO模块状态";
this.iO模块状态ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.iO模块状态ToolStripMenuItem.Text = "查看料仓状态";
this.iO模块状态ToolStripMenuItem.Click += new System.EventHandler(this.iO模块状态ToolStripMenuItem_Click);
//
// toolStripSeparator13
//
this.toolStripSeparator13.Name = "toolStripSeparator13";
this.toolStripSeparator13.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator13.Size = new System.Drawing.Size(177, 6);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(176, 26);
this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem2.Text = "AGV调试";
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
//
// toolStripSeparator14
//
this.toolStripSeparator14.Name = "toolStripSeparator14";
this.toolStripSeparator14.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator14.Size = new System.Drawing.Size(177, 6);
//
// 查看托盘信息ToolStripMenuItem
//
this.查看托盘信息ToolStripMenuItem.Name = "查看托盘信息ToolStripMenuItem";
this.查看托盘信息ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.查看托盘信息ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.查看托盘信息ToolStripMenuItem.Text = "查看托盘信息";
this.查看托盘信息ToolStripMenuItem.Click += new System.EventHandler(this.btnTrayInfo_Click);
//
// toolStripSeparator12
//
this.toolStripSeparator12.Name = "toolStripSeparator12";
this.toolStripSeparator12.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator12.Size = new System.Drawing.Size(177, 6);
//
// 清空托盘信息ToolStripMenuItem
//
this.清空托盘信息ToolStripMenuItem.Name = "清空托盘信息ToolStripMenuItem";
this.清空托盘信息ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.清空托盘信息ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.清空托盘信息ToolStripMenuItem.Text = "清空托盘信息";
this.清空托盘信息ToolStripMenuItem.Click += new System.EventHandler(this.清空托盘信息ToolStripMenuItem_Click);
//
......
......@@ -790,8 +790,42 @@ namespace OnlineStore.AssemblyLine
private void iO模块状态ToolStripMenuItem_Click(object sender, EventArgs e)
{
FrmIOMsg frm = new FrmIOMsg();
frm.ShowDialog();
//FrmIOMsg frm = new FrmIOMsg();
//frm.ShowDialog();
string msg = "";
List<int> list = new List<int>(LineManager.Line.MoveEquipMap.Keys);
LogUtil.info("-------------------开始打印料仓连接信息:");
foreach (int storeId in list)
{
string storeMsg = "";
if (LineServer.BoxConnected(storeId))
{
string doorTray = "仓门口:未知";
BoxInfo box = LineServer.GetBoxInfo(storeId);
if (box != null)
{
if (box.HasTray.Equals(1))
{
doorTray = "仓门口:有料";
}
else
{
doorTray = "仓门口:无料";
}
}
storeMsg=("BOX[" + storeId + "]").PadLeft(16, ' ') + " ✔ " + LineServer.ClientMap[storeId].AddStr + " " + doorTray + "\n";
}
else
{
storeMsg=("BOX[" + storeId + "]").PadLeft(16, ' ') + " ✘ " + "\n";
}
LogUtil.info(storeMsg);
msg += storeMsg;
}
LogUtil.info("-------------------结束打印料仓连接信息");
MessageBox.Show(msg, "料仓连接状态");
}
private void btnTrayInfo_Click(object sender, EventArgs e)
......
......@@ -103,7 +103,7 @@
this.lblDebug.AutoSize = true;
this.lblDebug.BackColor = System.Drawing.Color.Transparent;
this.lblDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblDebug.Location = new System.Drawing.Point(182, 4);
this.lblDebug.Location = new System.Drawing.Point(179, 4);
this.lblDebug.Name = "lblDebug";
this.lblDebug.Size = new System.Drawing.Size(51, 20);
this.lblDebug.TabIndex = 5;
......@@ -119,7 +119,7 @@
this.lblBox.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblBox.Location = new System.Drawing.Point(2, 73);
this.lblBox.Name = "lblBox";
this.lblBox.Size = new System.Drawing.Size(246, 24);
this.lblBox.Size = new System.Drawing.Size(245, 24);
this.lblBox.TabIndex = 6;
this.lblBox.Text = "BOX状态:";
this.lblBox.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
......@@ -128,12 +128,13 @@
//
this.panName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panName.BackColor = System.Drawing.Color.Lime;
this.panName.BackColor = System.Drawing.Color.Transparent;
this.panName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panName.Controls.Add(this.lblDebug);
this.panName.Controls.Add(this.lblName);
this.panName.Location = new System.Drawing.Point(1, 1);
this.panName.Name = "panName";
this.panName.Size = new System.Drawing.Size(247, 28);
this.panName.Size = new System.Drawing.Size(246, 28);
this.panName.TabIndex = 7;
//
// EquipControl
......
......@@ -53,12 +53,14 @@ namespace OnlineStore.AssemblyLine
else if (equip is FeedingEquip)
{
panName.BackColor = Color.Lime;
panName.BackColor = Color.MediumSpringGreen;
lblBox.Visible = false ;
lblBox.Text = "";
}
else
{
panName.BackColor = Color.Aqua;
panName.BackColor = Color.DarkTurquoise;
lblBox.Visible = false ;
lblBox.Text = "";
}
......@@ -78,12 +80,15 @@ namespace OnlineStore.AssemblyLine
if (equip.MoveInfo.MoveType.Equals(LineMoveType.InStore))
{
lblMoveInfo.Text = "入库中:" + equip.MoveInfo.MoveParam.PosId + "_" + equip.MoveInfo.MoveParam.WareCode;
}
else if (equip.MoveInfo.MoveType.Equals(LineMoveType.OutStore))
{
lblMoveInfo.Text = "出库中:" + equip.MoveInfo.MoveParam.PosId + "_" + equip.MoveInfo.MoveParam.WareCode;
}
else if (equip.SecondMoveInfo.MoveType.Equals(LineMoveType.CheckFixture))
{
lblMoveInfo.Text = "托盘[" + equip.currTrayNum + "]处理中";
}
else
{
lblMoveInfo.Text = "暂无出入库";
......@@ -124,13 +129,21 @@ namespace OnlineStore.AssemblyLine
}
else
{
if (equip.MoveInfo.MoveType.Equals(LineMoveType.CheckFixture))
if (equip.MoveInfo.MoveType.Equals(LineMoveType.OutStore))
{
lblMoveInfo.Text = "托盘[" + equip.currTrayNum + "]送料:" + equip.MoveInfo.MoveParam.PosId + "_" + equip.MoveInfo.MoveParam.WareCode;
}
else if (equip.MoveInfo.MoveType.Equals(LineMoveType.CheckFixture))
{
lblMoveInfo.Text = "托盘[" + equip.currTrayNum + "]处理中";
}
else if (equip.SecondMoveInfo.MoveType.Equals(LineMoveType.CheckFixture))
{
lblMoveInfo.Text = "托盘["+equip.currTrayNum+"]处理中";
lblMoveInfo.Text = "托盘[" + equip.currTrayNum + "]处理中";
}
else
{
lblMoveInfo.Text = "暂无托盘横移";
lblMoveInfo.Text = "暂无托盘处理";
}
}
this.BackColor = equip.GetShowColor();
......
......@@ -21,8 +21,8 @@
上料机构,入料判断托盘是否到位,放行托盘,从lineBean里调用
紧急出料,开始紧急出库横移主动调用开始 托盘出库方法。放行从lineBean里调用
HY,T3C1,只使用MoveInfo,SecondMoveInfo暂不使用,托盘处理MoveType=CheckFixture;
HY,T3C1,只使用MoveInfo,暂不使用,托盘处理MoveType=CheckFixture;
接驳台横移,托盘处理用SecondMoveInfo,料盘移栽用MoveInfo
出料与托盘关联
......
......@@ -68,6 +68,7 @@
<Compile Include="assemblyLine\FeedingEquip_OutStore.cs" />
<Compile Include="assemblyLine\HY\HYEquipBase.cs" />
<Compile Include="assemblyLine\HY\HY_C1_SLStation.cs" />
<Compile Include="assemblyLine\HY\HY_Coveryor_Partial.cs" />
<Compile Include="assemblyLine\HY\HY_OutLine.cs" />
<Compile Include="assemblyLine\HY\HY_C1Line.cs" />
<Compile Include="assemblyLine\LineBean_T3-C1.cs" />
......
......@@ -22,24 +22,15 @@ namespace OnlineStore.DeviceLibrary
public List<InOutParam> waitInStoreList = new List<InOutParam>();
internal object waitInListLock = "";
protected int trayCount = 0;
/// <summary>
/// 上一个盘号
/// </summary>
internal int preTrayNum = 0;
/// <summary>
/// 当前正在通过的托盘号
/// </summary>
public int currTrayNum = 0;
/// <summary>
/// 升降轴
/// </summary>
protected int trayCount = 0;
internal int preTrayNum = 0;
public int currTrayNum = 0;
public AxisBean UpdownAxis = null;
public delegate void TrayProcessEnd(int swNum, int trayNum);
protected abstract void BaseTimerProcess();
protected abstract void CheckFixtureProcess();
protected abstract void FixtureProcess();
protected override void mainTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
TimerProcess();
......@@ -137,6 +128,40 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("IOTimeOutProcess出错:",ex);
}
}
protected override void BusyMoveProcess()
{
try
{
if (MoveStop)
{
return;
}
if (SecondMoveInfo.MoveType.Equals(LineMoveType.CheckFixture))
{
FixtureProcess();
}
if (MoveInfo.MoveType.Equals(LineMoveType.InStore) || this.SecondMoveInfo.MoveType.Equals(LineMoveType.InStore))
{
InStoreProcess();
}
else if (MoveInfo.MoveType.Equals(LineMoveType.OutStore) || SecondMoveInfo.MoveType.Equals(LineMoveType.OutStore))
{
OutStoreProcess();
}
else if (MoveInfo.MoveType.Equals(LineMoveType.ReturnHome))
{
ResetProcess();
}
else if (MoveInfo.MoveType.Equals(LineMoveType.Reset))
{
ResetProcess();
}
}catch(Exception ex)
{
LogUtil.error(Name + " BusyMoveProcess 出错:" + ex.ToString());
}
}
protected void ClearTimeoutAlarm(string msg)
{
if (isInSuddenDown || isNoAirCheck)
......@@ -527,58 +552,32 @@ namespace OnlineStore.DeviceLibrary
protected void CheckLog(string msg)
{
LogUtil.debug(Name + msg);
LogUtil.debug(Name +"" +msg);
}
protected void InLog(string msg)
{
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : "";
string posId = MoveInfo.MoveParam != null ? "[" + MoveInfo.MoveParam.PosId + "][" + MoveInfo.MoveParam.WareCode + "]" : "";
//baseConfig.DType.Equals(DeviceType.HYEquip)
if (baseConfig.DType.Equals(DeviceType.MoveEquip))
{
if (String.IsNullOrEmpty(posId))
{
LogUtil.debug(Name + " " + msg);
}
else
{
LogUtil.debug(Name + " " + "[" + posId + "]" + msg);
}
LogUtil.debug(Name + " " + posId + msg);
}
else
{
if (String.IsNullOrEmpty(posId))
{
LogUtil.info(Name + " " + msg);
}
else
{
LogUtil.info(Name + " " + "[" + posId + "]" + msg);
}
LogUtil.info(Name + " " + posId + msg);
}
}
protected void OutLog(string msg)
{
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : "";
if (baseConfig.DType.Equals(DeviceType.HYEquip) || baseConfig.DType.Equals(DeviceType.MoveEquip))
string posId = MoveInfo.MoveParam != null ? "[" + MoveInfo.MoveParam.PosId + "][" + MoveInfo.MoveParam.WareCode + "]" : "";
//baseConfig.DType.Equals(DeviceType.HYEquip)
if (baseConfig.DType.Equals(DeviceType.MoveEquip))
{
if (String.IsNullOrEmpty(posId))
{
LogUtil.debug(Name + " " + msg);
}
else
{
LogUtil.debug(Name + " " + "[" + posId + "] " + msg);
}
LogUtil.debug(Name + " " + posId + msg);
}
else
{
if (String.IsNullOrEmpty(posId))
{
LogUtil.info(Name + " " + msg);
}
else
{
LogUtil.info(Name + " " + "[" + posId + "] " + msg);
}
LogUtil.info(Name + " " + posId + msg);
}
}
protected string RFIDIP="";
......
......@@ -344,19 +344,17 @@ namespace OnlineStore.DeviceLibrary
if (!isInSuddenDown)
{
LogUtil.error(Name + "收到急停信号,等待300后再次验证急停");
//Task.Factory.StartNew(delegate
//{
Thread.Sleep(300);
if (IOValue(IO_Type.SL_SuddenStop_BTN).Equals(IO_VALUE.LOW))
Thread.Sleep(300);
if (IOValue(IO_Type.SL_SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
SetWarnMsg(Name + "收到急停信号,急停报警");
if (isInSuddenDown.Equals(false))
{
SetWarnMsg(Name + "收到急停信号,急停报警");
if (isInSuddenDown.Equals(false))
{
Alarm(LineAlarmType.SuddenStop);
}
return;
Alarm(LineAlarmType.SuddenStop);
}
//});
return;
}
}
}
else if (IOValue(IO_Type.SL_Reset_BTN).Equals(IO_VALUE.HIGH))
......@@ -401,18 +399,18 @@ namespace OnlineStore.DeviceLibrary
//{
// if (Config.IsCanOut.Equals(0))
// {
// StartCheckFixture();
// CheckFixture();
// }
// else if (LineManager.Line.runStatus <= LineRunStatus.Wait)
// {
// StartCheckFixture();
// CheckFixture();
// }
//}
if (NoErrorAlarm())
{
if (IOValue(IO_Type.SL_Out_Check).Equals(IO_VALUE.HIGH))
{
if (TrayManager.checkWatch(needLeaveWatch, 3000))
if (CheckStopWatch(needLeaveWatch, 3000))
{
ClientLevel level = ClientLevel.Low;
if (Config.IsCanOut.Equals(1))
......@@ -435,7 +433,7 @@ namespace OnlineStore.DeviceLibrary
//入口无料架,mayEnter
if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.LOW))
{
if (TrayManager.checkWatch(needEnterWatch, 3000))
if (CheckStopWatch(needEnterWatch, 3000))
{
ClientLevel level = ClientLevel.Low;
if (Config.IsCanOut.Equals(1))
......
......@@ -63,11 +63,11 @@ namespace OnlineStore.DeviceLibrary
#region 托盘检测
private void StartCheckFixture()
private void CheckFixture()
{
}
protected override void CheckFixtureProcess()
protected override void FixtureProcess()
{
}
......
......@@ -153,7 +153,7 @@ namespace OnlineStore.DeviceLibrary
{
if (LineManager.Line.CanProcessLine())
{
StartCheckFixture();
CheckFixture();
}
}
else
......@@ -164,9 +164,9 @@ namespace OnlineStore.DeviceLibrary
}
else
{
TrayManager.checkWatch(trayCheck2LowWait, 30000, false);
CheckStopWatch(trayCheck2LowWait, 30000, false);
}
CheckFixtureProcess();
FixtureProcess();
}
}
......@@ -174,7 +174,7 @@ namespace OnlineStore.DeviceLibrary
private Stopwatch trayCheckWait = new Stopwatch();//检测到托盘的时间
private Stopwatch trayCheck2LowWait = new Stopwatch();//上一个托盘离开的时间
private object lockObj = "";
private void StartCheckFixture()
private void CheckFixture()
{
if (Monitor.TryEnter(lockObj, 100))
{
......@@ -182,7 +182,7 @@ namespace OnlineStore.DeviceLibrary
{
if (MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
LogUtil.error(Name + " StartCheckFixture " + " 不在空闲中,直接返回 ");
LogUtil.error(Name + " CheckFixture " + " 不在空闲中,直接返回 ");
return;
}
if (MoveInfo.MoveType.Equals(LineMoveType.None))
......@@ -190,7 +190,7 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.HY_TrayCheck).Equals(IO_VALUE.HIGH))
{
trayCheck2LowWait.Stop();
if (TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, true))
if (CheckStopWatch(trayCheckWait, TrayWaitTime, true))
{
//托盘在工位阻挡处
MoveInfo.NewMove(LineMoveType.CheckFixture);
......@@ -205,8 +205,8 @@ namespace OnlineStore.DeviceLibrary
}
else if (Config.DIList.ContainsKey(IO_Type.HY_FrontStopCheck) && IOValue(IO_Type.HY_FrontStopCheck).Equals(IO_VALUE.HIGH))
{
bool check2IsOk = TrayManager.checkWatch(trayCheck2LowWait, TrayManager.SwTrayWaitTime, false);
if (TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, false) && check2IsOk)
bool check2IsOk = CheckStopWatch(trayCheck2LowWait, TrayWaitTime, false);
if (CheckStopWatch(trayCheckWait, TrayWaitTime, false) && check2IsOk)
{
//托盘在前阻挡处
trayCheckWait.Stop();
......@@ -225,8 +225,8 @@ namespace OnlineStore.DeviceLibrary
}
else if (Config.IsOutLineOut.Equals(1) && IOValue(IO_Type.HY_OL_Tray_Check).Equals(IO_VALUE.HIGH))
{
bool check2IsOk = TrayManager.checkWatch(trayCheck2LowWait, TrayManager.SwTrayWaitTime, false);
if (TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, false) && check2IsOk)
bool check2IsOk = CheckStopWatch(trayCheck2LowWait, TrayWaitTime, false);
if (CheckStopWatch(trayCheckWait, TrayWaitTime, false) && check2IsOk)
{
//托盘在前阻挡处
trayCheckWait.Stop();
......@@ -241,7 +241,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
bool check2IsOk = TrayManager.checkWatch(trayCheck2LowWait, TrayManager.SwTrayWaitTime, false);
bool check2IsOk = CheckStopWatch(trayCheck2LowWait, TrayWaitTime, false);
trayCheckWait.Stop();
}
......@@ -249,7 +249,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error(Name + " StartCheckFixture " + " 出错:" + ex.ToString());
LogUtil.error(Name + " CheckFixture " + " 出错:" + ex.ToString());
}
finally
{
......@@ -258,11 +258,11 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.error(Name + " StartCheckFixture " + "失败,未得到锁");
LogUtil.error(Name + " CheckFixture " + "失败,未得到锁");
}
}
protected override void CheckFixtureProcess()
protected override void FixtureProcess()
{
if (MoveInfo.IsInWait)
{
......@@ -352,6 +352,11 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(MoveInfo, IO_Type.HY_TopCylinder_Up, IO_Type.HY_TopCylinder_Down);
HY_StopCylinderUp(MoveInfo);
OL_StopCylinderUp(MoveInfo);
int lineId = DeviceID % 100;
LogInfo("C1线->出料线 【" + MoveInfo.MoveParam.ToShortStr() + "】" + MoveInfo.SLog + " 更新料盘位置【" + MoveInfo.MoveParam.WareCode + "】【INBELT】【" + lineId + "】");
//更新料盘位置
SServerManager.UpdateTrayLoc(Name, MoveInfo.MoveParam.WareCode, LocStatus.INBELT, lineId.ToString());
}
else if (MoveInfo.IsStep(LineMoveStep.HY35_IOL_TopDown))
{
......@@ -660,7 +665,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("TrayNeed 出错:" + ex.ToString());
LogUtil.error(Name+"TrayNeed 出错:" + ex.ToString());
}
return false;
}
......@@ -695,18 +700,20 @@ namespace OnlineStore.DeviceLibrary
SServerManager.cancelPutInTask(Name, trayInfo.InoutPar.WareCode);
}
MoveInfo.MoveParam = inoup;
return true ;
}
else if (trayInfo.InOrOutStore.Equals(ReelType.OutStore) && inoup.urgentReel.Equals(false) && inoup.cutReel.Equals(false))
{
LogInfo(" 托盘需要横移到出料线:工单出库料" + "" + inoup.ToStr());
MoveInfo.MoveParam = inoup;
return true;
}
}
}
}
catch (Exception ex)
{
LogUtil.error("TrayNeed 出错:" + ex.ToString());
LogUtil.error(Name+"TrayNeedToOutLine 出错:" + ex.ToString());
}
return false;
}
......
......@@ -151,7 +151,7 @@ namespace OnlineStore.DeviceLibrary
{
if (LineManager.Line.CanProcessLine())
{
StartCheckFixture();
CheckFixture();
}
}
else
......@@ -162,9 +162,9 @@ namespace OnlineStore.DeviceLibrary
}
else
{
TrayManager.checkWatch(trayCheck2LowWait, 30000, false);
CheckStopWatch(trayCheck2LowWait, 30000, false);
}
CheckFixtureProcess();
FixtureProcess();
}
}
......@@ -172,7 +172,7 @@ namespace OnlineStore.DeviceLibrary
private Stopwatch trayCheckWait = new Stopwatch();
private Stopwatch trayCheck2LowWait = new Stopwatch();
private object lockObj = "";
private void StartCheckFixture()
private void CheckFixture()
{
if (Monitor.TryEnter(lockObj, 100))
{
......@@ -180,7 +180,7 @@ namespace OnlineStore.DeviceLibrary
{
if (MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
LogUtil.error(Name + " StartCheckFixture " + " 不在空闲中,直接返回 ");
LogUtil.error(Name + " CheckFixture " + " 不在空闲中,直接返回 ");
return;
}
if (MoveInfo.MoveType.Equals(LineMoveType.None))
......@@ -188,7 +188,7 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.HY_TrayCheck).Equals(IO_VALUE.HIGH))
{
trayCheck2LowWait.Stop();
if (TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, true))
if (CheckStopWatch(trayCheckWait, TrayWaitTime, true))
{
MoveInfo.NewMove(LineMoveType.CheckFixture);
if (Config.IsSideWayIn.Equals(1))
......@@ -216,10 +216,10 @@ namespace OnlineStore.DeviceLibrary
}
else
{
bool check2IsOk = TrayManager.checkWatch(trayCheck2LowWait, TrayManager.SwTrayWaitTime, false);
bool check2IsOk = CheckStopWatch(trayCheck2LowWait, TrayWaitTime, false);
if (IOValue(IO_Type.HY_FrontStopCheck).Equals(IO_VALUE.HIGH))
{
if (TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, false) && check2IsOk)
if (CheckStopWatch(trayCheckWait, TrayWaitTime, false) && check2IsOk)
{
trayCheckWait.Stop();
trayCheck2LowWait.Stop();
......@@ -243,7 +243,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error(Name + " StartCheckFixture " + " 出错:" + ex.ToString());
LogUtil.error(Name + " CheckFixture " + " 出错:" + ex.ToString());
}
finally
{
......@@ -252,11 +252,11 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.error(Name + " StartCheckFixture " + "失败,未得到锁");
LogUtil.error(Name + " CheckFixture " + "失败,未得到锁");
}
}
protected override void CheckFixtureProcess()
protected override void FixtureProcess()
{
if (MoveInfo.IsInWait)
{
......
using OnlineStore.LoadCSVLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 接驳台横移
/// 接驳台横移, SMove处理托盘,Move处理料盘移栽
/// </summary>
public class HY_Coveryor:HYEquipBase
public partial class HY_Coveryor : HYEquipBase
{
public HY_Coveryor(string cid, HYEquip_Config config) : base(cid, config)
{
Name = (" JHY" + (DeviceID % 100).ToString().PadLeft(2, '0') + " ").ToUpper();
}
public override bool StartRun(bool isDebug = false)
{
if (CanStartRun().Equals(false))
......@@ -32,7 +34,6 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.EndMove();
SecondMoveInfo.EndMove();
runStatus = LineRunStatus.HomeMoving;
LogInfo("开始 原点返回 ");
MoveInfo.NewMove(LineMoveType.ReturnHome);
StartReset();
if (isDebug)
......@@ -48,7 +49,6 @@ namespace OnlineStore.DeviceLibrary
{
return false;
}
LogInfo("开始重置: 升降轴回原点,阻挡气缸上升 ");
runStatus = LineRunStatus.Reset;
SecondMoveInfo.EndMove();
MoveInfo.NewMove(LineMoveType.Reset);
......@@ -58,24 +58,16 @@ namespace OnlineStore.DeviceLibrary
private void StartReset()
{
ResetClearData();
MoveInfo.NextMoveStep(LineMoveStep.HY_R_01StopMove);
if (IsDebug)
{
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.HIGH);
IOMove(IO_Type.HY_StopDown, IO_VALUE.HIGH);
}
else
{
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW);
IOMove(IO_Type.HY_StopDown, IO_VALUE.LOW);
}
LineStop();
ResetClearData();
MoveInfo.NextMoveStep(LineMoveStep.JHY_R01_UpdownHome);
LogInfo(MoveInfo.MoveType + " " + MoveInfo.MoveStep + ": 电机停止,升降轴回原点,阻挡上升,定位气缸下降,顶升气缸下降");
LineStop(MoveInfo);
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW);
CylinderMove(MoveInfo, IO_Type.HY_TopCylinder_Up, IO_Type.HY_TopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.HY_LocationCylinder_Up, IO_Type.HY_LocationCylinder_Down);
CylinderMove(MoveInfo, IO_Type.HY_StopCylinder_Down, IO_Type.HY_StopCylinder_Up);
LocationCylinderDown(MoveInfo);
UpdownAxis.HomeMove(MoveInfo);
isInPro = false;
}
......@@ -84,53 +76,58 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.IsInWait)
{
CheckWait(MoveInfo);
}
if (!MoveInfo.IsInWait )
}
if (!MoveInfo.IsInWait)
{
//流水线各装置复原位,夹料气缸状态不变
//阻挡气缸全部=0
//上下气缸上升,、
//上升到位,顶升气缸下降,前后气缸回退
//复位时夹紧气缸需要发送,不然后面出入库会有问题
switch (MoveInfo.MoveStep)
if (MoveInfo.IsStep(LineMoveStep.JHY_R01_UpdownHome))
{
MoveInfo.NextMoveStep(LineMoveStep.JHY_R02_UpdownUp);
LogInfo(MoveInfo.MoveType + " " + MoveInfo.MoveStep + ": 升降轴到P1");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
}
else if (MoveInfo.IsStep(LineMoveStep.JHY_R02_UpdownUp))
{
MoveInfo.NextMoveStep(LineMoveStep.JHY_R03_LocationDown);
LogInfo(MoveInfo.MoveType + " " + MoveInfo.MoveStep + ": 接驳台取料端");
CylinderMove(MoveInfo, IO_Type.HY_MoveCylinder_Give, IO_Type.HY_MoveCylinder_Take);
}
else if (MoveInfo.IsStep(LineMoveStep.JHY_R03_LocationDown))
{
MoveInfo.NextMoveStep(LineMoveStep.JHY_R04_TopDown);
LogInfo(MoveInfo.MoveType + " " + MoveInfo.MoveStep + ": 夹紧气缸放松");
CylinderMove(MoveInfo, IO_Type.HY_ClampCylinder_Work, IO_Type.HY_ClampCylinder_Relax);
}
else if (MoveInfo.IsStep(LineMoveStep.JHY_R04_TopDown))
{
case LineMoveStep.HY_R_01StopMove:
LogInfo(MoveInfo.MoveType + " 完成!");
runStatus = LineRunStatus.Runing;
MoveInfo.EndMove();
SecondMoveInfo.EndMove();
break;
default: break;
MoveInfo.NextMoveStep(LineMoveStep.JHY_R05_ClampCheck);
LogInfo(MoveInfo.MoveType + " " + MoveInfo.MoveStep + ": 等待夹爪无信号");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampCylinder_Check, IO_VALUE.LOW));
}
else if (MoveInfo.IsStep(LineMoveStep.JHY_R05_ClampCheck))
{
LogInfo(MoveInfo.MoveType + " 完成!");
runStatus = LineRunStatus.Runing;
MoveInfo.EndMove();
SecondMoveInfo.EndMove();
}
else
{
LogUtil.error(Name + " ResetProcess 未找到[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "]的处理");
}
}
}
/// <summary>
/// 停止运动
/// </summary>
internal override void StopMove()
{
//trayCheck2LowWait.Stop();
//trayCheckWait.Stop();
//如果正在出库中,需要减去托盘号
if (MoveInfo.MoveType.Equals(LineMoveType.OutStore))
{
DebugInfo("停止运动时出库执行中,减去托盘数;");
//减去需要的盘数
// TrayManager.DelNeedEmptyTrayNum();
MoveInfo.EndMove();
}
runStatus = LineRunStatus.Busy;
LogInfo("停止运动:电机停止,阻挡上升,定位气缸下降,顶升气缸下降 ");
MoveInfo.EndMove();
SecondMoveInfo.EndMove();
LogInfo("停止运动:上下气缸上升端,阻挡气缸上升 ");
//UpdownUpMove();
CylinderMove(MoveInfo, IO_Type.TopCylinder_Up, IO_Type.TopCylinder_Down);
IOMove(IO_Type.StopDown1, IO_VALUE.LOW);
IOMove(IO_Type.StopDown2, IO_VALUE.LOW);
}
LineStop();
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW);
CylinderMove(null, IO_Type.HY_LocationCylinder_Up, IO_Type.HY_LocationCylinder_Down);
CylinderMove(null, IO_Type.HY_TopCylinder_Up, IO_Type.HY_TopCylinder_Down);
}
public override void StopRun()
{
if (mainTimer != null)
......@@ -138,47 +135,39 @@ namespace OnlineStore.DeviceLibrary
mainTimer.Enabled = false;
}
StopMove();
//停止运行时,把所有IO 置零
CheckAndMove(IO_Type.StopDown1, IO_VALUE.LOW);
CheckAndMove(IO_Type.StopDown2, IO_VALUE.LOW);
CheckAndMove(IO_Type.TopCylinder_Up, IO_VALUE.LOW);
CheckAndMove(IO_Type.TopCylinder_Down, IO_VALUE.LOW);
CheckAndMove(IO_Type.BeforeAfterCylinder_Before, IO_VALUE.LOW);
CheckAndMove(IO_Type.BeforeAfterCylinder_After, IO_VALUE.LOW);
if (UseAxis.Equals(false))
{
CheckAndMove(IO_Type.UpDownCylinder_Up, IO_VALUE.LOW);
CheckAndMove(IO_Type.UpDownCylinder_Down, IO_VALUE.LOW);
}
CheckAndMove(IO_Type.ClampCylinder_Work, IO_VALUE.LOW);
CheckAndMove(IO_Type.ClampCylinder_Relax, IO_VALUE.LOW);
runStatus = LineRunStatus.Wait;
}
private int GetRobotIndex()
{
int robotIndex = 1;
if (DeviceID.Equals(212))
{
robotIndex = 2;
}
return robotIndex;
}
protected override void BaseTimerProcess()
{
if (isInSuddenDown || isNoAirCheck)
{
return;
}
IOTimeOutProcess();
}
IOTimeOutProcess();
BusyMoveProcess();
if (MoveInfo.MoveType.Equals(LineMoveType.None))
{
if (LineManager.Line.CanProcessLine())
{
StartCheckFixture();
{
CheckFixture();
}
}
}
}
private void StartCheckFixture()
{
}
protected override void CheckFixtureProcess()
{
}
}
}
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
partial class HY_Coveryor
{
#region 托盘检测处理
private Stopwatch trayCheckWait = new Stopwatch();
private Stopwatch trayCheckLowWait = new Stopwatch();
private object lockObj = "";
private void CheckFixture()
{
if (Monitor.TryEnter(lockObj, 100))
{
try
{
if (SecondMoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
if (IOValue(IO_Type.HY_TrayCheck).Equals(IO_VALUE.HIGH))
{
trayCheckLowWait.Stop();
}
else
{
CheckStopWatch(trayCheckLowWait, 30000, false);
}
LogUtil.error(Name + " CheckFixture " + " 不在空闲中,直接返回 ");
return;
}
if (SecondMoveInfo.MoveType.Equals(LineMoveType.None))
{
bool canpro = true;
if (IOValue(IO_Type.HY_TrayCheck).Equals(IO_VALUE.HIGH))
{
trayCheckLowWait.Stop();
if (canpro && CheckStopWatch(trayCheckWait, TrayWaitTime, true))
{
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_05_TrayCheck);
CheckLog("接驳台托盘" + SecondMoveInfo.SLog + "前阻挡上升,等待托盘到位 ");
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_FrontStopDown, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.HIGH));
}
}
else
{
bool check2IsOk = CheckStopWatch(trayCheckLowWait, TrayWaitTime, false);
if (IOValue(IO_Type.HY_FrontStopCheck).Equals(IO_VALUE.HIGH))
{
if (CheckStopWatch(trayCheckWait, TrayWaitTime, false) && check2IsOk && canpro)
{
trayCheckWait.Stop();
trayCheckLowWait.Stop();
//托盘在第一个阻挡处
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_01_TrayCheck);
CheckLog(" 接驳台托盘" + SecondMoveInfo.SLog + ":前阻挡检测到托盘");
ClearTrayRFID();
SecondMoveInfo.OneWaitCanEndStep = true;
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_FrontStopCheck, IO_VALUE.HIGH));
}
}
else
{
trayCheckWait.Stop();
}
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + " CheckFixture " + " 出错:" + ex.ToString());
}
finally
{
Monitor.Exit(lockObj);
}
}
else
{
LogUtil.error(Name + " CheckFixture " + "失败,未得到锁");
}
}
private bool IsNgPro()
{
if (DeviceID.Equals(217))
{
return true;
}
return false;
}
protected override void FixtureProcess()
{
if (!LineManager.Line.LineCanRun())
{
return;
}
if (SecondMoveInfo.IsInWait)
{
CheckWait(SecondMoveInfo);
}
if (SecondMoveInfo.IsInWait)
{
return;
}
if (SecondMoveInfo.IsStep(LineMoveStep.JHY_01_TrayCheck))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_02_TopMove);
if (IsNgPro())
{
CheckLog(" 接驳台托盘" + SecondMoveInfo.SLog + ":顶升气缸上升 ");
CylinderMove(SecondMoveInfo, IO_Type.HY_TopCylinder_Down, IO_Type.HY_TopCylinder_Up);
LineRun(SecondMoveInfo);
}
else
{
CheckLog(" 接驳台托盘" + SecondMoveInfo.SLog + ":顶升气缸下降 ");
CylinderMove(SecondMoveInfo, IO_Type.HY_TopCylinder_Up, IO_Type.HY_TopCylinder_Down);
LineRun(SecondMoveInfo);
}
}
else if (SecondMoveInfo.IsStep(LineMoveStep.JHY_02_TopMove))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_03_StopDown);
CheckLog(" 接驳台托盘" + SecondMoveInfo.SLog + ":前阻挡下降,电机正转");
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.HIGH, 1200);
LineRun(SecondMoveInfo);
}
else if (SecondMoveInfo.IsStep(LineMoveStep.JHY_03_StopDown))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_04_WaitTray);
CheckLog(" 接驳台托盘" + SecondMoveInfo.SLog + ":等待托盘检测信号");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.HIGH));
}
else if (SecondMoveInfo.IsStep(LineMoveStep.JHY_04_WaitTray))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_05_TrayCheck);
CheckLog(" 接驳台托盘" + SecondMoveInfo.SLog + ":前阻挡上升,等待托盘检测信号500ms");
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.HIGH));
}
else if (SecondMoveInfo.IsStep(LineMoveStep.JHY_05_TrayCheck))
{
//读取托盘号
UpdateTrayNum();
if (ReedNeedMove())
{
JHY_06_GetTraySize();
}
else
{
JHY_11_TopDown();
}
}
else if (SecondMoveInfo.IsStep(LineMoveStep.JHY_07_TopUp))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_08_LocationUp);
CheckLog(" 接驳台托盘" + SecondMoveInfo.SLog + ":料盘需要横移,定位上升");
LocationCylinderUp(SecondMoveInfo);
}
else if (SecondMoveInfo.IsStep(LineMoveStep.JHY_08_LocationUp))
{
if (MoveInfo.MoveType.Equals(LineMoveType.None))
{
bool result = StartOutStoreMove(SecondMoveInfo.MoveParam);
if (result)
{
ClearTimeoutAlarm("等待移栽机构空闲超时");
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_09_WaitProcessReel);
CheckLog(" 接驳台托盘" + SecondMoveInfo.SLog + ":等待拿走料盘" + MoveInfo.MoveParam.ToShortStr());
}
else if (SecondMoveInfo.IsTimeOut())
{
WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待移栽机构开始抓料超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 30);
Alarm(LineAlarmType.IoSingleTimeOut);
}
}
else if (SecondMoveInfo.IsTimeOut())
{
WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待移栽机构开始抓料超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 30);
Alarm(LineAlarmType.IoSingleTimeOut);
}
}
else if (SecondMoveInfo.IsStep(LineMoveStep.JHY_10_ReelProEnd))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_11_TopDown);
CheckLog(" 接驳台托盘放行" + SecondMoveInfo.SLog + ":阻挡上升,顶升气缸下降,定位气缸下降");
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW);
LocationCylinderDown(SecondMoveInfo);
if (IsNgPro())
{
CylinderMove(SecondMoveInfo, IO_Type.HY_TopCylinder_Up, IO_Type.HY_TopCylinder_Down);
}
else
{
CylinderMove(SecondMoveInfo, IO_Type.HY_TopCylinder_Down, IO_Type.HY_TopCylinder_Up);
}
}
else if (SecondMoveInfo.IsStep(LineMoveStep.JHY_11_TopDown))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_12_WaitTrayLeave);
CheckLog(" 接驳台托盘放行" + SecondMoveInfo.SLog + ":等待托盘检测无信号");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.LOW));
}
else if (SecondMoveInfo.IsStep(LineMoveStep.JHY_12_WaitTrayLeave))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_13_TrayLeave);
CheckLog(" 接驳台托盘放行" + SecondMoveInfo.SLog + ":等待500ms,托盘检测无信号");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.LOW));
}
else if (SecondMoveInfo.IsStep(LineMoveStep.JHY_14_TopDown))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_11_TopDown);
CheckLog(" 接驳台托盘放行" + SecondMoveInfo.SLog + ":顶升气缸下降");
CylinderMove(SecondMoveInfo, IO_Type.HY_TopCylinder_Up, IO_Type.HY_TopCylinder_Down);
}
else if (SecondMoveInfo.IsStep(LineMoveStep.JHY_14_TopDown))
{
CheckLog(" 接驳台托盘放行结束");
SecondMoveInfo.EndMove();
}
else
{
LogUtil.error(Name + "FixtureProcess 未找到[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "]的处理");
}
}
private void JHY_11_TopDown()
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_11_TopDown);
CheckLog(" 接驳台托盘放行" + SecondMoveInfo.SLog + ":阻挡上升,顶升气缸下降");
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW);
if (IsNgPro())
{
CylinderMove(SecondMoveInfo, IO_Type.HY_TopCylinder_Up, IO_Type.HY_TopCylinder_Down);
}
else
{
CylinderMove(SecondMoveInfo, IO_Type.HY_TopCylinder_Down, IO_Type.HY_TopCylinder_Up);
}
}
private int LastWidth = 0;
private void JHY_06_GetTraySize()
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_06_GetTraySize);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
LastWidth = 0;
int robotIndex = GetRobotIndex();
string code = SecondMoveInfo.MoveParam.WareCode;
string result = SServerManager.GetTraySize(Name, robotIndex, code, out LastWidth);
LogUtil.info(Name + MoveInfo.SLog + "接驳台托盘[" + currTrayNum + "] [" + code + "] 获取尺寸【" + LastWidth + "】【" + result + "】");
if (LastWidth > 0)
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_07_TopUp);
CheckLog(" 接驳台托盘" + SecondMoveInfo.SLog + ":顶升气缸上升");
CylinderMove(SecondMoveInfo, IO_Type.HY_TopCylinder_Down, IO_Type.HY_TopCylinder_Up);
}
else
{
JHY_11_TopDown();
}
}
private void JHY_10_ReelProEnd()
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_10_ReelProEnd);
LogUtil.info(Name + " 接驳台托盘" + SecondMoveInfo.SLog + ":托盘已离开,更新托盘[" + currTrayNum + "]为空");
TrayManager.UpdateTrayInfo(currTrayNum);
}
private bool ReedNeedMove()
{
try
{
if (currTrayNum > 0)
{
//TODO
TrayInfo trayInfo = TrayManager.GetTrayInfo(currTrayNum);
if (!trayInfo.IsFull)
{
return false;
}
InOutParam inoup = trayInfo.InoutPar;
if (trayInfo.IsFull && trayInfo.InoutPar.InStoreNg && this.DeviceID.Equals(217))
{
LogInfo(" 托盘需要移栽到NG箱:入料NG料" + "" + inoup.ToStr());
//如果分配了库位,需要调用取消
if (trayInfo.InoutPar.WareCode != "" && trayInfo.InoutPar.PosId != "")
{
SServerManager.cancelPutInTask(Name, trayInfo.InoutPar.WareCode);
}
SecondMoveInfo.MoveParam = inoup;
MoveInfo.MoveParam = inoup;
return true;
}
else if (trayInfo.InOrOutStore.Equals(ReelType.OutStore) && inoup.urgentReel.Equals(false) && inoup.cutReel.Equals(false))
{
LogInfo(" 托盘需要横移到出料线:工单出库料" + "" + inoup.ToStr());
SecondMoveInfo.MoveParam = inoup;
MoveInfo.MoveParam = inoup;
return true;
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + "ReedNeedMove 出错:" + ex.ToString());
}
return false;
}
#endregion
#region 接驳台送料
public override bool StartOutStoreMove(InOutParam param)
{
if (param.Equals(null))
{
LogUtil.error(Name + "托盘移栽【" + param.ToShortStr() + "】失败,param=null");
return false;
}
if (MoveInfo.MoveType.Equals(LineMoveType.None))
{
if (String.IsNullOrEmpty(logName))
{
logName = "工单出料:";
if (IsNgPro())
{
logName = "NG料:";
}
}
runStatus = LineRunStatus.Busy;
MoveInfo.NewMove(LineMoveType.OutStore);
MoveInfo.MoveParam = param;
MoveInfo.NextMoveStep(LineMoveStep.JM_01_UpdownToP1);
OutLog("托盘移栽【" + param.ToShortStr() + "】升降气缸上升 ");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
return true;
}
else
{
LogUtil.error(Name + " 启动托盘移栽【" + param.ToShortStr() + "】失败,MoveInfo.MoveType=" + MoveInfo.MoveType);
return false;
}
}
string logName = "";
protected override void OutStoreProcess()
{
if (MoveInfo.IsInWait)
{
CheckWait(MoveInfo);
}
if (MoveInfo.IsInWait)
{
return;
}
if (MoveInfo.IsStep(LineMoveStep.JM_01_UpdownToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.JM_02_CylinderTake);
OutLog(logName + MoveInfo.SLog + ":横移气缸取料端 ");
CylinderMove(MoveInfo, IO_Type.HY_MoveCylinder_Give, IO_Type.HY_MoveCylinder_Take);
}
else if (MoveInfo.IsStep(LineMoveStep.JM_02_CylinderTake))
{
int p2 = Config.GetUpdownP2(MoveInfo.MoveParam.PlateH);
MoveInfo.NextMoveStep(LineMoveStep.JM_03_UpdownToP2);
OutLog(logName + MoveInfo.SLog + ":升降轴下降到取料点P2 [" + p2 + "]");
UpdownAxis.AbsMove(MoveInfo, p2, Config.UpdownAxis_P2Speed);
}
else if (MoveInfo.IsStep(LineMoveStep.JM_03_UpdownToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.JM_04_DownWait);
OutLog(logName + MoveInfo.SLog + ":等待0.3秒后再夹紧 ");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
}
else if (MoveInfo.IsStep(LineMoveStep.JM_04_DownWait))
{
MoveInfo.NextMoveStep(LineMoveStep.JM_05_ClampWork);
OutLog(logName + MoveInfo.SLog + ":夹料气缸夹紧 ");
CylinderMove(MoveInfo, IO_Type.HY_ClampCylinder_Relax, IO_Type.HY_ClampCylinder_Work);
}
else if (MoveInfo.IsStep(LineMoveStep.JM_05_ClampWork))
{
MoveInfo.NextMoveStep(LineMoveStep.JM_06_UpdownToP1);
OutLog(logName + MoveInfo.SLog + ":升降轴到P1 ");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
}
else if (MoveInfo.IsStep(LineMoveStep.JM_06_UpdownToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.JM_07_ClampCheck);
OutLog(logName + MoveInfo.SLog + ":夹爪料盘检测有料 ");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_ClampCylinder_Check, IO_VALUE.HIGH));
}
else if (MoveInfo.IsStep(LineMoveStep.JM_07_ClampCheck))
{
//托盘可以离开
JHY_10_ReelProEnd();
MoveInfo.NextMoveStep(LineMoveStep.JM_10_WaitJNoReel);
OutLog(logName + MoveInfo.SLog + ":等待接驳台无料 ");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck1, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck2, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck3, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck4, IO_VALUE.LOW));
}
else if (MoveInfo.IsStep(LineMoveStep.JM_10_WaitJNoReel))
{
MoveInfo.NextMoveStep(LineMoveStep.JM_11_CylinderGive);
OutLog(logName + MoveInfo.SLog + ":接驳台气缸放料 ");
CylinderMove(MoveInfo, IO_Type.HY_MoveCylinder_Take, IO_Type.HY_MoveCylinder_Give);
}
else if (MoveInfo.IsStep(LineMoveStep.JM_11_CylinderGive))
{
int p3 = Config.GetUpdownP3(MoveInfo.MoveParam.PlateH);
MoveInfo.NextMoveStep(LineMoveStep.JM_12_UpdownToP3);
OutLog(logName + MoveInfo.SLog + ":升降轴下降到P3 [" + p3 + "]");
UpdownAxis.AbsMove(MoveInfo, p3, Config.UpdownAxis_P3Speed);
}
else if (MoveInfo.IsStep(LineMoveStep.JM_12_UpdownToP3))
{
MoveInfo.NextMoveStep(LineMoveStep.JM_13_ClampRelax);
OutLog(logName + MoveInfo.SLog + ":夹料气缸放松 ");
CylinderMove(MoveInfo, IO_Type.HY_ClampCylinder_Work, IO_Type.HY_ClampCylinder_Relax);
}
else if (MoveInfo.IsStep(LineMoveStep.JM_13_ClampRelax))
{
MoveInfo.NextMoveStep(LineMoveStep.JM_14_UpdownToP1);
OutLog(logName + MoveInfo.SLog + ":升降轴上升到P1 ");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
}
else if (MoveInfo.IsStep(LineMoveStep.JM_14_UpdownToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.JM_15_ClampCheck);
OutLog(logName + MoveInfo.SLog + ":夹爪料盘检测无料,接驳台有料 ");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_ClampCylinder_Check, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck1, IO_VALUE.HIGH));
}
else if (MoveInfo.IsStep(LineMoveStep.JM_15_ClampCheck))
{
MoveInfo.NextMoveStep(LineMoveStep.JM_16_ReelArrive);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(30000));
CylinderMove(null, IO_Type.HY_MoveCylinder_Give, IO_Type.HY_MoveCylinder_Take);
string code = MoveInfo.MoveParam.WareCode;
int robotIndex = GetRobotIndex();
LogUtil.info(Name + MoveInfo.SLog + logName+ "送料,接驳台有料,调用arriveRobotLocation=" + robotIndex + "[" + code + "]");
string msg = SServerManager.arriveRobotLocation(Name, robotIndex, code);
MoveInfo.EndMove();
}
else if (MoveInfo.IsStep(LineMoveStep.JM_16_ReelArrive))
{
MoveInfo.NextMoveStep(LineMoveStep.JM_17_CylinderTake);
OutLog(logName + MoveInfo.SLog + ":接驳台气缸取料端 ");
CylinderMove(MoveInfo, IO_Type.HY_MoveCylinder_Give, IO_Type.HY_MoveCylinder_Take);
}
else if (MoveInfo.IsStep(LineMoveStep.JM_17_CylinderTake))
{
MoveInfo.EndMove();
OutLog(logName + MoveInfo.SLog + ":结束 ");
}
}
#endregion
}
}
......@@ -118,7 +118,7 @@ namespace OnlineStore.DeviceLibrary
{
if (LineManager.Line.CanProcessLine())
{
StartCheckFixture();
CheckFixture();
}
}
else
......@@ -129,9 +129,9 @@ namespace OnlineStore.DeviceLibrary
}
else
{
TrayManager.checkWatch(trayCheck2LowWait, 30000, false);
CheckStopWatch(trayCheck2LowWait, 30000, false);
}
CheckFixtureProcess();
FixtureProcess();
}
}
......@@ -139,7 +139,7 @@ namespace OnlineStore.DeviceLibrary
private Stopwatch trayCheckWait = new Stopwatch();//检测到托盘的时间
private Stopwatch trayCheck2LowWait = new Stopwatch();//上一个托盘离开的时间
private object lockObj = "";
private void StartCheckFixture()
private void CheckFixture()
{
if (Monitor.TryEnter(lockObj, 100))
{
......@@ -147,7 +147,7 @@ namespace OnlineStore.DeviceLibrary
{
if (MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
LogUtil.error(Name + " StartCheckFixture " + " 不在空闲中,直接返回 ");
LogUtil.error(Name + " CheckFixture " + " 不在空闲中,直接返回 ");
return;
}
if (MoveInfo.MoveType.Equals(LineMoveType.None))
......@@ -163,8 +163,8 @@ namespace OnlineStore.DeviceLibrary
{
if (Config.DIList.ContainsKey(IO_Type.HY_LongL_StopCheck) && IOValue(IO_Type.HY_LongL_StopCheck).Equals(IO_VALUE.HIGH))
{
bool check2IsOk = TrayManager.checkWatch(trayCheck2LowWait, TrayManager.SwTrayWaitTime, false);
if (TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, false) && check2IsOk)
bool check2IsOk = CheckStopWatch(trayCheck2LowWait, TrayWaitTime, false);
if (CheckStopWatch(trayCheckWait, TrayWaitTime, false) && check2IsOk)
{
//托盘在前阻挡处
trayCheckWait.Stop();
......@@ -178,8 +178,8 @@ namespace OnlineStore.DeviceLibrary
}
else if (Config.DIList.ContainsKey(IO_Type.HY_ShortL_StopCheck) && IOValue(IO_Type.HY_ShortL_StopCheck).Equals(IO_VALUE.HIGH))
{
bool check2IsOk = TrayManager.checkWatch(trayCheck2LowWait, TrayManager.SwTrayWaitTime, false);
if (TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, false) && check2IsOk)
bool check2IsOk = CheckStopWatch(trayCheck2LowWait, TrayWaitTime, false);
if (CheckStopWatch(trayCheckWait, TrayWaitTime, false) && check2IsOk)
{
//托盘在前阻挡处
trayCheckWait.Stop();
......@@ -193,7 +193,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
bool check2IsOk = TrayManager.checkWatch(trayCheck2LowWait, TrayManager.SwTrayWaitTime, false);
bool check2IsOk = CheckStopWatch(trayCheck2LowWait, TrayWaitTime, false);
trayCheckWait.Stop();
}
}
......@@ -201,7 +201,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error(Name + " StartCheckFixture " + " 出错:" + ex.ToString());
LogUtil.error(Name + " CheckFixture " + " 出错:" + ex.ToString());
}
finally
{
......@@ -210,11 +210,11 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.error(Name + " StartCheckFixture " + "失败,未得到锁");
LogUtil.error(Name + " CheckFixture " + "失败,未得到锁");
}
}
protected override void CheckFixtureProcess()
protected override void FixtureProcess()
{
if (MoveInfo.IsInWait)
{
......
......@@ -196,15 +196,15 @@ namespace OnlineStore.DeviceLibrary
//System.IndexOutOfRangeException: 索引超出了数组界限。
// 在 System.Collections.Generic.List`1.Enumerator.MoveNext()
// 在 OnlineStore.DeviceLibrary.LineBean.CheckWait(LineMoveInfo checkWaitInfo) 位置 E:\VSSource\RC1250_佳士达\RC1250-AssemblyLine\source\DeviceLibrary\assemblyLine\LineBean_Partial.cs:行号 89
if (ex is System.IndexOutOfRangeException)
{
if (checkWaitInfo.IsStep(LineMoveStep.SW06_TopCylinderUp))
{
LogUtil.error(checkWaitInfo.Name + " 当前步骤:SW06_TopCylinderUp,IndexOutOfRangeException异常,自动回到上一个步骤 SW05_LocationDown,等待500 重新开始 ");
checkWaitInfo.NextMoveStep(LineMoveStep.SW05_LocationDown);
checkWaitInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
}
}
//if (ex is System.IndexOutOfRangeException)
//{
// if (checkWaitInfo.IsStep(LineMoveStep.SW06_TopCylinderUp))
// {
// LogUtil.error(checkWaitInfo.Name + " 当前步骤:SW06_TopCylinderUp,IndexOutOfRangeException异常,自动回到上一个步骤 SW05_LocationDown,等待500 重新开始 ");
// checkWaitInfo.NextMoveStep(LineMoveStep.SW05_LocationDown);
// checkWaitInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
// }
//}
}
}
#endregion
......
......@@ -60,7 +60,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
TrayManager.checkWatch(trayCheck2LowWait, 30000, false);
CheckStopWatch(trayCheck2LowWait, 30000, false);
}
T3C1_BusyProcess();
}
......@@ -91,7 +91,7 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.HY_TrayCheck).Equals(IO_VALUE.HIGH))
{
trayCheck2LowWait.Stop();
if ( TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, true))
if ( CheckStopWatch(trayCheckWait, TrayWaitTime, true))
{
T3C1_MoveInfo.NewMove(LineMoveType.CheckFixture);
T3C1_MoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopUp);
......@@ -106,10 +106,10 @@ namespace OnlineStore.DeviceLibrary
}
else
{
bool check2IsOk = TrayManager.checkWatch(trayCheck2LowWait, TrayManager.SwTrayWaitTime, false);
bool check2IsOk = CheckStopWatch(trayCheck2LowWait, TrayWaitTime, false);
if (IOValue(IO_Type.HY_FrontStopCheck).Equals(IO_VALUE.HIGH))
{
if (TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, false) && check2IsOk )
if (CheckStopWatch(trayCheckWait, TrayWaitTime, false) && check2IsOk )
{
trayCheckWait.Stop();
trayCheck2LowWait.Stop();
......@@ -133,7 +133,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error(Name + " StartCheckFixture " + " 出错:" + ex.ToString());
LogUtil.error(Name + " CheckFixture " + " 出错:" + ex.ToString());
}
finally
{
......@@ -142,7 +142,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.error(Name + " StartCheckFixture " + "失败,未得到锁");
LogUtil.error(Name + " CheckFixture " + "失败,未得到锁");
}
}
......
......@@ -222,34 +222,7 @@ namespace OnlineStore.DeviceLibrary
CheckAndMove(IO_Type.ClampCylinder_Relax, IO_VALUE.LOW);
runStatus = LineRunStatus.Wait;
}
protected override void BusyMoveProcess()
{
if (MoveStop)
{
return;
}
if (SecondMoveInfo.MoveType.Equals(LineMoveType.CheckFixture))
{
CheckFixtureProcess();
}
if (MoveInfo.MoveType.Equals(LineMoveType.InStore) || this.SecondMoveInfo.MoveType.Equals(LineMoveType.InStore))
{
InStoreProcess();
}
else if (MoveInfo.MoveType.Equals(LineMoveType.OutStore) || SecondMoveInfo.MoveType.Equals(LineMoveType.OutStore))
{
OutStoreProcess();
}
else if (MoveInfo.MoveType.Equals(LineMoveType.ReturnHome))
{
ResetProcess();
}
else if (MoveInfo.MoveType.Equals(LineMoveType.Reset))
{
ResetProcess();
}
}
protected override void BaseTimerProcess()
{
if (isInSuddenDown || isNoAirCheck)
......@@ -262,9 +235,8 @@ namespace OnlineStore.DeviceLibrary
if (SecondMoveInfo.MoveType.Equals(LineMoveType.None))
{
if (LineManager.Line.CanProcessLine())
{
// LogUtil.info("StartCheckFixture");
StartCheckFixture();
{
CheckFixture();
}
}
OutStoreListPro();
......@@ -304,10 +276,7 @@ namespace OnlineStore.DeviceLibrary
waitOutStoreList.Enqueue(param);
}
}
/// <summary>
/// 判断上料横移机构是否可以横移运动
/// </summary>
/// <returns></returns>
public bool CanBeforeAfter()
{
if (UseAxis)
......
......@@ -330,7 +330,7 @@ namespace OnlineStore.DeviceLibrary
{
int num = MoveInfo.MoveParam.TrayNumber;
MoveInfo.NextMoveStep(LineMoveStep.MI_10_WaitBox);
LogInfo("入库【" + posId + "】 " + MoveInfo.SLog + ": 等待box可入库,更新托盘【" + num + "】为空盘,删除入库任务");
LogInfo("入库【" + posId + "】 " + MoveInfo.SLog + ": 物品已移走,更新托盘【" + num + "】为空盘,删除入库任务");
MoveInfo.WaitList.Add(WaitResultInfo.WaitBoxCanReviceTray());
TrayManager.UpdateTrayInfo(num);
RemoveInStore(MoveInfo.MoveParam);
......@@ -620,7 +620,7 @@ namespace OnlineStore.DeviceLibrary
private Stopwatch trayCheckWait = new Stopwatch();
private Stopwatch trayCheck2LowWait = new Stopwatch();
private object lockObj = "";
private void StartCheckFixture()
private void CheckFixture()
{
if (Monitor.TryEnter(lockObj, 100))
{
......@@ -634,9 +634,9 @@ namespace OnlineStore.DeviceLibrary
}
else
{
TrayManager.checkWatch(trayCheck2LowWait, 30000, false);
CheckStopWatch(trayCheck2LowWait, 30000, false);
}
LogUtil.error(Name + " StartCheckFixture " + " 不在空闲中,直接返回 ");
LogUtil.error(Name + " CheckFixture " + " 不在空闲中,直接返回 ");
return;
}
if (SecondMoveInfo.MoveType.Equals(LineMoveType.None))
......@@ -646,7 +646,7 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.StopCheck2).Equals(IO_VALUE.HIGH))
{
trayCheck2LowWait.Stop();
if (canpro && TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, true))
if (canpro && CheckStopWatch(trayCheckWait, TrayWaitTime, true))
{
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopUp);
......@@ -658,10 +658,10 @@ namespace OnlineStore.DeviceLibrary
}
else
{
bool check2IsOk = TrayManager.checkWatch(trayCheck2LowWait, TrayManager.SwTrayWaitTime, false);
bool check2IsOk = CheckStopWatch(trayCheck2LowWait, TrayWaitTime, false);
if (IOValue(IO_Type.StopCheck1).Equals(IO_VALUE.HIGH))
{
if (TrayManager.checkWatch(trayCheckWait, TrayManager.SwTrayWaitTime, false) && check2IsOk && canpro)
if (CheckStopWatch(trayCheckWait, TrayWaitTime, false) && check2IsOk && canpro)
{
trayCheckWait.Stop();
trayCheck2LowWait.Stop();
......@@ -685,7 +685,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error(Name + " StartCheckFixture " + " 出错:" + ex.ToString());
LogUtil.error(Name + " CheckFixture " + " 出错:" + ex.ToString());
}
finally
{
......@@ -694,10 +694,10 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.error(Name + " StartCheckFixture " + "失败,未得到锁");
LogUtil.error(Name + " CheckFixture " + "失败,未得到锁");
}
}
protected override void CheckFixtureProcess()
protected override void FixtureProcess()
{
if (!LineManager.Line.LineCanRun())
{
......
......@@ -209,7 +209,7 @@ namespace OnlineStore.DeviceLibrary
LineBean lineBean = LineManager.Line;
if (LineManager.Line.CanProcessLine())
{
StartCheckFixture();
CheckFixture();
}
}
}
......
......@@ -35,7 +35,7 @@ namespace OnlineStore.DeviceLibrary
private Stopwatch trayCheckWait = new Stopwatch();
private Stopwatch trayCheck2LowWait = new Stopwatch();
private object lockObj = "";
private void StartCheckFixture()
private void CheckFixture()
{
if (Monitor.TryEnter(lockObj, 100))
{
......@@ -43,7 +43,7 @@ namespace OnlineStore.DeviceLibrary
{
if (SecondMoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
LogUtil.error(Name + " StartCheckFixture " + " 不在空闲中,直接返回 ");
LogUtil.error(Name + " CheckFixture " + " 不在空闲中,直接返回 ");
return;
}
//int num = TrayManager.GetTrayNum(DeviceID);
......@@ -91,7 +91,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error(Name + " StartCheckFixture " + " 出错:" + ex.ToString());
LogUtil.error(Name + " CheckFixture " + " 出错:" + ex.ToString());
}
finally
{
......@@ -100,7 +100,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.error(Name + " StartCheckFixture " + "失败,未得到锁");
LogUtil.error(Name + " CheckFixture " + "失败,未得到锁");
}
}
private void MO_14_TopCylinder_Down()
......
......@@ -13,8 +13,6 @@ namespace OnlineStore.DeviceLibrary
{
public class TrayManager
{
public static int SwTrayWaitTime = 500;
public static int StopDownWaitTime = 500;
/// <summary>
/// 托盘集合,key=托盘编号,value=托盘详细信息
/// </summary>
......@@ -176,60 +174,8 @@ namespace OnlineStore.DeviceLibrary
{
TrayInfoMap = new ConcurrentDictionary<int, TrayInfo>();
}
#region 横移状态缓存
//internal static bool LineCanMoveSW(int swNum)
//{
// //若此横移对应的设备未启动,直接可处理
// foreach (FeedingEquip equip in LineManager.Line.FeedingEquipMap.Values)
// {
// if (equip.Config.SidesWayNum.Equals(swNum))
// {
// if (equip.runStatus <= LineRunStatus.Wait || equip.isInSuddenDown || equip.isNoAirCheck)
// {
// return true;
// }
// if (swNum.Equals(2).Equals(false)&& equip.SecondMoveInfo.MoveType.Equals(LineMoveType.None))
// {
// return true;
// }
// break;
// }
// }
// foreach (HYEquipBase equip in LineManager.Line.HYEquipMap.Values)
// {
// if (equip.Config.SidesWayNum.Equals(swNum))
// {
// if (equip.runStatus <= LineRunStatus.Wait || equip.isInSuddenDown || equip.isNoAirCheck)
// {
// return true;
// }
// if (swNum.Equals(4).Equals(false) && equip.SecondMoveInfo.MoveType.Equals(LineMoveType.None))
// {
// return true;
// }
// break;
// }
// }
// return false;
//}
#endregion
public static bool checkWatch(Stopwatch watch, int targetMs, bool isStop = true)
{
if (!watch.IsRunning)
{
watch.Restart();
return false;
}
else if (watch.ElapsedMilliseconds >= targetMs)
{
if (isStop)
{
watch.Stop();
}
return true;
}
return false;
}
}
}
......@@ -3,6 +3,7 @@ using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
......@@ -10,31 +11,26 @@ using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 康泰克单台自动料仓
/// </summary>
{
public abstract class KTK_Store
{
/// <summary>
/// 料仓状态
/// </summary>
public LineRunStatus runStatus = LineRunStatus.Wait;
/// <summary>
/// 提示消息,一般发给服务器后清空(LineBean表示报警提示消息,BoxBean表示出入库失败的原因记录)
/// </summary>
public string WarnMsg = "";
public DeviceConfig baseConfig = null;
public string Name { get; set; }
public int DeviceID { get; set; }
/// <summary>
/// 定时器
/// </summary>
protected System.Timers.Timer mainTimer;
private bool isInit = false;
/// <summary>
/// 托盘检测信号需要持续时间
/// </summary>
protected static int TrayWaitTime = 500;
public KTK_Store()
{
}
......@@ -55,11 +51,7 @@ namespace OnlineStore.DeviceLibrary
/// 是否没有检测到气压
/// </summary>
public bool isNoAirCheck = false;
//protected int NeedCheckSafetyLight = 0;
/// <summary>
/// 是否再报警中
/// </summary>
public LineAlarmType alarmType = LineAlarmType.None;
public AlarmInfo alarmInfo = new AlarmInfo();
......@@ -93,12 +85,9 @@ namespace OnlineStore.DeviceLibrary
/// 运动处理
/// </summary>
protected bool isInPro = false;
protected virtual void BusyMoveProcess()
{
//if (isInPro)
//{
// return;
//}
{
isInPro = true;
try
{
......@@ -194,39 +183,19 @@ namespace OnlineStore.DeviceLibrary
return true ;
}
return false ;
}
/// <summary>
/// 开始运行
/// </summary>
}
public abstract bool StartRun(bool isDebug = false);
/// <summary>
/// 停止运行
/// </summary>
public abstract void StopRun();
/// <summary>
/// 报警
/// </summary>
/// <param name="alarmType"></param>
public abstract void Alarm(LineAlarmType alarmType );
/// <summary>
/// 重置(夹料装置状态不变)
/// </summary>
public abstract bool Reset();
/// <summary>
/// 停止所有运动
/// </summary>
internal abstract void StopMove( );
/// <summary>
/// 重置处理
/// </summary>
protected abstract void ResetProcess();
/// <summary>
/// 初始化
/// </summary>
protected abstract void ResetProcess();
protected virtual void Init()
{
if (!isInit)
......@@ -239,15 +208,9 @@ namespace OnlineStore.DeviceLibrary
isInit = true;
}
}
/// <summary>
/// 移动信息
/// </summary>
public LineMoveInfo MoveInfo = null;
/// <summary>
/// 定时处理,监听信号,监听IO
/// </summary>
protected abstract void mainTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e);
#region 出库
......@@ -555,7 +518,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 阻塞等待IO信号,等到返回true,未等到返回false
/// </summary>c
public bool WaitIo(string ioType, IO_VALUE value, int timeOut, string errName = "")
protected bool WaitIo(string ioType, IO_VALUE value, int timeOut, string errName = "")
{
try
{
......@@ -570,6 +533,23 @@ namespace OnlineStore.DeviceLibrary
return false;
}
}
protected static bool CheckStopWatch(Stopwatch watch, int targetMs, bool isStop = true)
{
if (!watch.IsRunning)
{
watch.Restart();
return false;
}
else if (watch.ElapsedMilliseconds >= targetMs)
{
if (isStop)
{
watch.Stop();
}
return true;
}
return false;
}
}
}
......@@ -416,116 +416,11 @@ namespace OnlineStore.DeviceLibrary
#endregion
#endregion
#region 横移轨道处理 5000 开始
SW00_Wait = 5000,
/// <summary>
/// 阻挡气缸下降
/// </summary>
SW01_StopDown = 5001,
/// <summary>
/// 等待到托盘信号后,需要持续一段时间
/// </summary>
SW02_WaitCheckTime = 5002,
/// <summary>
/// 等待到托盘信号后,需要持续一段时间
/// </summary>
SW03_WaitTime = 5003,
/// <summary>
/// 等待轨道1夹具检测信号,等待横移3或横移1无托盘
/// </summary>
SW04_WaitCanUp = 5004,
/// <summary>
/// 定位气缸下降
/// </summary>
SW05_LocationDown = 5005,
/// <summary>
/// 横移轨道顶升气缸上升
/// </summary>
SW06_TopCylinderUp = 5006,
/// <summary>
/// 等待第二个横移没有托盘
/// </summary>
SW07_WaitNoTray = 5007,
/// <summary>
/// 横移轨道点击转动
/// </summary>
SW08_DriveMotorMove = 5008,
/// <summary>
/// 收到横移轨道2夹具检测信号
/// </summary>
SW09_WaitOutCheck = 5009,
/// <summary>
/// 等待出口信号持续一段时间
/// </summary>
SW10_WatOutFixture2 = 5010,
/// <summary>
/// 停止横移轨道转动,横移轨道顶升气缸下降
/// </summary>
SW11_TopDown = 5011,
/// <summary>
/// 等待托盘流出,等待1秒后再检测托盘信号是否消失
/// </summary>
SW12_WaitTime = 5012,
/// <summary>
/// 等待托盘流出,上升阻挡气缸
/// </summary>
SW13_WaitTrayGo = 5013,
#endregion
#region 分流横移处理 6000 开始
/// <summary>
/// 分流横移:等待Shunt_Check1_Front亮
/// </summary>
Shunt01_WaitTime = 6001,
/// <summary>
/// 分流横移:托盘不需要横移,阻挡1下降1200,
/// </summary>
Shunt02_Stop1Down,
/// <summary>
/// 分流横移:等待检测1信号消失
/// </summary>
Shunt03_WaitCheck1Low,
/// <summary>
/// 分流横移:阻挡1上升,升降1上升,等待升降2是否可上升
/// </summary>
Shunt05_Top1Up,
///// <summary>
///// 分流横移:等待升降2是否可上升
///// </summary>
//Shunt06_WaitUpdown2CanUp,
/// <summary>
/// 分流横移:升降2开始上升
/// </summary>
Shunt07_Top2Up,
/// <summary>
/// 分流横移:两边皮带线开始转动
/// </summary>
Shunt08_DriveMotorMove,
/// <summary>
/// 分流横移:等待检测2信号消失
/// </summary>
Shunt09_Top1Down,
/// <summary>
/// 分流横移:升降1先下降,皮带1停止,等待检测4信号亮
/// </summary>
Shunt10_WaitCheck,
/// <summary>
/// 分流横移:升降2下降,皮带线停止
/// </summary>
Shunt11_TopDown,
#endregion
#region 入料装置原点返回,10000开始
......@@ -1007,243 +902,7 @@ namespace OnlineStore.DeviceLibrary
FO_63_OutLineRun,
#endregion
#region 出料装置移栽出料,20000开始
/// <summary>
/// 前后气缸后退
/// </summary>
PO_00_CylinderAfter = 20000,
/// <summary>
/// 上下气缸下降
/// </summary>
PO_01_CylinderDown = 20001,
/// <summary>
/// 等待0.3秒后再夹紧
/// </summary>
PO_02_DownWait = 20002,
/// <summary>
/// 夹料气缸夹紧
/// </summary>
PO_03_CylinderOpen = 20003,
/// <summary>
/// 上下气缸上升
/// </summary>
PO_04_CylinderUp = 20004,
/// <summary>
/// 等待可以移栽料盘到流水线
/// </summary>
PO_05_WaitBox = 20005,
/// <summary>
/// 前后气缸前进
/// </summary>
PO_06_CylinderBefore = 20006,
/// <summary>
/// 上下气缸下降
/// </summary>
PO_07_CylinderDown = 20007,
/// <summary>
/// 夹料气缸放松
/// </summary>
PO_08_CylinderRelax = 20008,
/// <summary>
/// 上下气缸上升
/// </summary>
PO_09_CylinderUp = 20009,
/// <summary>
/// 前后气缸后退,等待4000
/// </summary>
PO_10_CylinderAfter = 20010,
#endregion
#region 出料流水线处理,30000开始
/// <summary>
/// 出料流水线复位,定位气缸下降,NG气缸后退
/// </summary>
DL_R_CylinderDown = 30001,
/// <summary>
/// 转动皮带开始运行
/// </summary>
DL_R_StartRun = 30002,
/// <summary>
/// 皮带线检测处理
/// </summary>
DL_R_LineCheck = 30100,
#region 皮带线3送出料盘处理
/// <summary>
/// 出料皮带线开始扫码送出料盘,等待1000后扫码
/// </summary>
DO_01_WaitTime = 30201,
/// <summary>
/// 出料皮带线开始扫码送出料盘,开始扫码,等待扫码结果,最多等待6000
/// </summary>
DO_02_ScanCode = 30202,
/// <summary>
/// 出料皮带线开始扫码送出料盘,根据二维码从服务器获取料盘尺寸
/// </summary>
DO_03_GetTraySize = 30203,
/// <summary>
/// 出料皮带线开始扫码送出料盘,上升或下降分盘定位气缸
/// </summary>
DO_04_SUpDownMove = 30204,
/// <summary>
/// 出料皮带线开始扫码送出料盘,转动皮带线,同时转动分盘装置
/// </summary>
DO_05_LineRun1 = 30205,
/// <summary>
/// 出料皮带线转动第二个工位,同时转动分盘装置
/// </summary>
DO_06_LineRun2 = 30206,
/// <summary>
/// 出料皮带线开始扫码送出料盘,等待料盘到达分盘装置位置
/// </summary>
DO_07_SeparateCheck = 30207,
/// <summary>
/// 出料皮带线开始扫码送出料盘,到达后再转动500
/// </summary>
DO_08_CRun = 30208,
/// <summary>
/// 停止接驳台皮带线
/// </summary>
DO_10_StopSeparateLine = 30210,
/// <summary>
/// 出料皮带线获取尺寸NG,先转动料盘到扫码的下一个工位
/// </summary>
DO_11_NGToNextStation = 30211,
/// <summary>
/// 出料皮带线获取尺寸NG,NG气缸前进
/// </summary>
DO_12_NGCylinderForward = 30212,
/// <summary>
/// 出料皮带线获取尺寸NG,NG气缸前进后等待1000ms
/// </summary>
DO_13_NGCylinderWait = 30213,
/// <summary>
/// 出料皮带线获取尺寸NG,NG气缸后退
/// </summary>
DO_14_NGCylinderBack = 30214,
/// <summary>
/// 出料皮带线获取尺寸NG,,NG料到接驳台,接驳台皮带线反转
/// </summary>
DO_15_SeparateBackRun = 30215,
/// <summary>
/// 出料皮带线获取尺寸NG,,NG料到接驳台,反转等待3000
/// </summary>
DO_16_SeparateBackRunWait = 30216,
/// <summary>
/// 出料皮带线获取尺寸NG,,NG料已出,接驳台先停止反转
/// </summary>
DO_17_SeparateStopRun = 30217,
/// <summary>
/// 出料皮带线获取尺寸NG,,NG料已出,接驳台皮带线恢复正转
/// </summary>
DO_18_SeparateRun = 30218,
#endregion
#region 皮带线3送出料盘新处理,增加NG推出气缸后的处理
/// <summary>
/// 送料盘到双层线:NG气缸后退,等待100后处理,
/// </summary>
DON_01_WaitTime = 30401,
/// <summary>
/// 送料盘到双层线:根据二维码从服务器获取料盘尺寸
/// </summary>
DON_03_GetTraySize = 30403,
/// <summary>
/// 送料盘到双层线:上升或下降分盘定位气缸
/// </summary>
DON_04_SUpDownMove = 30404,
/// <summary>
/// 送料盘到双层线:转动皮带线,同时转动分盘装置
/// </summary>
DON_05_LineRun = 30405,
/// <summary>
/// 送料盘到双层线:等待料盘到达分盘装置位置
/// </summary>
DON_07_SeparateCheck = 30407,
/// <summary>
/// 送料盘到双层线:到达后再转动500
/// </summary>
DON_08_CRun = 30408,
/// <summary>
/// 横移NG料:NG气缸前进
/// </summary>
DON_12_NGCylinderForward = 30412,
/// <summary>
/// 横移NG料:NG气缸前进后等待1000ms
/// </summary>
DON_13_NGCylinderWait = 30413,
/// <summary>
/// 横移NG料:NG气缸后退
/// </summary>
DON_14_NGCylinderBack = 30414,
#endregion
#region 皮带线12接收料盘并转动处理
/// <summary>
/// 皮带线12处理料盘:NG气缸后退
/// </summary>
DLO_01_NGBack = 30301,
/// <summary>
/// 皮带线12处理料盘:等待入口无料盘, 等待最后一盘料位置>1
/// </summary>
DLO_02_WaitEnteryNoTray,
///// <summary>
///// 皮带线12处理料盘:入口出口都没有料盘,转动皮带线到入口定位亮
///// </summary>
//DLO_03_LineRun,
/// <summary>
/// 皮带线12处理料盘:可以放入料盘,等待移栽放下料盘
/// </summary>
DLO_04_CanReviceTray,
/// <summary>
/// 皮带线12处理料盘:移栽放下料盘后更新为已放料盘
/// </summary>
DLO_05_TrayIsOk,
/// <summary>
/// 皮带线12处理料盘:盘放下后等待2000ms
/// </summary>
DLO_06_WaitTime,
/// <summary>
/// 皮带线12处理料盘:出库有料盘,继续转动一个工位,
/// </summary>
DLO_07_LineRun,
/// <summary>
/// 皮带线12处理料盘:是NG料盘,NG气缸前进
/// </summary>
DLO_08_NGBefore,
/// <summary>
/// 皮带线12处理料盘:是NG料盘,NG气缸后退
/// </summary>
DLO_09_NGAfter,
///// <summary>
///// 皮带线12处理料盘:判断出口是否有料盘,有料盘需要转动,没有料盘结束
///// </summary>
//DLO_10_LineRun,
/// <summary>
/// 皮带线12处理料盘:出口无料盘,结束,
/// </summary>
DLO_11_ExitNoTray,
#endregion
#endregion
#region C1线横移模块 50000开始
......@@ -1593,7 +1252,7 @@ namespace OnlineStore.DeviceLibrary
//,接驳台夹料气缸放松
//等待夹爪无料
/// <summary>
/// 接驳台横移复位:升降轴回原点
/// 接驳台横移复位:电机停止,升降轴回原点,阻挡上升,定位气缸下降,顶升气缸下降
/// </summary>
JHY_R01_UpdownHome = 53001,
......@@ -1603,12 +1262,12 @@ namespace OnlineStore.DeviceLibrary
JHY_R02_UpdownUp,
/// <summary>
/// 接驳台横移复位:电机停止,阻挡上升,定位气缸下降,接驳台取料端
/// 接驳台横移复位:接驳台取料端
/// </summary>
JHY_R03_LocationDown,
/// <summary>
/// 接驳台横移复位:升降气缸下降,夹紧气缸放松
/// 接驳台横移复位:紧气缸放松
/// </summary>
JHY_R04_TopDown,
......@@ -1620,11 +1279,147 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 接驳台横移托盘处理
#region 接驳台横移托盘处理 54001
/// <summary>
/// 接驳台托盘:前阻挡检测到托盘
/// </summary>
JHY_01_TrayCheck = 54001,
/// <summary>
/// 接驳台托盘:顶升气缸上升或下降,HY10,HY12下降,HY7上升
/// </summary>
JHY_02_TopMove,
/// <summary>
/// 接驳台托盘:前阻挡下降,电机正转
/// </summary>
JHY_03_StopDown,
/// <summary>
/// 接驳台托盘:等待托盘检测信号
/// </summary>
JHY_04_WaitTray,
/// <summary>
/// 接驳台托盘:前阻挡上升,等待托盘检测信号500ms
/// </summary>
JHY_05_TrayCheck,
/// <summary>
/// 接驳台托盘:获取料盘尺寸
/// </summary>
JHY_06_GetTraySize,
/// <summary>
/// 接驳台托盘:顶升上升
/// </summary>
JHY_07_TopUp,
/// <summary>
/// 接驳台托盘:料盘需要横移,定位上升
/// </summary>
JHY_08_LocationUp,
/// <summary>
/// 接驳台托盘:等待托盘拿走
/// </summary>
JHY_09_WaitProcessReel,
/// <summary>
/// 接驳台托盘:料盘处理结束
/// </summary>
JHY_10_ReelProEnd,
/// <summary>
/// 接驳台托盘放行: 阻挡上升,定位气缸下降,顶升气缸下降
/// </summary>
JHY_11_TopDown =53011,
/// <summary>
/// 接驳台托盘放行: 等待托盘检测无信号
/// </summary>
JHY_12_WaitTrayLeave ,
/// <summary>
/// 接驳台托盘放行: 延迟500ms后再次等待托盘无信号
/// </summary>
JHY_13_TrayLeave,
/// <summary>
/// 接驳台托盘放行: 阻挡上升,定位气缸下降,顶升气缸下降
/// </summary>
JHY_14_TopDown ,
#endregion
#region 接驳台取放料处理 55001
/// <summary>
/// 接驳台放料:升降轴到P1
/// </summary>
JM_01_UpdownToP1 = 55001,
/// <summary>
///接驳台放料: 横移气缸取料端
/// </summary>
JM_02_CylinderTake ,
/// <summary>
/// 接驳台放料:升降轴下降到取料点P2
/// </summary>
JM_03_UpdownToP2,
/// <summary>
/// 接驳台放料:等待0.3秒后再夹紧
/// </summary>
JM_04_DownWait,
/// <summary>
/// 接驳台放料:夹料气缸夹紧
/// </summary>
JM_05_ClampWork,
/// <summary>
/// 接驳台放料:升降轴到P1
/// </summary>
JM_06_UpdownToP1,
/// <summary>
/// 接驳台放料:夹爪料盘检测有料
/// </summary>
JM_07_ClampCheck,
/// <summary>
/// 接驳台放料:等待接驳台无料
/// </summary>
JM_10_WaitJNoReel,
/// <summary>
/// 接驳台放料:接驳台气缸放料
/// </summary>
JM_11_CylinderGive,
/// <summary>
/// 接驳台放料:升降轴下降到P3
/// </summary>
JM_12_UpdownToP3,
/// <summary>
/// 接驳台放料:夹料气缸放松
/// </summary>
JM_13_ClampRelax,
/// <summary>
/// 接驳台放料:升降轴上升到P1
/// </summary>
JM_14_UpdownToP1,
/// <summary>
/// 接驳台放料:夹爪料盘检测无料
/// </summary>
JM_15_ClampCheck,
/// <summary>
/// 接驳台放料:通知服务器料盘到达
/// </summary>
JM_16_ReelArrive,
/// <summary>
/// 接驳台放料:接驳台气缸取料端
/// </summary>
JM_17_CylinderTake,
#endregion
#endregion
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!