Commit ac73409c LN

1

1 个父辈 1da51b27
正在显示 51 个修改的文件 包含 1174 行增加427 行删除
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<ProjectGuid>{0D2542F5-DD62-4352-82D0-383D9A045E74}</ProjectGuid> <ProjectGuid>{0D2542F5-DD62-4352-82D0-383D9A045E74}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.ACSingleStore</RootNamespace> <RootNamespace>OnlineStore.ACPackingStore</RootNamespace>
<AssemblyName>ACSingleStore</AssemblyName> <AssemblyName>ACPackingStore</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
...@@ -85,6 +85,12 @@ ...@@ -85,6 +85,12 @@
<Compile Include="FrmAbout.Designer.cs"> <Compile Include="FrmAbout.Designer.cs">
<DependentUpon>FrmAbout.cs</DependentUpon> <DependentUpon>FrmAbout.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="FrmMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmMain.Designer.cs">
<DependentUpon>FrmMain.cs</DependentUpon>
</Compile>
<Compile Include="FrmPwd.cs"> <Compile Include="FrmPwd.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -112,6 +118,9 @@ ...@@ -112,6 +118,9 @@
<EmbeddedResource Include="FrmAbout.resx"> <EmbeddedResource Include="FrmAbout.resx">
<DependentUpon>FrmAbout.cs</DependentUpon> <DependentUpon>FrmAbout.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmMain.resx">
<DependentUpon>FrmMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmPwd.resx"> <EmbeddedResource Include="FrmPwd.resx">
<DependentUpon>FrmPwd.cs</DependentUpon> <DependentUpon>FrmPwd.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
...@@ -14,11 +14,12 @@ ...@@ -14,11 +14,12 @@
<!--Server address--> <!--Server address-->
<add key="http.server" value="http://192.168.101.11/myproject/" /> <add key="http.server" value="http://192.168.101.11/myproject/" />
<!--storeType--> <!--storeType-->
<add key="store_count" value="1"/> <add key="store_count" value="2"/>
<add key="Store_ConfigPath" value="\StoreConfig\StoreConfig.csv"/>
<!--start one store config--> <!--start one store config-->
<add key="Store_Position_Config" value="\StoreConfig\AC\linePositions.csv"/> <add key="Store_Position_Config" value="\StoreConfig\linePositions.csv"/>
<add key="Store_ConfigPath" value="\StoreConfig\AC\StoreConfig.csv"/> <add key="BOX_ConfigPath" value="\StoreConfig\BoxConfig.csv"/>
<add key="Store_Type" value="RC_AC_SA"/> <add key="Store_Type" value="RC_AC_PA"/>
<add key="Store_CID" value="line-ac1"/> <add key="Store_CID" value="line-ac1"/>
<add key ="Store_ID" value ="1"/> <add key ="Store_ID" value ="1"/>
<!--end one store config--> <!--end one store config-->
......
...@@ -11,65 +11,10 @@ using System.Windows.Forms; ...@@ -11,65 +11,10 @@ using System.Windows.Forms;
namespace OnlineStore.ACPackingStore namespace OnlineStore.ACPackingStore
{ {
public class FormManager public class FormManager
{ {
//#03A9F4
//public static Color buttonColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
//public static Color buttonColor = System.Drawing.SystemColors.ActiveCaption;
//public static Color buttonColor = System.Drawing.Color.FromArgb(((int)((0x00))), ((int)((0x66))), ((int)(0xFF)));
//private static string skinFileName = Application.StartupPath + @"\Skins\Wave.ssk";
//private static string skinFileName = Application.StartupPath + @"\Skins\DiamondBlue.ssk";
//public static string SkinFileName
//{
// set
// {
// }
// get
// {
// if (SkinsList.Count <= 0)
// {
// SkinsList = GetSkinList();
// }
// if (SkinsList.Count > 0 && index >= 0)
// {
// return SkinsList[index];
// }
// return skinFileName;
// }
//}
//private static int index = -1;
//public static void DefaultSkin()
//{
// index = -1;
//}
//public static void NextSkin()
//{
// index++;
// if (index >= SkinsList.Count)
// {
// index = 0;
// }
//}
//public static List<string> SkinsList = new List<string>();
//private static List<string> GetSkinList()
//{
// List<string> returnList = new System.Collections.Generic.List<string>();
// string[] fileList = Directory.GetFiles(Application.StartupPath + @"\Skins");
// foreach (string sr in fileList)
// {
// if (sr.Contains(".ssk"))
// {
// returnList.Add(sr);
// }
// }
// return returnList;
//}
private static FrmAxisDebug debug = null; private static FrmAxisDebug debug = null;
public static void ShowAxisDebug(AC_SA_BoxBean store) public static void ShowAxisDebug(AC_BOX_Bean store)
{ {
if (debug == null) if (debug == null)
{ {
...@@ -90,7 +35,7 @@ namespace OnlineStore.ACPackingStore ...@@ -90,7 +35,7 @@ namespace OnlineStore.ACPackingStore
} }
} }
private static FrmIOStatus frmIo = null; private static FrmIOStatus frmIo = null;
public static void ShowIOShow(AC_SA_BoxBean store) public static void ShowIOShow(AC_BOX_Bean store)
{ {
if (frmIo == null) if (frmIo == null)
{ {
......
...@@ -25,18 +25,20 @@ namespace OnlineStore.ACPackingStore ...@@ -25,18 +25,20 @@ namespace OnlineStore.ACPackingStore
private ConfigMoveAxis inout = null; private ConfigMoveAxis inout = null;
private ConfigMoveAxis comp = null; private ConfigMoveAxis comp = null;
//private int compress_Slv = 0; //private int compress_Slv = 0;
private AC_BOX_Bean boxBean = null;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmAxisDebug(AC_SA_BoxBean boxBean) public FrmAxisDebug(AC_BOX_Bean boxBean)
{ {
middle = boxBean.Config.Middle_Axis; middle = boxBean.Config.Middle_Axis;
updown = boxBean.Config.UpDown_Axis; updown = boxBean.Config.UpDown_Axis;
//compress_Slv = boxBean.Config.CompressAxis_Slv; //compress_Slv = boxBean.Config.CompressAxis_Slv;
comp = boxBean.Config.Comp_Axis; comp = boxBean.Config.Comp_Axis;
inout = boxBean.Config.InOut_Axis; inout = boxBean.Config.InOut_Axis;
this. boxBean = boxBean;
InitializeComponent(); InitializeComponent();
this.Text = boxBean.StoreName + "_轴点动调试"; this.Text = boxBean.Name + "_轴点动调试";
} }
private void AxisMove(ConfigMoveAxis axis, int speed) private void AxisMove(ConfigMoveAxis axis, int speed)
...@@ -135,7 +137,7 @@ namespace OnlineStore.ACPackingStore ...@@ -135,7 +137,7 @@ namespace OnlineStore.ACPackingStore
{ {
if (this.btnInOutMove.BackColor .Equals(System.Drawing.SystemColors.Control)) if (this.btnInOutMove.BackColor .Equals(System.Drawing.SystemColors.Control))
{ {
if (StoreManager.Store.InOutAxisCanMove().Equals(false)) if (boxBean.InOutAxisCanMove().Equals(false))
{ {
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
...@@ -222,7 +224,7 @@ namespace OnlineStore.ACPackingStore ...@@ -222,7 +224,7 @@ namespace OnlineStore.ACPackingStore
{ {
if (btnInOutMovej.BackColor.Equals(System.Drawing.SystemColors.Control)) if (btnInOutMovej.BackColor.Equals(System.Drawing.SystemColors.Control))
{ {
if (StoreManager.Store.InOutAxisCanMove().Equals(false)) if (boxBean.InOutAxisCanMove().Equals(false))
{ {
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
......
...@@ -23,20 +23,20 @@ namespace OnlineStore.ACPackingStore ...@@ -23,20 +23,20 @@ namespace OnlineStore.ACPackingStore
public partial class FrmIOStatus : FrmBase public partial class FrmIOStatus : FrmBase
{ {
private int StoreId = 1; private int StoreId = 1;
private AC_SA_BoxBean boxBean; private AC_BOX_Bean boxBean;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmIOStatus() public FrmIOStatus()
{ {
Control.CheckForIllegalCrossThreadCalls = false; Control.CheckForIllegalCrossThreadCalls = false;
InitializeComponent(); InitializeComponent();
} }
public FrmIOStatus(AC_SA_BoxBean store) public FrmIOStatus(AC_BOX_Bean store)
{ {
Control.CheckForIllegalCrossThreadCalls = false; Control.CheckForIllegalCrossThreadCalls = false;
InitializeComponent(); InitializeComponent();
this.boxBean = store; this.boxBean = store;
this.StoreId = store.StoreID; this.StoreId = store.DeviceID;
LoadIOList(); LoadIOList();
} }
...@@ -46,8 +46,8 @@ namespace OnlineStore.ACPackingStore ...@@ -46,8 +46,8 @@ namespace OnlineStore.ACPackingStore
{ {
int roleindex = 0; int roleindex = 0;
this.tableLayoutPanel1.RowStyles.Clear(); this.tableLayoutPanel1.RowStyles.Clear();
this.tableLayoutPanel1.RowCount = boxBean.Config.StoreDIList.Count; this.tableLayoutPanel1.RowCount = boxBean.Config.DIList.Count;
foreach (ConfigIO ioValue in boxBean.Config.StoreDIList.Values) foreach (ConfigIO ioValue in boxBean.Config.DIList.Values)
{ {
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 26)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 26));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName); IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName);
...@@ -57,9 +57,9 @@ namespace OnlineStore.ACPackingStore ...@@ -57,9 +57,9 @@ namespace OnlineStore.ACPackingStore
} }
tableLayoutPanel2.RowStyles.Clear(); tableLayoutPanel2.RowStyles.Clear();
this.tableLayoutPanel2.RowCount = boxBean.Config.StoreDOList.Count; this.tableLayoutPanel2.RowCount = boxBean.Config.DOList.Count;
roleindex = 0; roleindex = 0;
foreach (ConfigIO ioValue in boxBean.Config.StoreDOList.Values) foreach (ConfigIO ioValue in boxBean.Config.DOList.Values)
{ {
this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28)); this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName); IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName);
...@@ -69,7 +69,7 @@ namespace OnlineStore.ACPackingStore ...@@ -69,7 +69,7 @@ namespace OnlineStore.ACPackingStore
} }
this.SuspendLayout(); //此处为不闪屏,一定要有的! this.SuspendLayout(); //此处为不闪屏,一定要有的!
cmbWriteIO.DataSource = new List<ConfigIO>(boxBean.Config.StoreDOList.Values); cmbWriteIO.DataSource = new List<ConfigIO>(boxBean.Config.DOList.Values);
cmbWriteIO.ValueMember = "ProName"; cmbWriteIO.ValueMember = "ProName";
cmbWriteIO.DisplayMember = "DisplayStr"; cmbWriteIO.DisplayMember = "DisplayStr";
cmbWriteValue.SelectedIndex = 0; cmbWriteValue.SelectedIndex = 0;
...@@ -119,9 +119,9 @@ namespace OnlineStore.ACPackingStore ...@@ -119,9 +119,9 @@ namespace OnlineStore.ACPackingStore
private ConfigIO GetSelectDO() private ConfigIO GetSelectDO()
{ {
string text = cmbWriteIO.SelectedValue.ToString(); string text = cmbWriteIO.SelectedValue.ToString();
if (boxBean.Config.StoreDOList.ContainsKey(text)) if (boxBean.Config.DOList.ContainsKey(text))
{ {
ConfigIO io = boxBean.Config.StoreDOList[text]; ConfigIO io = boxBean.Config.DOList[text];
return io; return io;
} }
return null; return null;
...@@ -188,7 +188,7 @@ namespace OnlineStore.ACPackingStore ...@@ -188,7 +188,7 @@ namespace OnlineStore.ACPackingStore
foreach (string key in DIControlList.Keys) foreach (string key in DIControlList.Keys)
{ {
IOTextControl control = DIControlList[key]; IOTextControl control = DIControlList[key];
int iov = (int)IOManager.IOValue(key); int iov = (int)boxBean.IOValue(key);
if (iov != control.IOValue) if (iov != control.IOValue)
{ {
control.IOValue = iov; control.IOValue = iov;
...@@ -225,16 +225,10 @@ namespace OnlineStore.ACPackingStore ...@@ -225,16 +225,10 @@ namespace OnlineStore.ACPackingStore
IOManager.instance.ReadAllDO(deviceName, (byte)slaveId ); IOManager.instance.ReadAllDO(deviceName, (byte)slaveId );
} }
private void btnOpenDoor_Click(object sender, EventArgs e) private void btnOpenDoor_Click(object sender, EventArgs e)
{ {
//IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.HIGH);
//IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.LOW);
StoreManager.Store.OpenDoor(false);
} }
private void btnCloseDoor_Click(object sender, EventArgs e) private void btnCloseDoor_Click(object sender, EventArgs e)
{ {
//IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
//IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
StoreManager.Store.CloseDoor(false);
} }
private void btnLocationUp_Click(object sender, EventArgs e) private void btnLocationUp_Click(object sender, EventArgs e)
......
namespace OnlineStore.ACPackingStore
{
partial class FrmMain
{
/// <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.tabPageList = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPageList.SuspendLayout();
this.SuspendLayout();
//
// tabPageList
//
this.tabPageList.Controls.Add(this.tabPage1);
this.tabPageList.Controls.Add(this.tabPage2);
this.tabPageList.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabPageList.Location = new System.Drawing.Point(0, 0);
this.tabPageList.Name = "tabPageList";
this.tabPageList.SelectedIndex = 0;
this.tabPageList.Size = new System.Drawing.Size(1110, 660);
this.tabPageList.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1102, 634);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "tabPage1";
this.tabPage1.UseVisualStyleBackColor = true;
//
// tabPage2
//
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1102, 634);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "tabPage2";
this.tabPage2.UseVisualStyleBackColor = true;
//
// FrmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1110, 660);
this.Controls.Add(this.tabPageList);
this.Name = "FrmMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FrmMain";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.FrmMain_Load);
this.tabPageList.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabPageList;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
}
}
\ No newline at end of file \ No newline at end of file
using OnlineStore.DeviceLibrary;
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.ACPackingStore
{
public partial class FrmMain : Form
{
public FrmMain()
{
InitializeComponent();
}
private void FrmMain_Load(object sender, EventArgs e)
{
PackingStoreBean store = StoreManager.InitStore();
if (store == null)
{
this.Close();
}
else
{
foreach (AC_BOX_Bean box in store.BoxMap.Values)
{
FrmStoreBox frm = new FrmStoreBox();
frm.BoxBean = box;
AddForm(box.Name, frm);
}
}
}
private void AddForm(string text, Form form)
{
text = text.PadLeft(10, ' ');
TabPage lineTabPage = new TabPage(text);
lineTabPage.AutoScroll = true;
Panel linePan = new Panel();
linePan.Dock = DockStyle.Fill;
linePan.AutoScroll = true;
lineTabPage.Controls.Add(linePan);
form.FormBorderStyle = FormBorderStyle.None;
form.TopLevel = false;
linePan.Controls.Add(form);
form.Dock = DockStyle.Fill;
linePan.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left)));
form.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left)));
form.Show();
tabPageList.Controls.Add(lineTabPage);
}
}
}
<?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>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -96,7 +96,7 @@ namespace OnlineStore.ACPackingStore ...@@ -96,7 +96,7 @@ namespace OnlineStore.ACPackingStore
XmlConfigurator.Configure(); XmlConfigurator.Configure();
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmStoreBox()); Application.Run(new FrmMain());
} }
} }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
......
...@@ -35,7 +35,7 @@ namespace OnlineStore.Common ...@@ -35,7 +35,7 @@ namespace OnlineStore.Common
/// </summary> /// </summary>
public static string Store_Type = "Store_Type"; public static string Store_Type = "Store_Type";
public static string Store_ConfigPath = "Store_ConfigPath"; public static string BOX_ConfigPath = "BOX_ConfigPath";
public static string Store_Position_Config = "Store_Position_Config"; public static string Store_Position_Config = "Store_Position_Config";
/// <summary> /// <summary>
/// 摄像机名称,多个中间使用#分割 /// 摄像机名称,多个中间使用#分割
...@@ -90,5 +90,7 @@ namespace OnlineStore.Common ...@@ -90,5 +90,7 @@ namespace OnlineStore.Common
public static string IsInDebug = "IsInDebug"; public static string IsInDebug = "IsInDebug";
public static string ACBaudRate = "ACBaudRate"; public static string ACBaudRate = "ACBaudRate";
public static string Store_ConfigPath = "Store_ConfigPath";
} }
} }
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
partial class PackingStoreBean
{
#region 出库
public override bool StartOutStoreMove(InOutParam param)
{
return true;
}
protected override void OutStoreProcess()
{
}
#endregion
#region 入库
public override void StartInStoreMove(InOutParam param)
{
}
protected override void InStoreProcess()
{
}
#endregion
}
}
\ No newline at end of file \ No newline at end of file
...@@ -19,8 +19,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -19,8 +19,9 @@ namespace OnlineStore.DeviceLibrary
public static int CurrInOutType = 0; public static int CurrInOutType = 0;
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static AC_SA_BoxBean Store = null; public static PackingStoreBean Store = null;
public static AC_SA_Config Config = null; public static Store_Config Config = null;
public static Dictionary<int, StoreConfig> AllConfigMap = null;
private static bool isInit = false; private static bool isInit = false;
public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals(""); public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals("");
public StoreManager() public StoreManager()
...@@ -44,10 +45,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -44,10 +45,11 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
public static AC_SA_BoxBean InitStore() public static PackingStoreBean InitStore()
{ {
try try
{ {
AllConfigMap = new Dictionary<int, StoreConfig>();
StoreConfig.ProIOIpMap = new Dictionary<string, string>(); StoreConfig.ProIOIpMap = new Dictionary<string, string>();
if (!isInit) if (!isInit)
{ {
...@@ -66,27 +68,31 @@ namespace OnlineStore.DeviceLibrary ...@@ -66,27 +68,31 @@ namespace OnlineStore.DeviceLibrary
isInit = true; isInit = true;
string storeType = ConfigAppSettings.GetValue(Setting_Init.Store_Type); string storeType = ConfigAppSettings.GetValue(Setting_Init.Store_Type);
int count = ConfigAppSettings.GetIntValue(Setting_Init.store_count);
LogUtil.info(LOGGER, "配置的料仓 类型=" + storeType + ",开始加载料仓配置"); LogUtil.info(LOGGER, "配置的料仓 类型=" + storeType + ",开始加载料仓配置");
if (storeType == StoreType.RC_AC_SA) string appPath = Application.StartupPath;
string CID = ConfigAppSettings.GetValue(Setting_Init.Store_CID);
Dictionary<int, AC_BOX_Config> storeConfig = new Dictionary<int, AC_BOX_Config>();
if (storeType == StoreType.RC_AC_PA)
{ {
string appPath = Application.StartupPath;
string CID = ConfigAppSettings.GetValue(Setting_Init.Store_CID);
string linefilePath = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_ConfigPath); string linefilePath = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_ConfigPath);
int storeID = ConfigAppSettings.GetIntValue(Setting_Init.Store_ID); Config = CSVConfigReader.LoadLineConfig(0, CID, "Line", linefilePath);
StoreConfig storeConfig = CSVConfigReader.LoadConfig(storeID, CID, StoreType.RC_AC_SA, linefilePath); AllConfigMap.Add(0, Config);
string positionConfigFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_Position_Config);
if (File.Exists(positionConfigFile)) string moveEquipConfig = ConfigAppSettings.GetValue(Setting_Init.BOX_ConfigPath);
for (int i = 1; i <= count; i++)
{ {
LogUtil.info(LOGGER, "加载位置文件:" + positionConfigFile); string nameStr = i.ToString().PadLeft(1, '0');
CSVPositionReader<ACStorePosition>.ReloadCSVFile(positionConfigFile); string config = appPath + moveEquipConfig.Replace(".csv", "_" + nameStr + ".csv");
AC_BOX_Config moveConfig = CSVConfigReader.LoadStoreConfig(i, CID + "_" + i, "BOX", config);
AllConfigMap.Add(i, moveConfig);
storeConfig.Add(i, moveConfig);
} }
Config = (AC_SA_Config)storeConfig;
Store = new AC_SA_BoxBean(Config);
Store.CID = CID;
LogUtil.info(LOGGER, "加载料仓完成!"); LogUtil.info(LOGGER, "加载料仓完成!");
return Store;
} }
Store = new PackingStoreBean(Config, storeConfig);
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -101,21 +107,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -101,21 +107,21 @@ namespace OnlineStore.DeviceLibrary
/// 修改了料仓配置,更新缓存,更新配置文件(只能更新PRO的配置) /// 修改了料仓配置,更新缓存,更新配置文件(只能更新PRO的配置)
/// </summary> /// </summary>
/// <param name="kTK_LA_Store_Config"></param> /// <param name="kTK_LA_Store_Config"></param>
public static void UpdateBoxConfig(AC_SA_Config storeConfig) public static void UpdateBoxConfig(AC_BOX_Config storeConfig)
{ {
try try
{ {
//位置配置到文件中 //位置配置到文件中
string appPath = Application.StartupPath; string appPath = Application.StartupPath;
string configFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_ConfigPath); string configFile = appPath + ConfigAppSettings.GetValue(Setting_Init.BOX_ConfigPath);
bool result = CSVConfigReader.SaveBoxPosition(configFile, storeConfig); bool result = CSVConfigReader.SaveBoxPosition(configFile, storeConfig);
if (!result) if (!result)
{ {
LOGGER.Error("保存配置文件失败:" + configFile); LOGGER.Error("保存配置文件失败:" + configFile);
} }
Store.Config = storeConfig; //Store.Config = storeConfig;
Store.MoveAxisConfig(); //Store.MoveAxisConfig();
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -59,17 +59,19 @@ ...@@ -59,17 +59,19 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="acSingleStore\AC_SA_BoxBean.cs" /> <Compile Include="ACPackingStore\AC_BOX_Bean.cs" />
<Compile Include="acSingleStore\AC_SA_BoxBean_Partial.cs" /> <Compile Include="ACPackingStore\AC_BOX_Bean_Partial.cs" />
<Compile Include="acSingleStore\StoreManager.cs" /> <Compile Include="ACPackingStore\PackingStoreBean.cs" />
<Compile Include="IO\AIOBOX\AIOBOXManager.cs" /> <Compile Include="ACPackingStore\PackingStoreBean_Partial.cs" />
<Compile Include="IO\IOManager.cs" /> <Compile Include="ACPackingStore\StoreManager.cs" />
<Compile Include="IO\KangNaiDe\KNDManager.cs" /> <Compile Include="device\halcon\CodeManager.cs" />
<Compile Include="IO\KangNaiDe\MasterTcpClient.cs" /> <Compile Include="device\IO\AIOBOX\AIOBOXManager.cs" />
<Compile Include="lineConnect\LineConnect.cs" /> <Compile Include="device\IO\IOManager.cs" />
<Compile Include="PanasonicServo\ACCMDManager.cs" /> <Compile Include="device\IO\KangNaiDe\KNDManager.cs" />
<Compile Include="PanasonicServo\ACServerManager.cs" /> <Compile Include="device\IO\KangNaiDe\MasterTcpClient.cs" />
<Compile Include="PanasonicServo\ACServerManager_Partial.cs" /> <Compile Include="device\PanasonicServo\ACCMDManager.cs" />
<Compile Include="device\PanasonicServo\ACServerManager.cs" />
<Compile Include="device\PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="store\LineMoveP.cs" /> <Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineAlarm.cs"> <Compile Include="store\LineAlarm.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
...@@ -105,13 +107,16 @@ ...@@ -105,13 +107,16 @@
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />
<ItemGroup> <ItemGroup>
<None Include="StoreConfig\AC\linePositions.csv"> <None Include="StoreConfig\linePositions.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="StoreConfig\AC\StoreConfig - 复制.csv"> <None Include="StoreConfig\StoreConfig.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="StoreConfig\AC\StoreConfig.csv"> <None Include="StoreConfig\BoxConfig_2.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\BoxConfig_1.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>
......
类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID,
DI,急停,SuddenStop_BTN,200,192.168.200.11,0,急停,X01,DI-01,0,
DI,复位,Reset_BTN,201,192.168.200.11,0,复位,X02,DI-02,0,
DI,自动,AutoRun_Signal,202,192.168.200.11,0,自动,X03,DI-03,0,
DI,气压检测,Airpressure_Check,203,192.168.200.11,0,气压检测,X04,DI-04,0,
DI,料盘检测1(进料口),TrayCheck_Door,204,192.168.200.11,0,料盘检测1(进料口),X05,DI-05,0,
DI,料盘检测2(料叉),TrayCheck_Fixture,205,192.168.200.11,0,料盘检测2(料叉),X06,DI-06,0,
DI,进料口门上升端,Door_Up,206,192.168.200.11,0,进料口门上升端,X07,DI-07,0,
DI,进料口门下降端,Door_Down,207,192.168.200.11,0,进料口门下降端,X08,DI-08,0,
,,,208,192.168.200.11,0,,X09,DI-09,0,
,,,209,192.168.200.11,0,,X10,DI-10,0,
DI,前门限位,Door_LimitSingle,210,192.168.200.11,0,前门限位,X11,DI-11,0,
,,,211,192.168.200.11,0,,X12,DI-12,0,
DI,安全光栅,SafetyLightCurtains,212,192.168.200.11,0,安全光栅,X13,DI-13,0,
,,,213,192.168.200.11,0,,X14,DI-14,0,
,,,214,192.168.200.11,0,,X15,DI-15,0,
DI,压紧机构计量检测,CompressAxis_Check,215,192.168.200.11,0,压紧机构计量检测,X16,DI-16,0,
DO,自动指示灯,AutoRun_HddLed,100,192.168.200.11,0,自动指示灯,Y01,DO-01,0,
DO,故障指示灯,Alarm_HddLed,101,192.168.200.11,0,故障指示灯,Y02,DO-02,0,
DO,待机指示灯,RunSign_HddLed,102,192.168.200.11,0,待机指示灯,Y03,DO-03,0,
DO,吹气SOL ON,StartOrStopBlow,103,192.168.200.11,0,吹气SOL ON,Y04,DO-04,0,
DO,料仓运转ON,Run_Signal,104,192.168.200.11,0,料仓运转ON,Y05,DO-05,0,
DO,轴2刹车电源ON,Axis_Brake,105,192.168.200.11,0,轴2刹车电源ON,Y06,DO-06,0,
DO,进料口门上升SOL,Door_Up,106,192.168.200.11,0,进料口门上升SOL,Y07,DO-07,0,
DO,进料口门下降SOL,Door_Down,107,192.168.200.11,0,进料口门下降SOL,Y08,DO-08,0,
,,,108,192.168.200.11,0,,Y09,DO-09,0,
,,,109,192.168.200.11,0,,Y10,DO-10,0,
DO,相机照明开,CameraLight_Power,110,192.168.200.11,0,相机照明开,Y11,DO-11,0,
,,,111,192.168.200.11,0,,Y12,DO-12,0,
,,,112,192.168.200.11,0,,Y13,DO-13,0,
,,,113,192.168.200.11,0,,Y14,DO-14,0,
,,,114,192.168.200.11,0,,Y15,DO-15,0,
,,,115,192.168.200.11,0,,Y16,DO-16,0,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM6,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,1,COM5,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,1,COM4,0,,,,,
,温湿度传感器地址,Temperate_ServerAddress,192.168.200.14,,,,,,,
,扫码枪IP,Scanner_Ip,192.168.200.13,,,,,,,
,扫码枪端口号,Scanner_Port,51236,,,,,,,
PRO,升降轴 进料口取料点 P1,UpDownAxis_DoorOPosition_P1,403000,,,,,,,
PRO,升降轴 进料口出料前点 P2,UpDownAxis_DoorIPosition_P2,415000,,,,,,,
PRO,升降轴 进料口取料缓冲点 P7,UpDownAxis_DoorOBPosition_P7,415000,,,,,,,
PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,,
PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,268093,,,,,,,
PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,-75000,,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,, ,,
PRO,设备是否处于调试状态(1=调试,0=正常),IsInDebug,0,,,,,,,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,
,温湿度传感器地址,TemperateServer_Port,9001,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,,,
PRO,预警湿度,WarnHumidity,80,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,2500,,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,800,,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,800,,,,,,,
PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,800,,,,,,,
PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,500,,,,,,,
PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,1500,,,,,,,
PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,400,,,,,,,
PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,400,,,,,,,
PRO,(轴二)升降轴轴原点低速度,UpdownAxis_HomeLowSpeed,100,,,,,,,
PRO,(轴二)升降轴轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,,,
PRO,(轴二)升降轴轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,,,
PRO,(轴三)进出轴目标速度,InoutAxis_TargetSpeed,1000,,,,,,,
PRO,(轴三)进出轴加速度,InoutAxis_AddSpeed,300,,,,,,,
PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,300,,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,200,,,,,,,
PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,2500,,,,,,,
PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,2500,,,,,,,
PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,2500,,,,,,,
PRO,升降轴(轴2)P4速度,UpDownAxis_P4_Speed,1500,,,,,,,
PRO,升降轴(轴2)P5速度,UpDownAxis_P5_Speed,2500,,,,,,,
PRO,升降轴(轴2)P6速度,UpDownAxis_P6_Speed,1000,,,,,,,
PRO,升降轴(轴2)P7速度,UpDownAxis_P7_Speed,1000,,,,,, ,
PRO,升降轴(轴2)P8速度,UpDownAxis_P8_Speed,1000,,,,,,,
PRO,旋转轴(轴1)P1速度,MiddleAxis_P1_Speed,1200,,,,,,,
PRO,旋转轴(轴1)P2速度,MiddleAxis_P2_Speed,1200,,,,,,,
PRO,进出轴(轴3)P1速度,InOutAxis_P1_Speed,1000,,,,,,,
PRO,进出轴(轴3)P2速度,InOutAxis_P2_Speed,1000,,,,,,,
PRO,进出轴(轴3)P3速度,InOutAxis_P3_Speed,1000,,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最小值,MiddleAxis_ErrorCountMin,10,,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最小值,UpdownAxis_ErrorCountMin,10,,,,,, ,
PRO,(轴三)进出轴停止时可误差的脉冲数的最小值,InoutAxis_ErrorCountMin,10,,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最大值,MiddleAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最大值,UpdownAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,, ,
PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,,
PRO,(轴二)升降轴最小限位,UpdownAxis_PositionMin,0,,,,,,,
PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,,
PRO,(轴一)旋转轴最大限位,MiddleAxis_PositionMax,0,,,,,,,
PRO,(轴二)升降轴最大限位,UpdownAxis_PositionMax,0,,,,,,,
PRO,(轴三)进出轴最大限位,InoutAxis_PositionMax,0,,,,,,,
PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,,,
PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
,,,,,,,,, ,
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM3,,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,,
PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,5000,,,,,,,
PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,6000,,,,,,,
PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,6000,,,,,,,
PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,3000,,,,,,,
PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,3000,,,,,,,
PRO,硕科步进电机(压紧轴)控制归零速度(原点返回速度),CompressAxis_HomeSpeed,5000,,,,,,,
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,,,
,,,,,,,,, ,
PRO,模拟量IO模块的IP地址,AIDevice_IP,192.168.200.12,,,,,,,
PRO,模拟信号1默认高度,AIDI1_DefaultPosition,2920,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,2920,,,,,,,
PRO,模拟信号3默认高度,AIDI3_DefaultPosition,2920,,,,,,,
,,,,,,,,, ,
PRO,模拟信号1的地址,AIDI1_Addr,7,,,,,,,
PRO,模拟信号2的地址,AIDI2_Addr,8,,,,,,,
类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID, 类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID,
PRO,IO模块对应的DI数量,IO_DILength,192.168.200.11#8,,,,,,, DI,L侧门禁,DoorLimit,3,PRO_AOI_IP_1,0,料盘检测1(进料口),X04,DI-04,0,
PRO,模块对应的DO数量,IO_DOLength,192.168.200.11#8,,,,,,, ,,,,,,,,,,
PRO,是否有仓门,HasDoor,1,,,,,,, DI,L侧料盘检测1(识别区),TrayCheck_1,0,PRO_AOI_IP_2,0,L侧料盘检测1(识别区),X21,DI-21,0,
PRO,IO模块IP,PRO_AOI_IP_1,192.168.200.11,,,,,,, DI,L侧料盘检测2(识别区),TrayCheck_2,1,PRO_AOI_IP_2,0,L侧料盘检测2(识别区),X22,DI-22,0,
DI,L侧料盘检测3(识别区),TrayCheck_3,2,PRO_AOI_IP_2,0,L侧料盘检测3(识别区),X23,DI-23,0,
DI,L侧料盘检测4(识别区),TrayCheck_4,3,PRO_AOI_IP_2,0,L侧料盘检测4(识别区),X24,DI-24,0,
DI,L侧入料口移门关闭端,EntranceDoor_Close,4,PRO_AOI_IP_2,0,L侧入料口移门关闭端,X25,DI-25,0,
DI,L侧入料口移门打开端,EntranceDoor_Open,5,PRO_AOI_IP_2,0,L侧入料口移门打开端,X26,DI-26,0,
DI,L侧线体入料口检测,LineIn_Check,6,PRO_AOI_IP_2,0,L侧线体入料口检测,X27,DI-27,0,
DI,L侧线体取料位检测,LineTake_Check,7,PRO_AOI_IP_2,0,L侧线体取料位检测,X28,DI-28,0,
DI,L侧料叉压紧确认检测,Compress_Check,8,PRO_AOI_IP_2,0,L侧料叉压紧确认检测,X29,DI-29,0,
DI,L侧NG料口料盘检测,NGTrayCheck,9,PRO_AOI_IP_2,0,L侧NG料口料盘检测,X30,DI-30,0,
DI,L侧NG料口升降门上升端,NGDoowCylinder_Up,10,PRO_AOI_IP_2,0,L侧NG料口升降门上升端,X31,DI-31,0,
DI,L侧NG料口升降门上升端,NGDoorCylinder_Down,11,PRO_AOI_IP_2,0,L侧NG料口升降门上升端,X32,DI-32,0,
DI,L侧顶升装置上升端,TopCylinder_Up,12,PRO_AOI_IP_2,0,L侧顶升装置上升端,X33,DI-33,0,
DI,L侧顶升装置下降端,TopCylinder_Down,13,PRO_AOI_IP_2,0,L侧顶升装置下降端,X34,DI-34,0,
DI,L侧定位装置上升端,LocationCylinder_Up,14,PRO_AOI_IP_2,0,L侧定位装置上升端,X35,DI-35,0,
DI,L侧定位装置下降端,LocationCylinder_Down,15,PRO_AOI_IP_2,0,L侧定位装置下降端,X36,DI-36,0,
,,,,,,,,,,
DO,L侧料仓运转ON,Run_Signal,0,PRO_AOI_IP_2,0,L侧料仓运转ON,Y21,DO-21,0,
DO,L侧轴2刹车电源ON,Axis_Brake,1,PRO_AOI_IP_2,0,L侧轴2刹车电源ON,Y22,DO-22,0,
DO,L侧相机光源ON,Camera_Led,2,PRO_AOI_IP_2,0,L侧相机光源ON,Y23,DO-23,0,
DO,L侧入料口移门关闭,EntranceDoor_Close,3,PRO_AOI_IP_2,0,L侧入料口移门关闭,Y24,DO-24,0,
DO,L侧入料口移门打开,EntranceDoor_Open,4,PRO_AOI_IP_2,0,L侧入料口移门打开,Y25,DO-25,0,
DO,L侧线体正转,Line_Run,5,PRO_AOI_IP_2,0,L侧线体正转,Y26,DO-26,0,
DO,L侧线体反转,Line_BackRun,6,PRO_AOI_IP_2,0,L侧线体反转,Y27,DO-27,0,
DO,L侧料仓吹气SOL,StartOrStopBlow,7,PRO_AOI_IP_2,0,L侧料仓吹气SOL,Y28,DO-28,0,
DO,L侧NG料口升降门上升SOL,NGDoowCylinder_Up,8,PRO_AOI_IP_2,0,L侧NG料口升降门上升SOL,Y29,DO-29,0,
DO,L侧NG料口升降门下降SOL,NGDoorCylinder_Down,9,PRO_AOI_IP_2,0,L侧NG料口升降门下降SOL,Y30,DO-30,0,
DO,L侧顶升装置上升SOL,TopCylinder_Up,10,PRO_AOI_IP_2,0,L侧顶升装置上升SOL,Y31,DO-31,0,
DO,L侧顶升装置下降SOL,TopCylinder_Down,11,PRO_AOI_IP_2,0,L侧顶升装置下降SOL,Y32,DO-32,0,
DO,L侧定位装置上升SOL,LocationCylinder_Up,12,PRO_AOI_IP_2,0,L侧定位装置上升SOL,Y33,DO-33,0,
DO,L侧定位装置下降SOL,LocationCylinder_Down,13,PRO_AOI_IP_2,0,L侧定位装置下降SOL,Y34,DO-34,0,
,,,14,PRO_AOI_IP_2,0,,Y35,DO-35,0,
,,,15,PRO_AOI_IP_2,0,,Y36,DO-36,0,
,,,,,,,,,, ,,,,,,,,,,
DI,急停,SuddenStop_BTN,0,PRO_AOI_IP_1,0,急停,X01,DI-01,0,
DI,复位,Reset_BTN,1,PRO_AOI_IP_1,0,复位,X02,DI-02,0,
DI,门禁,DoorLimit,2,PRO_AOI_IP_1,0,门禁,X03,DI-03,0,
DI,料盘检测1(进料口),TrayCheck_Door,3,PRO_AOI_IP_1,0,料盘检测1(进料口),X04,DI-04,0,
DI,料盘检测2(料叉),TrayCheck_Fixture,4,PRO_AOI_IP_1,0,料盘检测2(料叉),X05,DI-05,0,
DI,气压检测,Airpressure_Check,5,PRO_AOI_IP_1,0,气压检测,X06,DI-06,0,
DI,进料口门上升端,Door_Up,6,PRO_AOI_IP_1,0,进料口门上升端,X07,DI-07,0,
DI,进料口门下降端,Door_Down,7,PRO_AOI_IP_1,0,进料口门下降端,X08,DI-08,0,
DO,自动指示灯,AutoRun_HddLed,0,PRO_AOI_IP_1,0,自动指示灯,Y01,DO-01,0,
DO,故障指示灯,Alarm_HddLed,1,PRO_AOI_IP_1,0,故障指示灯,Y02,DO-02,0,
DO,待机指示灯,RunSign_HddLed,2,PRO_AOI_IP_1,0,待机指示灯,Y03,DO-03,0,
DO,料仓运转ON,Run_Signal,3,PRO_AOI_IP_1,0,料仓运转ON,Y04,DO-04,0,
DO,轴2刹车电源ON,Axis_Brake,4,PRO_AOI_IP_1,0,轴2刹车电源ON,Y05,DO-05,0,
DO,料仓吹气SOL,StartOrStopBlow,5,PRO_AOI_IP_1,0,料仓吹气SOL,Y06,DO-06,0,
DO,进料口门上升SOL,Door_Up,6,PRO_AOI_IP_1,0,进料口门上升SOL,Y07,DO-07,0,
DO,进料口门下降SOL,Door_Down,7,PRO_AOI_IP_1,0,进料口门下降SOL,Y08,DO-08,0,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM1,0,,,,, AXIS,(轴一)旋转轴,Middle_Axis,1,COM1,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,2,COM1,0,,,,, AXIS,(轴二)升降轴轴,UpDown_Axis,2,COM1,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,3,COM1,0,,,,, AXIS,(轴三)进出轴,InOut_Axis,3,COM1,0,,,,,
...@@ -31,13 +46,7 @@ PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,, ...@@ -31,13 +46,7 @@ PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,,
PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,268093,,,,,,, PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,268093,,,,,,,
PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,, PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,10000,,,,,,, PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,10000,,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,, ,,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,,,
PRO,预警湿度,WarnHumidity,80,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,250,,,,,,, PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,250,,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,80,,,,,,, PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,80,,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,80,,,,,,, PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,80,,,,,,,
...@@ -65,7 +74,7 @@ PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,200,,,,,,, ...@@ -65,7 +74,7 @@ PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,200,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,250,,,,,,, PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,250,,,,,,,
PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,250,,,,,,, PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,250,,,,,,,
PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,250,,,,,,, PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,250,,,,,,,
PRO,升降轴(轴2)P4速度,UpDownAxis_P4_Speed,150,,,,,,, PRO,升降轴(轴2)P4速度,UpDownAxis_P4_Speed,150,,,,,,,
PRO,升降轴(轴2)P5速度,UpDownAxis_P5_Speed,250,,,,,,, PRO,升降轴(轴2)P5速度,UpDownAxis_P5_Speed,250,,,,,,,
PRO,升降轴(轴2)P6速度,UpDownAxis_P6_Speed,100,,,,,,, PRO,升降轴(轴2)P6速度,UpDownAxis_P6_Speed,100,,,,,,,
...@@ -84,21 +93,26 @@ PRO,(轴二)升降轴轴停止时可误差的脉冲数的最小值,UpdownAxis_ErrorCountMin,10,,,, ...@@ -84,21 +93,26 @@ PRO,(轴二)升降轴轴停止时可误差的脉冲数的最小值,UpdownAxis_ErrorCountMin,10,,,,
PRO,(轴三)进出轴停止时可误差的脉冲数的最小值,InoutAxis_ErrorCountMin,10,,,,,,, PRO,(轴三)进出轴停止时可误差的脉冲数的最小值,InoutAxis_ErrorCountMin,10,,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最大值,MiddleAxis_ErrorCountMax,1000,,,,,,, PRO,(轴一)旋转轴停止时可误差的脉冲数的最大值,MiddleAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最大值,UpdownAxis_ErrorCountMax,1000,,,,,,, PRO,(轴二)升降轴轴停止时可误差的脉冲数的最大值,UpdownAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,,, PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,, ,
PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,, PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,,
PRO,(轴二)升降轴最小限位,UpdownAxis_PositionMin,0,,,,,,, PRO,(轴二)升降轴最小限位,UpdownAxis_PositionMin,0,,,,,,,
PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,, PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,,
PRO,(轴一)旋转轴最大限位,MiddleAxis_PositionMax,0,,,,,,, PRO,(轴一)旋转轴最大限位,MiddleAxis_PositionMax,0,,,,,,,
PRO,(轴二)升降轴最大限位,UpdownAxis_PositionMax,0,,,,,,, PRO,(轴二)升降轴最大限位,UpdownAxis_PositionMax,0,,,,,,,
PRO,(轴三)进出轴最大限位,InoutAxis_PositionMax,0,,,,,,, PRO,(轴三)进出轴最大限位,InoutAxis_PositionMax,0,,,,,,,
,,,,,,,,, ,
,,,,,,,,, ,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,
,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,, ,
PRO,预警湿度,WarnHumidity,80,,,,,, ,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,,,
PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,,, PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,,,
PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,, PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,, PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,, PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM2,,,,,,, PRO,温湿度端口号,Humiture_Port,COM2,,,,,,,
,,,,,,,,, ,
,,,,,,,,, ,
类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID,
DI,R侧门禁,DoorLimit,4,PRO_AOI_IP_1,0,料盘检测2(料叉),X05,DI-05,0,
,,,,,,,,,,
DI,R侧料盘检测1(识别区),TrayCheck_1,0,PRO_AOI_IP_3,0,R侧料盘检测1(识别区),X41,DI-41,0,
DI,R侧料盘检测2(识别区),TrayCheck_2,1,PRO_AOI_IP_3,0,R侧料盘检测2(识别区),X42,DI-42,0,
DI,R侧料盘检测3(识别区),TrayCheck_3,2,PRO_AOI_IP_3,0,R侧料盘检测3(识别区),X43,DI-43,0,
DI,R侧料盘检测4(识别区),TrayCheck_4,3,PRO_AOI_IP_3,0,R侧料盘检测4(识别区),X44,DI-44,0,
DI,R侧入料口移门关闭端,EntranceDoor_Close,4,PRO_AOI_IP_3,0,R侧入料口移门关闭端,X45,DI-45,0,
DI,R侧入料口移门打开端,EntranceDoor_Open,5,PRO_AOI_IP_3,0,R侧入料口移门打开端,X46,DI-46,0,
DI,R侧线体入料口检测,LineIn_Check,6,PRO_AOI_IP_3,0,R侧线体入料口检测,X47,DI-47,0,
DI,R侧线体取料位检测,LineTake_Check,7,PRO_AOI_IP_3,0,R侧线体取料位检测,X48,DI-48,0,
DI,R侧料叉压紧确认检测,Compress_Check,8,PRO_AOI_IP_3,0,R侧料叉压紧确认检测,X49,DI-49,0,
DI,R侧NG料口料盘检测,NGTrayCheck,9,PRO_AOI_IP_3,0,R侧NG料口料盘检测,X50,DI-50,0,
DI,R侧NG料口升降门上升端,NGDoowCylinder_Up,10,PRO_AOI_IP_3,0,R侧NG料口升降门上升端,X51,DI-51,0,
DI,R侧NG料口升降门上升端,NGDoorCylinder_Down,11,PRO_AOI_IP_3,0,R侧NG料口升降门上升端,X52,DI-52,0,
DI,R侧顶升装置上升端,TopCylinder_Up,12,PRO_AOI_IP_3,0,R侧顶升装置上升端,X53,DI-53,0,
DI,R侧顶升装置下降端,TopCylinder_Down,13,PRO_AOI_IP_3,0,R侧顶升装置下降端,X54,DI-54,0,
DI,R侧定位装置上升端,LocationCylinder_Up,14,PRO_AOI_IP_3,0,R侧定位装置上升端,X55,DI-55,0,
DI,R侧定位装置下降端,LocationCylinder_Down,15,PRO_AOI_IP_3,0,R侧定位装置下降端,X56,DI-56,0,
,,,,,,,,,,
DO,R侧料仓运转ON,Run_Signal,0,PRO_AOI_IP_3,0,R侧料仓运转ON,Y41,DO-41,0,
DO,R侧轴2刹车电源ON,Axis_Brake,1,PRO_AOI_IP_3,0,R侧轴2刹车电源ON,Y42,DO-42,0,
DO,R侧相机光源ON,Camera_Led,2,PRO_AOI_IP_3,0,R侧相机光源ON,Y43,DO-43,0,
DO,R侧入料口移门关闭,EntranceDoor_Close,3,PRO_AOI_IP_3,0,R侧入料口移门关闭,Y44,DO-44,0,
DO,R侧入料口移门打开,EntranceDoor_Open,4,PRO_AOI_IP_3,0,R侧入料口移门打开,Y45,DO-45,0,
DO,R侧线体正转,Line_Run,5,PRO_AOI_IP_3,0,R侧线体正转,Y46,DO-46,0,
DO,R侧线体反转,Line_BackRun,6,PRO_AOI_IP_3,0,R侧线体反转,Y47,DO-47,0,
DO,R侧料仓吹气SOL,StartOrStopBlow,7,PRO_AOI_IP_3,0,R侧料仓吹气SOL,Y48,DO-48,0,
DO,R侧NG料口升降门上升SOL,NGDoowCylinder_Up,8,PRO_AOI_IP_3,0,R侧NG料口升降门上升SOL,Y49,DO-49,0,
DO,R侧NG料口升降门上升SOL,NGDoorCylinder_Down,9,PRO_AOI_IP_3,0,R侧NG料口升降门上升SOL,Y50,DO-50,0,
DO,R侧顶升装置上升SOL,TopCylinder_Up,10,PRO_AOI_IP_3,0,R侧顶升装置上升SOL,Y51,DO-51,0,
DO,R侧顶升装置下降SOL,TopCylinder_Down,11,PRO_AOI_IP_3,0,R侧顶升装置下降SOL,Y52,DO-52,0,
DO,R侧定位装置上升SOL,LocationCylinder_Up,12,PRO_AOI_IP_3,0,R侧定位装置上升SOL,Y53,DO-53,0,
DO,R侧定位装置下降SOL,LocationCylinder_Down,13,PRO_AOI_IP_3,0,R侧定位装置下降SOL,Y54,DO-54,0,
,,,14,PRO_AOI_IP_3,0,,Y55,DO-55,0,
,,,15,PRO_AOI_IP_3,0,,Y56,DO-56,0,
,,,,,,,,,,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM1,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,2,COM1,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,3,COM1,0,,,,,
AXIS,(轴四)压紧轴,Comp_Axis,4,COM1,0,,,,,
PRO,升降轴 进料口取料点 P1,UpDownAxis_DoorOPosition_P1,403000,,,,,,,
PRO,升降轴 进料口出料前点 P2,UpDownAxis_DoorIPosition_P2,415000,,,,,,,
PRO,升降轴 进料口取料缓冲点 P7,UpDownAxis_DoorOBPosition_P7,415000,,,,,,,
PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,,
PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,268093,,,,,,,
PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,10000,,,,,,,
,,,,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,250,,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,80,,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,80,,,,,,,
PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,80,,,,,,,
PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,50,,,,,,,
PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,150,,,,,,,
PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,400,,,,,,,
PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,400,,,,,,,
PRO,(轴二)升降轴轴原点低速度,UpdownAxis_HomeLowSpeed,100,,,,,,,
PRO,(轴二)升降轴轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,,,
PRO,(轴二)升降轴轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,,,
PRO,(轴三)进出轴目标速度,InoutAxis_TargetSpeed,100,,,,,,,
PRO,(轴三)进出轴加速度,InoutAxis_AddSpeed,300,,,,,,,
PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,300,,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,200,,,,,,,
PRO,(轴四)压紧轴目标速度,CompAxis_TargetSpeed,100,,,,,,,
PRO,(轴四)压紧轴加速度,CompAxis_AddSpeed,300,,,,,,,
PRO,(轴四)压紧轴减速度,CompAxis_DelSpeed,300,,,,,,,
PRO,(轴四)压紧轴原点低速,CompAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴四)压紧轴原点高速,CompAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,200,,,,,,,
,,,,,,,,,,
PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,250,,,,,,,
PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,250,,,,,,,
PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,250,,,,,,,
PRO,升降轴(轴2)P4速度,UpDownAxis_P4_Speed,150,,,,,,,
PRO,升降轴(轴2)P5速度,UpDownAxis_P5_Speed,250,,,,,,,
PRO,升降轴(轴2)P6速度,UpDownAxis_P6_Speed,100,,,,,,,
PRO,升降轴(轴2)P7速度,UpDownAxis_P7_Speed,100,,,,,, ,
PRO,升降轴(轴2)P8速度,UpDownAxis_P8_Speed,100,,,,,,,
PRO,旋转轴(轴1)P1速度,MiddleAxis_P1_Speed,120,,,,,,,
PRO,旋转轴(轴1)P2速度,MiddleAxis_P2_Speed,120,,,,,,,
PRO,进出轴(轴3)P1速度,InOutAxis_P1_Speed,100,,,,,,,
PRO,进出轴(轴3)P2速度,InOutAxis_P2_Speed,100,,,,,,,
PRO,进出轴(轴3)P3速度,InOutAxis_P3_Speed,1000,,,,,,,
PRO,压紧轴(轴4)P1速度,CompAxis_P1_Speed,100,,,,,,,
PRO,压紧轴(轴4)P2速度,CompAxis_P2_Speed,100,,,,,,,
PRO,压紧轴(轴4)P3速度,CompAxis_P3_Speed,100,,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最小值,MiddleAxis_ErrorCountMin,10,,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最小值,UpdownAxis_ErrorCountMin,10,,,,,, ,
PRO,(轴三)进出轴停止时可误差的脉冲数的最小值,InoutAxis_ErrorCountMin,10,,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最大值,MiddleAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最大值,UpdownAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,, ,
PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,,
PRO,(轴二)升降轴最小限位,UpdownAxis_PositionMin,0,,,,,,,
PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,,
PRO,(轴一)旋转轴最大限位,MiddleAxis_PositionMax,0,,,,,,,
PRO,(轴二)升降轴最大限位,UpdownAxis_PositionMax,0,,,,,,,
PRO,(轴三)进出轴最大限位,InoutAxis_PositionMax,0,,,,,,,
,,,,,,,,, ,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,
,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,, ,
PRO,预警湿度,WarnHumidity,80,,,,,, ,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,,,
PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,,,
PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM2,,,,,,,
类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID,
PRO,IO模块对应的DI数量,IO_DILength,192.168.100.30#8;192.168.100.32#8;192.168.100.34#8;192.168.100.36#8;192.168.100.38#8;,,,,,
PRO,IO模块对应的DO数量,IO_DOLength,192.168.100.30#8;192.168.100.32#8;192.168.100.34#8;192.168.100.36#8;192.168.100.38#8;,,,,,
PRO,是否有仓门,HasDoor,1,,,,,,,
PRO,IO模块IP,PRO_AOI_IP_1,192.168.200.11,,,,,,,
PRO,IO模块IP,PRO_AOI_IP_2,192.168.200.12,,,,,,,
PRO,IO模块IP,PRO_AOI_IP_3,192.168.200.13,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
DI,急停,SuddenStop_BTN,0,PRO_AOI_IP_1,0,急停,X01,DI-01,0,
DI,复位,Reset_BTN,1,PRO_AOI_IP_1,0,复位,X02,DI-02,0,
DI,气压检测,Airpressure_Check,2,PRO_AOI_IP_1,0,门禁,X03,DI-03,0,
DI,L侧门禁,DoorLimit_L,3,PRO_AOI_IP_1,0,料盘检测1(进料口),X04,DI-04,0,
DI,R侧门禁,DoorLimit_R,4,PRO_AOI_IP_1,0,料盘检测2(料叉),X05,DI-05,0,
,,,5,PRO_AOI_IP_1,0,气压检测,X06,DI-06,0,
,,,6,PRO_AOI_IP_1,0,进料口门上升端,X07,DI-07,0,
,,,7,PRO_AOI_IP_1,0,进料口门下降端,X08,DI-08,0,
,,,8,PRO_AOI_IP_1,0,,X09,DI-09,0,
,,,9,PRO_AOI_IP_1,0,,X10,DI-10,0,
,,,10,PRO_AOI_IP_1,0,,X11,DI-11,0,
,,,11,PRO_AOI_IP_1,0,,X12,DI-12,0,
,,,12,PRO_AOI_IP_1,0,,X13,DI-13,0,
,,,13,PRO_AOI_IP_1,0,,X14,DI-14,0,
,,,14,PRO_AOI_IP_1,0,,X15,DI-15,0,
,,,15,PRO_AOI_IP_1,0,,X16,DI-16,0,
,,,,,,,,,,
DO,自动指示灯,AutoRun_HddLed,0,PRO_AOI_IP_1,0,自动指示灯,Y01,DO-01,0,
DO,故障指示灯,Alarm_HddLed,1,PRO_AOI_IP_1,0,故障指示灯,Y02,DO-02,0,
DO,待机指示灯,RunSign_HddLed,2,PRO_AOI_IP_1,0,待机指示灯,Y03,DO-03,0,
DO,报警蜂鸣器,Alarm_Buzzer,3,PRO_AOI_IP_1,0,报警蜂鸣器,Y04,DO-04,0,
DO,NG料线体电机运转,NGLine_Run,4,PRO_AOI_IP_1,0,NG料线体电机运转,Y05,DO-05,0,
,,,5,PRO_AOI_IP_1,0,,Y06,DO-06,0,
,,,6,PRO_AOI_IP_1,0,,Y07,DO-07,0,
,,,7,PRO_AOI_IP_1,0,,Y08,DO-08,0,
,,,8,PRO_AOI_IP_1,0,,Y09,DO-09,0,
,,,9,PRO_AOI_IP_1,0,,Y10,DO-10,0,
,,,10,PRO_AOI_IP_1,0,,Y11,DO-11,0,
,,,11,PRO_AOI_IP_1,0,,Y12,DO-12,0,
,,,12,PRO_AOI_IP_1,0,,Y13,DO-13,0,
,,,13,PRO_AOI_IP_1,0,,Y14,DO-14,0,
,,,14,PRO_AOI_IP_1,0,,Y15,DO-15,0,
,,,15,PRO_AOI_IP_1,0,,Y16,DO-16,0,
,,,,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,
,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,, ,
PRO,预警湿度,WarnHumidity,80,,,,,, ,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,,,
PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,,,
PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM2,,,,,,,
...@@ -16,53 +16,56 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,53 +16,56 @@ namespace OnlineStore.DeviceLibrary
#region KNDIO #region KNDIO
public static void IOMove(string ioType, IO_VALUE ioValue) public static void IOMove(string ioType, IO_VALUE ioValue, int subType = 0)
{ {
if (StoreManager.Config.StoreDOList.ContainsKey(ioType)) ConfigIO configIo = GetDO(ioType, subType);
if (configIo != null)
{ {
ConfigIO configIo = StoreManager.Config.StoreDOList[ioType];
//DateTime time = DateTime.Now;
instance.WriteSingleDO(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr(), ioValue); instance.WriteSingleDO(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr(), ioValue);
//TimeSpan span = DateTime.Now - time;
//if (span.TotalMilliseconds > 100)
//{
// LogUtil.error("IOMove [" + ioType + "] ["+ioValue+"]耗时" + span.TotalMilliseconds);
//}
Thread.Sleep(60); Thread.Sleep(60);
} }
else else
{ {
LogUtil.error("没有DO=" + ioType); LogUtil.error("未找到DO,[" + ioType + "][" + subType + "]");
} }
} }
public static IO_VALUE IOValue(string ioType) public static IO_VALUE IOValue(string ioType, int subType)
{ {
IO_VALUE ioValue = IO_VALUE.LOW; IO_VALUE ioValue = IO_VALUE.LOW;
if (StoreManager.Config.StoreDIList.ContainsKey(ioType)) ConfigIO configIo = GetDI(ioType, subType);
if (configIo == null)
{ {
ConfigIO configIo = StoreManager.Config.StoreDIList[ioType]; configIo = GetDO(ioType, subType);
ioValue = instance.GetDIValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr());
//UpdateDoValue(ioType, ioValue);
} }
else if (StoreManager.Config.StoreDOList.ContainsKey(ioType))
if (configIo != null)
{ {
ConfigIO configIo = StoreManager.Config.StoreDOList[ioType]; if (configIo.ProType.Equals(ConfigItemType.DI))
ioValue = instance.GetDOValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr()); {
ioValue = instance.GetDIValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr());
}
else
{
ioValue = instance.GetDOValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr());
}
} }
else else
{ {
LogUtil.error("没有DO=" + ioType); LogUtil.error("未找到IO[" + ioType + "][" + subType + "]");
} }
return ioValue; return ioValue;
} }
public static IO_VALUE DOValue(string ioType) public static IO_VALUE DOValue(string ioType, int subType = 0)
{ {
IO_VALUE ioValue = IO_VALUE.LOW; IO_VALUE ioValue = IO_VALUE.LOW;
if (StoreManager.Config.StoreDOList.ContainsKey(ioType)) ConfigIO configIo = GetDO(ioType, subType);
if (configIo != null)
{ {
ConfigIO configIo = StoreManager.Config.StoreDOList[ioType];
ioValue = instance.GetDOValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr()); ioValue = instance.GetDOValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr());
} }
else else
...@@ -71,6 +74,78 @@ namespace OnlineStore.DeviceLibrary ...@@ -71,6 +74,78 @@ namespace OnlineStore.DeviceLibrary
} }
return ioValue; return ioValue;
} }
private static ConfigIO GetDI(string ioType, int subType)
{
ConfigIO configIo = null;
if (subType <= 0)
{
if (StoreManager.Config.DIList.ContainsKey(ioType))
{
return StoreManager.Config.DIList[ioType];
}
}
else
{
if (StoreManager.AllConfigMap.ContainsKey(subType))
{
string newType = ioType.Replace("SW1_", "SW_").Replace("SW2_", "SW_").Replace("SW3_", "SW_").Replace("SW4_", "SW_");
if (StoreManager.AllConfigMap[subType].DIList.ContainsKey(newType))
{
return StoreManager.AllConfigMap[subType].DIList[newType];
}
}
}
return configIo;
}
private static ConfigIO GetDO(string ioType, int subType)
{
ConfigIO configIo = null;
if (subType <= 0)
{
if (StoreManager.Config.DOList.ContainsKey(ioType))
{
return StoreManager.Config.DOList[ioType];
}
}
else
{
if (StoreManager.AllConfigMap.ContainsKey(subType))
{
string newType = ioType.Replace("SW1_", "SW_").Replace("SW2_", "SW_").Replace("SW3_", "SW_").Replace("SW4_", "SW_");
if (StoreManager.AllConfigMap[subType].DOList.ContainsKey(newType))
{
return StoreManager.AllConfigMap[subType].DOList[newType];
}
}
}
return configIo;
}
public static void CloseDeviceDO(List<ConfigIO> DoList)
{
foreach (ConfigIO io in DoList)
{
instance.WriteSingleDO(io.IO_IP, io.SlaveID, io.GetIOAddr(), IO_VALUE.LOW);
Thread.Sleep(60);
}
}
public static void CloseDeviceDO(int subType)
{
List<ConfigIO> DoList = new List<ConfigIO>();
if (subType <= 0)
{
DoList = new List<ConfigIO>(StoreManager.Config.DOList.Values);
}
else
{
if (StoreManager.AllConfigMap.ContainsKey(subType))
{
DoList = new List<ConfigIO>(StoreManager.AllConfigMap[subType].DOList.Values);
}
}
CloseDeviceDO(DoList);
}
#endregion #endregion
public static void Init() public static void Init()
{ {
...@@ -84,7 +159,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -84,7 +159,7 @@ namespace OnlineStore.DeviceLibrary
instance = new KNDManager(); instance = new KNDManager();
} }
} }
public abstract void ReadAllDI(string deviceName, byte slaveId); public abstract void ReadAllDI(string deviceName, byte slaveId);
public abstract void ReadAllDO(string deviceName, byte slaveId); public abstract void ReadAllDO(string deviceName, byte slaveId);
...@@ -92,18 +167,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -92,18 +167,14 @@ namespace OnlineStore.DeviceLibrary
public abstract void WriteSingleDO(string deviceName, byte slaveId, ushort index, IO_VALUE value); public abstract void WriteSingleDO(string deviceName, byte slaveId, ushort index, IO_VALUE value);
public abstract IO_VALUE GetDIValue(string deviceName, byte slaveID, ushort v); public abstract IO_VALUE GetDIValue(string deviceName, byte slaveID, ushort v);
public abstract IO_VALUE GetDOValue(string deviceName, byte slaveID, ushort v); public abstract IO_VALUE GetDOValue(string deviceName, byte slaveID, ushort v);
public abstract IO_VALUE GetIOValue(ConfigIO configIO); public abstract IO_VALUE GetIOValue(ConfigIO configIO);
public abstract void CloseAllDO(); public abstract void CloseAllDO();
public abstract void CloseAllConnection(); public abstract void CloseAllConnection();
} }
......
...@@ -14,7 +14,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -14,7 +14,7 @@ namespace OnlineStore.DeviceLibrary
public class CodeManager public class CodeManager
{ {
public static List<string> cameraNameList = new List<string>(); // public static List<string> cameraNameList = new List<string>();
public static List<string> codeTypeList = new List<string>(); public static List<string> codeTypeList = new List<string>();
public static List<string> balserNameList = new List<string>(); public static List<string> balserNameList = new List<string>();
...@@ -23,56 +23,86 @@ namespace OnlineStore.DeviceLibrary ...@@ -23,56 +23,86 @@ namespace OnlineStore.DeviceLibrary
private static char spiltChar = '#'; private static char spiltChar = '#';
/// <summary> /// <summary>
/// 初始化摄像机名称和二维码类型 /// 初始化摄像机名称和二维码类型
/// </summary> /// </summary>
/// <param name="nameStr">摄像机名称,多个用#分割</param> public static void LoadConfig()
/// <param name="codeStr">二维码类型,多个用#分割</param>
public static void LoadConfig(string nameStr, string codeStr)
{ {
cameraNameList = new List<string>(); // string nameStr = ConfigAppSettings.GetValue(Setting_Init.CameraName);
string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType);
// cameraNameList = new List<string>();
codeTypeList = new List<string>(); codeTypeList = new List<string>();
HDLogUtil.LogName = "RollingLogFileAppender"; HDLogUtil.LogName = "RollingLogFileAppender";
try try
{ {
string[] nameArray = nameStr.Split(spiltChar); //string[] nameArray = nameStr.Split(spiltChar);
foreach (string str in nameArray) //foreach (string str in nameArray)
{ //{
LogUtil.info("加载到配置摄像机名称:" + str.Trim()); // if (str.Trim().Equals(""))
cameraNameList.Add(str.Trim()); // {
} // continue;
// }
// //LogUtil.info("加载到配置摄像机名称:" + str.Trim());
// cameraNameList.Add(str.Trim());
//}
string[] codeArray = codeStr.Split(spiltChar); string[] codeArray = codeStr.Split(spiltChar);
foreach (string str in codeArray) foreach (string str in codeArray)
{ {
if (str.Trim().Equals(""))
{
continue;
}
LogUtil.info("加载到配置二维码类型:" + str.Trim()); LogUtil.info("加载到配置二维码类型:" + str.Trim());
codeTypeList.Add(str.Trim()); codeTypeList.Add(str.Trim());
} }
LoadCamera(false); LoadCamera(false);
CodeLibrary.HDCodeLearnHelper.LoadConfig(nameStr, codeStr); CodeLibrary.HDCodeLearnHelper.LoadConfig("", codeStr);
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("解析摄像机配置出错:" + ex.ToString()); LogUtil.error("解析摄像机配置出错:" + ex.StackTrace);
} }
} }
private static void LoadCamera(bool isReLoad) private static void LoadCamera(bool isReLoad)
{ {
if (isReLoad) if (isReLoad)
{ {
CodeLibrary.HIKCamera.Instance.Load(); try
CodeLibrary.BaslerCamera.Instance.Load(); {
CodeLibrary.HIKCamera.Instance.Load();
}
catch (Exception ex)
{
LogUtil.error("加载HIK相机出错:" + ex.ToString());
}
try
{
CodeLibrary.BaslerCamera.Instance.Load();
}
catch (Exception ex)
{
LogUtil.error("加载Basler相机出错:" + ex.ToString());
}
} }
string[] names = CodeLibrary.HIKCamera.Instance.CameraName; string[] names = CodeLibrary.HIKCamera.Instance.CameraName;
hikNameList.AddRange(names);
names = CodeLibrary.BaslerCamera.Instance.CameraName;
balserNameList.AddRange(names); if (names != null)
foreach (string name in hikNameList)
{ {
LogUtil.info("加载到HIK相机:" + name); hikNameList.AddRange(names);
foreach (string name in hikNameList)
{
LogUtil.info("加载到HIK相机:" + name);
}
} }
foreach (string name in balserNameList) names = CodeLibrary.BaslerCamera.Instance.CameraName;
if (names != null)
{ {
LogUtil.info("加载到Balser相机:" + name); balserNameList.AddRange(names);
foreach (string name in balserNameList)
{
LogUtil.info("加载到Balser相机:" + name);
}
} }
} }
public static void CloseCamera() public static void CloseCamera()
...@@ -88,17 +118,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -88,17 +118,13 @@ namespace OnlineStore.DeviceLibrary
{ {
if (balserNameList.Contains(cameraName)) if (balserNameList.Contains(cameraName))
{ {
bool result = BaslerCamera.Instance.IsOpen; bool result = BaslerCamera.Instance.Open(cameraName);
if (!result) // LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
{
result = BaslerCamera.Instance.Open(cameraName);
LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
}
if (result) if (result)
{ {
BaslerCamera.Instance.GrabOne(); BaslerCamera.Instance.GrabOne();
bitm = BaslerCamera.Instance.Image; bitm = BaslerCamera.Instance.Image;
//BaslerCamera.Instance.Close(); BaslerCamera.Instance.Close();
} }
else else
{ {
...@@ -107,17 +133,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -107,17 +133,13 @@ namespace OnlineStore.DeviceLibrary
} }
else if (hikNameList.Contains(cameraName)) else if (hikNameList.Contains(cameraName))
{ {
bool result = HIKCamera.Instance.IsOpen; bool result = HIKCamera.Instance.Open(cameraName);
if (!result) // LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
{
result = HIKCamera.Instance.Open(cameraName);
LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
}
if (result) if (result)
{ {
HIKCamera.Instance.GrabOne(); HIKCamera.Instance.GrabOne();
bitm = HIKCamera.Instance.Image; bitm = HIKCamera.Instance.Image;
//HIKCamera.Instance.Close(); HIKCamera.Instance.Close();
} }
else else
{ {
...@@ -143,11 +165,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -143,11 +165,14 @@ namespace OnlineStore.DeviceLibrary
} }
[HandleProcessCorruptedStateExceptions] [HandleProcessCorruptedStateExceptions]
public static List<string> CameraScan() public static List<string> CameraScan(List<string> cameraNameList = null)
{ {
List<string> codeList = new List<string>(); List<string> codeList = new List<string>();
//List<CodeInfo> allCodeList = new List<CodeInfo>(); //List<CodeInfo> allCodeList = new List<CodeInfo>();
if (cameraNameList == null)
{
return codeList;
}
try try
{ {
foreach (string cameraName in cameraNameList) foreach (string cameraName in cameraNameList)
...@@ -185,7 +210,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -185,7 +210,7 @@ namespace OnlineStore.DeviceLibrary
codeList.Add(c.CodeStr); codeList.Add(c.CodeStr);
r = r + "##" + c.CodeStr; r = r + "##" + c.CodeStr;
} }
LogUtil.info(" 【" + cameraName + "】【" + codeType + "】扫码完成:"+r); LogUtil.debug(" 【" + cameraName + "】【" + codeType + "】扫码完成:"+r);
} }
} }
} }
...@@ -218,6 +243,44 @@ namespace OnlineStore.DeviceLibrary ...@@ -218,6 +243,44 @@ namespace OnlineStore.DeviceLibrary
return ""; return "";
} }
} }
/// <summary>
/// 处理接收后的二维码
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
private static string ReplaceCode(string message)
{
message = message.Trim();
message = message.Replace("\r", "");
message = message.Replace("\n", "");
char a = (char)02;
message = message.Replace(a.ToString(), "");
message = message.Trim();
System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();
byte[] bytes = asciiEncoding.GetBytes(message);
List<byte> newBytes = new List<byte>();
foreach (byte by in bytes)
{
if (!by.Equals(24))
{
newBytes.Add(by);
}
}
message = asciiEncoding.GetString(newBytes.ToArray());
return message;
}
public static string ProcessCode(List<string> codeList)
{
string code = "";
foreach (string cc in codeList)
{
if (string.IsNullOrEmpty(cc))
{
continue;
}
code += cc + "##";
}
return ReplaceCode(code);
}
} }
} }
...@@ -13,10 +13,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -13,10 +13,10 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 出入仓参数(出入库操作时传入的参数类) /// 出入仓参数(出入库操作时传入的参数类)
/// </summary> /// </summary>
public class InOutStoreParam public class InOutParam
{ {
public static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public InOutStoreParam() public InOutParam()
{ {
ACStoreP = null; ACStoreP = null;
this.WareNumber = ""; this.WareNumber = "";
...@@ -27,7 +27,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -27,7 +27,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
/// <param name="wareNo">物品二维码</param> /// <param name="wareNo">物品二维码</param>
/// <param name="position">仓位号</param> /// <param name="position">仓位号</param>
public InOutStoreParam(string wareNo, string posId) public InOutParam(string wareNo, string posId)
{ {
ACStoreP = null; ACStoreP = null;
WareNumber = wareNo; WareNumber = wareNo;
...@@ -35,7 +35,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -35,7 +35,7 @@ namespace OnlineStore.DeviceLibrary
MoveP = null; MoveP = null;
IsSolderPaste = false; IsSolderPaste = false;
} }
public InOutStoreParam(string wareNo, string posId,string plateH,string plateW) public InOutParam(string wareNo, string posId,string plateH,string plateW)
{ {
ACStoreP = null; ACStoreP = null;
WareNumber = wareNo; WareNumber = wareNo;
...@@ -47,7 +47,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -47,7 +47,7 @@ namespace OnlineStore.DeviceLibrary
} }
public InOutStoreParam(string wareNo, string posId, LineMoveP linePosition) public InOutParam(string wareNo, string posId, LineMoveP linePosition)
{ {
ACStoreP = null; ACStoreP = null;
WareNumber = wareNo; WareNumber = wareNo;
......
...@@ -32,8 +32,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -32,8 +32,9 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
protected static Color storeMoveColor = Color.Blue; protected static Color storeMoveColor = Color.Blue;
protected static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); protected static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public string StoreName { get; set; } public string Name { get; set; }
public int StoreID { get; set; } public int DeviceID { get; set; }
public StoreConfig baseConfig = null;
/// <summary> /// <summary>
/// 料仓状态 /// 料仓状态
/// </summary> /// </summary>
...@@ -117,19 +118,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -117,19 +118,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return new TimeSpan(0); return new TimeSpan(0);
} }
} }
protected void AddAxisMoveTime(ConfigMoveAxis axis)
{
//int axisNo = axis.GetAxisValue();
//if (AxisLastStartTime.ContainsKey(axisNo))
//{
// AxisLastStartTime.Remove(axisNo);
//}
//AxisLastStartTime.Add(axisNo, DateTime.Now);
}
/// <summary> /// <summary>
/// 运动处理 /// 运动处理
/// </summary> /// </summary>
...@@ -143,7 +132,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -143,7 +132,7 @@ namespace OnlineStore.DeviceLibrary
isInPro = true; isInPro = true;
try try
{ {
switch (StoreMove.MoveType) switch (MoveInfo.MoveType)
{ {
case StoreMoveType.InStore: case StoreMoveType.InStore:
InStoreProcess(); InStoreProcess();
...@@ -172,7 +161,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -172,7 +161,7 @@ namespace OnlineStore.DeviceLibrary
} }
protected void SaveAlarmInfo(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType) protected void SaveAlarmInfo(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType)
{ {
alarmMsg = alarmMsg.Replace(StoreName, ""); alarmMsg = alarmMsg.Replace(Name, "");
int inoutStatus = 0; int inoutStatus = 0;
if (storeMoveType.Equals(StoreMoveType.InStore)) if (storeMoveType.Equals(StoreMoveType.InStore))
{ {
...@@ -208,7 +197,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -208,7 +197,7 @@ namespace OnlineStore.DeviceLibrary
break; break;
default: break; default: break;
} }
alarmInfo = new AlarmInfo(StoreID, aType, alarmDetial, alarmMsg, inoutStatus); alarmInfo = new AlarmInfo(DeviceID, aType, alarmDetial, alarmMsg, inoutStatus);
} }
/// <summary> /// <summary>
...@@ -232,7 +221,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -232,7 +221,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 停止所有运动 /// 停止所有运动
/// </summary> /// </summary>
public abstract void StopMove(bool IsCloseAxis); public abstract void StopMove( );
/// <summary> /// <summary>
/// 重置处理 /// 重置处理
...@@ -250,8 +239,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -250,8 +239,7 @@ namespace OnlineStore.DeviceLibrary
{ {
moveAxis.TargetPosition = 0; moveAxis.TargetPosition = 0;
LogUtil.info(LOGGER, moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回"); LogUtil.info(LOGGER, moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true)); MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
AddAxisMoveTime(moveAxis);
ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed); ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
} }
...@@ -260,9 +248,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -260,9 +248,8 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
protected void ACAxisMove(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed) protected void ACAxisMove(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed)
{ {
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, targetPosition, targetSpeed)); MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, targetPosition, targetSpeed));
moveAxis.TargetPosition = targetPosition; moveAxis.TargetPosition = targetPosition;
AddAxisMoveTime(moveAxis);
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed); ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
} }
...@@ -274,17 +261,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -274,17 +261,7 @@ namespace OnlineStore.DeviceLibrary
msg = ""; msg = "";
string deviceName = moveAxis.DeviceName; string deviceName = moveAxis.DeviceName;
short axisNo = moveAxis.GetAxisValue(); short axisNo = moveAxis.GetAxisValue();
//如果是进出轴,并且光栅被遮挡,直接返回false
//if (NeedCheckSafetyLight.Equals(2))
//{
// if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_10_DeviceToDoor) ||
// StoreMove.MoveStep.Equals(StoreMoveStep.SI_05_DeviceToDoor))
// {
// return false;
// }
//}
bool isOk = ACServerManager.GetBusyStatus(deviceName, axisNo).Equals(0); bool isOk = ACServerManager.GetBusyStatus(deviceName, axisNo).Equals(0);
int outCount = ACServerManager.GetActualtPosition(deviceName, axisNo); int outCount = ACServerManager.GetActualtPosition(deviceName, axisNo);
int errorCount = Math.Abs(outCount - targetPosition); int errorCount = Math.Abs(outCount - targetPosition);
...@@ -295,16 +272,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -295,16 +272,16 @@ namespace OnlineStore.DeviceLibrary
return true; return true;
} }
//判断是否需要重新运动 //判断是否需要重新运动
if (StoreMove.CanWhileCount > 0) if (MoveInfo.CanWhileCount > 0)
{ {
LogUtil.error(LOGGER, moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount + LogUtil.error(LOGGER, moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
"],误差过大,重新开始运动,剩余[" + StoreMove.CanWhileCount + "]次"); "],误差过大,重新开始运动,剩余[" + MoveInfo.CanWhileCount + "]次");
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed); ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
StoreMove.CanWhileCount--; MoveInfo.CanWhileCount--;
} }
else else
{ {
msg = StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount msg = Name + " storeMoveStep=" + MoveInfo.MoveStep + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount
+ "],误差过大,需要报警"; + "],误差过大,需要报警";
LogUtil.error(LOGGER, msg); LogUtil.error(LOGGER, msg);
} }
...@@ -324,16 +301,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -324,16 +301,16 @@ namespace OnlineStore.DeviceLibrary
return true; return true;
} }
//判断是否需要重新运动 //判断是否需要重新运动
if (StoreMove.CanWhileCount > 0) if (MoveInfo.CanWhileCount > 0)
{ {
LogUtil.error(LOGGER, moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + StoreMove.CanWhileCount + "]次"); LogUtil.error(LOGGER, moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + MoveInfo.CanWhileCount + "]次");
//LogUtil.error(LOGGER, StoreName + moveAxis.DisplayStr + "重新回原点"); //LogUtil.error(LOGGER, StoreName + moveAxis.DisplayStr + "重新回原点");
ACServerManager.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed); ACServerManager.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
StoreMove.CanWhileCount--; MoveInfo.CanWhileCount--;
} }
else else
{ {
msg = StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警"; msg = Name + " storeMoveStep=" + MoveInfo.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
LogUtil.error(LOGGER, msg); LogUtil.error(LOGGER, msg);
} }
} }
...@@ -352,7 +329,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -352,7 +329,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (!isInit) if (!isInit)
{ {
StoreMove = new StoreMoveInfo(StoreID); MoveInfo = new StoreMoveInfo(DeviceID);
mainTimer = new System.Timers.Timer(); mainTimer = new System.Timers.Timer();
mainTimer.Enabled = false; mainTimer.Enabled = false;
...@@ -378,7 +355,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -378,7 +355,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 移动信息 /// 移动信息
/// </summary> /// </summary>
public StoreMoveInfo StoreMove = null; public StoreMoveInfo MoveInfo = null;
/// <summary> /// <summary>
/// 定时处理,监听信号,监听IO /// 定时处理,监听信号,监听IO
...@@ -388,7 +365,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -388,7 +365,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 开始出库运动 /// 开始出库运动
/// </summary> /// </summary>
public abstract bool StartOutStoreMove(InOutStoreParam param); public abstract bool StartOutStoreMove(InOutParam param);
protected abstract void OutStoreProcess(); protected abstract void OutStoreProcess();
#endregion #endregion
...@@ -396,7 +373,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -396,7 +373,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 开始入库移动移动 /// 开始入库移动移动
/// </summary> /// </summary>
public abstract void StartInStoreMove(InOutStoreParam param); public abstract void StartInStoreMove(InOutParam param);
protected abstract void InStoreProcess(); protected abstract void InStoreProcess();
#endregion #endregion
...@@ -477,7 +454,29 @@ namespace OnlineStore.DeviceLibrary ...@@ -477,7 +454,29 @@ namespace OnlineStore.DeviceLibrary
return sta; return sta;
} }
} }
public void CylinderMove(StoreMoveInfo moveInfo, string IoLowType, string IoHighType)
{
IOMove(IoLowType, IO_VALUE.LOW);
IOMove(IoHighType, IO_VALUE.HIGH);
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IoLowType, IO_VALUE.LOW));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IoHighType, IO_VALUE.HIGH));
}
}
public void IOMove(string IoType, IO_VALUE value)
{
IOManager.IOMove(IoType, value, baseConfig.Id);
}
public IO_VALUE IOValue(string IoType)
{
return IOManager.IOValue(IoType, baseConfig.Id);
}
public void LogInfo(string logInfo)
{
LogUtil.info(Name + logInfo);
}
} }
} }
...@@ -22,7 +22,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -22,7 +22,7 @@ namespace OnlineStore.DeviceLibrary
{ {
moveType = StoreMoveType.None; moveType = StoreMoveType.None;
MoveParam = new InOutStoreParam(); MoveParam = new InOutParam();
this.storeId = storeId; this.storeId = storeId;
this.moveStep = StoreMoveStep.Wait; this.moveStep = StoreMoveStep.Wait;
IsInWait = false; IsInWait = false;
...@@ -50,7 +50,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -50,7 +50,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
///出入库参数 ///出入库参数
/// </summary> /// </summary>
public InOutStoreParam MoveParam { get; set; } public InOutParam MoveParam { get; set; }
/// <summary> /// <summary>
/// 当前运动是哪个料仓 /// 当前运动是哪个料仓
/// </summary> /// </summary>
...@@ -106,7 +106,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -106,7 +106,7 @@ namespace OnlineStore.DeviceLibrary
WaitList = new List<WaitResultInfo>(); WaitList = new List<WaitResultInfo>();
MoveNum++; MoveNum++;
} }
public void NewMove(StoreMoveType type, InOutStoreParam param) public void NewMove(StoreMoveType type, InOutParam param)
{ {
moveStep = StoreMoveStep.Wait; moveStep = StoreMoveStep.Wait;
this.moveType = type; this.moveType = type;
......
...@@ -50,9 +50,10 @@ ...@@ -50,9 +50,10 @@
<Compile Include="position\ACSAStorePosition.cs" /> <Compile Include="position\ACSAStorePosition.cs" />
<Compile Include="storeConfig\ConfigItemBase.cs" /> <Compile Include="storeConfig\ConfigItemBase.cs" />
<Compile Include="storeConfig\ConfigProAttribute.cs" /> <Compile Include="storeConfig\ConfigProAttribute.cs" />
<Compile Include="storeConfig\config\AC_SA_Config.cs" /> <Compile Include="storeConfig\config\Store_Config.cs" />
<Compile Include="storeConfig\config\AC_Box_Config.cs" />
<Compile Include="storeConfig\config\StoreType.cs" /> <Compile Include="storeConfig\config\StoreType.cs" />
<Compile Include="storeConfig\config\Store_IO_Type.cs" /> <Compile Include="storeConfig\config\IO_Type.cs" />
<Compile Include="CSVAttribute.cs" /> <Compile Include="CSVAttribute.cs" />
<Compile Include="storeConfig\CSVConfigReader.cs" /> <Compile Include="storeConfig\CSVConfigReader.cs" />
<Compile Include="position\CSVPositionReader.cs" /> <Compile Include="position\CSVPositionReader.cs" />
......
...@@ -67,7 +67,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -67,7 +67,7 @@ namespace OnlineStore.LoadCSVLibrary
[CSVAttribute("进出轴进料口取料点P2")] [CSVAttribute("进出轴进料口取料点P2")]
public int InOutAxis_DoorPosition_P2 { get; set; } public int InOutAxis_DoorPosition_P2 { get; set; }
public static bool CheckPosition(ACStorePosition position, AC_SA_Config Config) public static bool CheckPosition(ACStorePosition position, AC_BOX_Config Config)
{ {
try try
{ {
......
...@@ -133,12 +133,33 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -133,12 +133,33 @@ namespace OnlineStore.LoadCSVLibrary
} }
return configList; return configList;
} }
public static AC_BOX_Config LoadStoreConfig(int storeId, string cid, string storeType, string linefilePath)
{
StoreConfig config = null;
config = new Store_Config(storeId, cid, storeType, linefilePath);
return (AC_BOX_Config)LoadConfig(config);
}
public static Store_Config LoadLineConfig(int storeId, string cid, string storeType, string linefilePath)
{
StoreConfig config = null;
config = new Store_Config(storeId, cid, storeType, linefilePath);
return (Store_Config)LoadConfig(config);
}
public static StoreConfig LoadConfig(int storeId, string cid, string storeType, string filePath) public static StoreConfig LoadConfig(int storeId, string cid, string storeType, string filePath)
{ {
StoreConfig config = null; StoreConfig config = null;
if (storeType.Equals(StoreType.RC_AC_SA)) if (storeType.Equals(StoreType.RC_AC_SA))
{ {
config = new AC_SA_Config(storeId, cid, storeType, filePath); config = new AC_BOX_Config(storeId, cid, storeType, filePath);
} }
else else
{ {
......
...@@ -34,12 +34,12 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -34,12 +34,12 @@ namespace OnlineStore.LoadCSVLibrary
/// 输入IO配置 /// 输入IO配置
/// 手动料仓输入Io列表,key=对应的坐标位置的positionNum /// 手动料仓输入Io列表,key=对应的坐标位置的positionNum
/// </summary> /// </summary>
public Dictionary<String, ConfigIO> StoreDIList { get; set; } public Dictionary<String, ConfigIO> DIList { get; set; }
/// <summary> /// <summary>
/// 输出IO配置 /// 输出IO配置
/// 手动料仓输出Io列表,key=对应的坐标位置的positionNum /// 手动料仓输出Io列表,key=对应的坐标位置的positionNum
/// </summary> /// </summary>
public Dictionary<String, ConfigIO> StoreDOList { get; set; } public Dictionary<String, ConfigIO> DOList { get; set; }
/// <summary> /// <summary>
/// 料仓所有用到的IO卡名称 /// 料仓所有用到的IO卡名称
/// </summary> /// </summary>
...@@ -80,8 +80,8 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -80,8 +80,8 @@ namespace OnlineStore.LoadCSVLibrary
public virtual void LoadConfig(List<ConfigBase> configList) public virtual void LoadConfig(List<ConfigBase> configList)
{ {
StoreDIList = new Dictionary<string, ConfigIO>(); DIList = new Dictionary<string, ConfigIO>();
StoreDOList = new Dictionary<string, ConfigIO>(); DOList = new Dictionary<string, ConfigIO>();
DIODeviceNameList = new List<string>(); DIODeviceNameList = new List<string>();
SMCDeviceNameList = new List<string>(); SMCDeviceNameList = new List<string>();
//取得属性集合 //取得属性集合
...@@ -142,7 +142,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -142,7 +142,7 @@ namespace OnlineStore.LoadCSVLibrary
{ {
DIODeviceNameList.Add(io.DeviceName); DIODeviceNameList.Add(io.DeviceName);
} }
this.StoreDIList.Add(con.ProName, io); this.DIList.Add(con.ProName, io);
} }
else else
{ {
...@@ -158,7 +158,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -158,7 +158,7 @@ namespace OnlineStore.LoadCSVLibrary
{ {
DIODeviceNameList.Add(io.DeviceName); DIODeviceNameList.Add(io.DeviceName);
} }
this.StoreDOList.Add(con.ProName, io); this.DOList.Add(con.ProName, io);
} }
else else
{ {
...@@ -182,7 +182,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -182,7 +182,7 @@ namespace OnlineStore.LoadCSVLibrary
{ {
if (att.IsMust) if (att.IsMust)
{ {
throw new CVSFieldNotMatchingExection(this.ToString() + "的属性" + str + "必须配置值!"); throw new CVSFieldNotMatchingExection(this.ToString() + "缺少配置【" + str + "】");
} }
else else
{ {
...@@ -202,7 +202,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -202,7 +202,7 @@ namespace OnlineStore.LoadCSVLibrary
//DI检测 //DI检测
foreach (string di in MustHaveDIList) foreach (string di in MustHaveDIList)
{ {
if (!StoreDIList.ContainsKey(di)) if (!DIList.ContainsKey(di))
{ {
throw new CVSFieldNotMatchingExection(this.ToString() + "的DI属性" + di + "必须配置值!"); throw new CVSFieldNotMatchingExection(this.ToString() + "的DI属性" + di + "必须配置值!");
} }
...@@ -211,7 +211,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -211,7 +211,7 @@ namespace OnlineStore.LoadCSVLibrary
//DO检测 //DO检测
foreach (string io in MustHaveDOList) foreach (string io in MustHaveDOList)
{ {
if (!this.StoreDOList.ContainsKey(io)) if (!this.DOList.ContainsKey(io))
{ {
throw new CVSFieldNotMatchingExection(this.ToString() + "的DO属性" + io + "必须配置值!"); throw new CVSFieldNotMatchingExection(this.ToString() + "的DO属性" + io + "必须配置值!");
} }
...@@ -222,13 +222,13 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -222,13 +222,13 @@ namespace OnlineStore.LoadCSVLibrary
public ConfigIO getWaitIO(string ioType) public ConfigIO getWaitIO(string ioType)
{ {
if (StoreDIList.ContainsKey(ioType)) if (DIList.ContainsKey(ioType))
{ {
return StoreDIList[ioType]; return DIList[ioType];
} }
else if (StoreDOList.ContainsKey(ioType)) else if (DOList.ContainsKey(ioType))
{ {
return StoreDOList[ioType]; return DOList[ioType];
} }
return null; return null;
} }
......
...@@ -39,5 +39,9 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -39,5 +39,9 @@ namespace OnlineStore.LoadCSVLibrary
/// 松下伺服485通信单台料仓 /// 松下伺服485通信单台料仓
/// </summary> /// </summary>
public static string RC_AC_SA = "RC_AC_SA"; public static string RC_AC_SA = "RC_AC_SA";
/// <summary>
/// 松下伺服控制的包装料料仓
/// </summary>
public static string RC_AC_PA = "RC_AC_PA";
} }
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.LoadCSVLibrary
{
public class Store_Config : StoreConfig
{
public Store_Config()
: base()
{
}
public Store_Config(int id, string cid, string type, string filepath)
: base(id, cid, type, filepath)
{
}
/// <summary>
/// 预警温度
/// </summary>
[ConfigProAttribute("WarnTemperate")]
public int WarnTemperate { get; set; }
/// <summary>
/// 预警湿度
/// </summary>
[ConfigProAttribute("WarnHumidity")]
public int WarnHumidity { get; set; }
/// <summary>
/// 气压检测IO关闭需要持续的时间(=3表示需要关闭三秒以上才算关闭)
/// </summary>
[ConfigProAttribute("AirCheckSeconds")]
public int AirCheckSeconds { get; set; }
/// <summary>
/// PRO,BOX出入库次数多少次时,会自动重置旋转轴,Box_ResetMCount,10,,,,,
/// </summary>
[ConfigProAttribute("Box_ResetMCount")]
public int Box_ResetMCount { get; set; }
/// <summary>
/// PRO,BOX出入库次数多少次时,会自动重置操作(会重置所有轴),Box_ResetACount,100,,,,,
/// </summary>
[ConfigProAttribute("Box_ResetACount")]
public int Box_ResetACount { get; set; }
/// <summary>
/// PRO IO信号超时时间(毫秒) IOSingle_TimerOut 5000
/// </summary>
[ConfigProAttribute("IOSingle_TimerOut", false)]
public int IOSingle_TimerOut { get; set; }
/// <summary>
/// PRO 需要吹气的温度(温度标准) Max_Temperature 10
/// </summary>
[ConfigProAttribute("Max_Temperature", false)]
public int Max_Temperature { get; set; }
/// <summary>
/// PRO 需要吹气的湿度(湿度标准) Max_Humidity 10
/// </summary>
[ConfigProAttribute("Max_Humidity", false)]
public int Max_Humidity { get; set; }
/// <summary>
/// PRO 每次吹气的时间(分钟) BlowAir_Time 10
/// </summary>
[ConfigProAttribute("BlowAir_Time", false)]
public int BlowAir_Time { get; set; }
/// <summary>
/// PRO 两次吹气间隔(分钟) BlowAir_Interval 10
/// </summary>
[ConfigProAttribute("BlowAir_Interval", false)]
public int BlowAir_Interval { get; set; }
public int InoutAxis_PositionMax { get; set; }
/// <summary>
/// PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
/// </summary>
[ConfigProAttribute("Humiture_Port", true )]
public string Humiture_Port { get; set; }
/// <summary>
/// PRO IO模块对应的DI数量 IO_DILength 192.168.200.10#16;192.168.200.11#4
/// </summary>
[ConfigProAttribute("IO_DILength")]
public string IO_DILength { get; set; }
/// <summary>
/// PRO 模块对应的DO数量 IO_DOLength 192.168.200.10#16;192.168.200.11#4
/// </summary>
[ConfigProAttribute("IO_DOLength")]
public string IO_DOLength { get; set; }
/// <summary>
/// PRO 是否有仓门 HasDoor 1
/// </summary>
[ConfigProAttribute("HasDoor")]
public int HasDoor { get; set; }
protected override void initMustHavePro()
{
MustHaveDIList = new List<string>();
MustHaveDOList = new List<string>();
MustHaveDIList.Add(IO_Type.SuddenStop_BTN);
MustHaveDIList.Add(IO_Type.Reset_BTN);
MustHaveDIList.Add(IO_Type.DoorLimit);
MustHaveDIList.Add(IO_Type.Airpressure_Check);
MustHaveDIList.Add(IO_Type.TrayCheck_Door);
MustHaveDIList.Add(IO_Type.TrayCheck_Fixture);
MustHaveDIList.Add(IO_Type.Door_Up);
MustHaveDIList.Add(IO_Type.Door_Down);
MustHaveDOList.Add(IO_Type.AutoRun_HddLed);
MustHaveDOList.Add(IO_Type.Alarm_HddLed);
MustHaveDOList.Add(IO_Type.RunSign_HddLed);
MustHaveDOList.Add(IO_Type.StartOrStopBlow);
MustHaveDOList.Add(IO_Type.Run_Signal);
MustHaveDOList.Add(IO_Type.Door_Up);
MustHaveDOList.Add(IO_Type.Door_Down);
MustHaveDOList.Add(IO_Type.Axis_Brake);
}
public static void ConfigAxis(AC_BOX_Config Config)
{
Config.Middle_Axis.TargetSpeed = Config.MiddleAxis_TargetSpeed;
Config.Middle_Axis.AddSpeed = Config.MiddleAxis_AddSpeed;
Config.Middle_Axis.DelSpeed = Config.MiddleAxis_DelSpeed;
Config.Middle_Axis.HomeAddSpeed = Config.MiddleAxis_HomeAddSpeed;
Config.Middle_Axis.HomeHighSpeed = Config.MiddleAxis_HomeHighSpeed;
Config.Middle_Axis.HomeLowSpeed = Config.MiddleAxis_HomeLowSpeed;
Config.InOut_Axis.TargetSpeed = Config.InoutAxis_TargetSpeed;
Config.InOut_Axis.DelSpeed = Config.InoutAxis_AddSpeed;
Config.InOut_Axis.AddSpeed = Config.InoutAxis_DelSpeed;
Config.InOut_Axis.HomeAddSpeed = Config.InoutAxis_HomeAddSpeed;
Config.InOut_Axis.HomeHighSpeed = Config.InoutAxis_HomeHighSpeed;
Config.InOut_Axis.HomeLowSpeed = Config.InoutAxis_HomeLowSpeed;
Config.UpDown_Axis.TargetSpeed = Config.UpdownAxis_TargetSpeed;
Config.UpDown_Axis.AddSpeed = Config.UpdownAxis_AddSpeed;
Config.UpDown_Axis.DelSpeed = Config.UpdownAxis_DelSpeed;
Config.UpDown_Axis.HomeAddSpeed = Config.UpdownAxis_HomeAddSpeed;
Config.UpDown_Axis.HomeHighSpeed = Config.UpdownAxis_HomeHighSpeed;
Config.UpDown_Axis.HomeLowSpeed = Config.UpdownAxis_HomeLowSpeed;
Config.Comp_Axis.TargetSpeed = Config.CompAxis_TargetSpeed;
Config.Comp_Axis.AddSpeed = Config.CompAxis_AddSpeed;
Config.Comp_Axis.DelSpeed = Config.CompAxis_DelSpeed;
Config.Comp_Axis.HomeAddSpeed = Config.CompAxis_HomeAddSpeed;
Config.Comp_Axis.HomeHighSpeed = Config.CompAxis_HomeHighSpeed;
Config.Comp_Axis.HomeLowSpeed = Config.CompAxis_HomeLowSpeed;
Config.Middle_Axis.CanErrorCountMin = Config.MiddleAxis_ErrorCountMin;
Config.InOut_Axis.CanErrorCountMin = Config.InoutAxis_ErrorCountMin;
Config.UpDown_Axis.CanErrorCountMin = Config.UpdownAxis_ErrorCountMin;
Config.Middle_Axis.CanErrorCountMax = Config.MiddleAxis_ErrorCountMax;
Config.InOut_Axis.CanErrorCountMax = Config.InoutAxis_ErrorCountMax;
Config.UpDown_Axis.CanErrorCountMax = Config.UpdownAxis_ErrorCountMax;
Config.Middle_Axis.PositionMin = Config.MiddleAxis_PositionMin;
Config.Middle_Axis.PositionMax = Config.MiddleAxis_PositionMax;
Config.InOut_Axis.PositionMin = Config.InoutAxis_PositionMin;
Config.InOut_Axis.PositionMax = Config.InoutAxis_PositionMax;
Config.UpDown_Axis.PositionMin = Config.UpdownAxis_PositionMin;
Config.UpDown_Axis.PositionMax = Config.UpdownAxis_PositionMax;
//Config.InOut_Axis.ResolveSpeed = Config.InoutAxis_ResolveSpeed;
//Config.UpDown_Axis.ResolveSpeed = Config.UpdownAxis_ResolveSpeed;
//Config.Middle_Axis.ResolveSpeed = Config.MiddleAxis_ResolveSpeed;
Config.Middle_Axis.DefaultPosition = Config.MiddleAxis_P1_Position;
Config.InOut_Axis.DefaultPosition = Config.InOutAxis_P1_Position;
Config.UpDown_Axis.DefaultPosition = Config.UpDownAxis_DoorOPosition_P1;
Config.Comp_Axis.DefaultPosition = Config.CompressAxis_P1_Position;
Config.Comp_Axis.CanErrorCountMax = 1000;
Config.Comp_Axis.CanErrorCountMin = 10;
Config.Comp_Axis.PositionMin = 0;
Config.Comp_Axis.PositionMax = 0;
}
private Dictionary<string, ushort> DILengthMap = null;
private Dictionary<string, ushort> DOLengthMap = null;
public ushort GetDILength(string ip)
{
try
{
if (DILengthMap == null)
{
DILengthMap = new Dictionary<string, ushort>();
string[] arrayList = IO_DILength.Split(';');
foreach (string str in arrayList)
{
string[] arrStr = str.Split('#');
if (arrStr.Length == 2)
{
string ioip = arrStr[0];
ushort length = Convert.ToUInt16(arrStr[1]);
DILengthMap.Add(ioip, length);
}
}
}
}
catch (Exception ex)
{
}
if (DILengthMap.ContainsKey(ip))
{
return DILengthMap[ip];
}
return 16;
}
public ushort GetDOLength(string ip)
{
try
{
if (DOLengthMap == null)
{
DOLengthMap = new Dictionary<string, ushort>();
string[] arrayList = IO_DOLength.Split(';');
foreach (string str in arrayList)
{
string[] arrStr = str.Split('#');
if (arrStr.Length == 2)
{
string ioip = arrStr[0];
ushort length = Convert.ToUInt16(arrStr[1]);
DOLengthMap.Add(ioip, length);
}
}
}
}
catch (Exception ex)
{
}
if (DOLengthMap.ContainsKey(ip))
{
return DOLengthMap[ip];
}
return 16;
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!