Commit b2a13516 LN

增加rfip

1 个父辈 d90bce48
......@@ -37,7 +37,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
......@@ -132,6 +132,12 @@
<Compile Include="FrmLineStore.Designer.cs">
<DependentUpon>FrmLineStore.cs</DependentUpon>
</Compile>
<Compile Include="FrmRFIPEdit.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmRFIPEdit.Designer.cs">
<DependentUpon>FrmRFIPEdit.cs</DependentUpon>
</Compile>
<Compile Include="FrmPwd.cs">
<SubType>Form</SubType>
</Compile>
......@@ -168,6 +174,9 @@
<EmbeddedResource Include="FrmLineStore.resx">
<DependentUpon>FrmLineStore.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmRFIPEdit.resx">
<DependentUpon>FrmRFIPEdit.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmPwd.resx">
<DependentUpon>FrmPwd.cs</DependentUpon>
</EmbeddedResource>
......
......@@ -77,7 +77,7 @@ namespace OnlineStore.AssemblyLine
if (chbAutoRead.Checked && this.Visible)
{
ReadIOList();
lblTrayNum.Text = "托盘编码:" + TrayManager.GetNum(equipBean.DeviceID);
lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID);
}
string canOut = LineManager.Line.CanOutStore(equipBean.DeviceID) ? "可出库":"不可出库" ;
......
......@@ -104,7 +104,7 @@ namespace OnlineStore.AssemblyLine
if (chbAutoRead.Checked && this.Visible)
{
ReadIOList();
lblTrayNum.Text = "托盘编码:" + TrayManager.GetNum(equipBean.DeviceID);
lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID);
}
string canOut = LineManager.Line.CanOutStore(equipBean.DeviceID) ? "可出库":"不可出库" ;
......
......@@ -90,7 +90,7 @@ namespace OnlineStore.AssemblyLine
if (chbAutoRead.Checked && this.Visible)
{
ReadIOList();
lblTrayNum.Text = "托盘编码:" + TrayManager.GetNum(0);
lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(0);
}
}
......
......@@ -74,6 +74,8 @@
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.listView1 = new System.Windows.Forms.ListView();
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.托盘初始化ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
......@@ -356,61 +358,61 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(141, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
//
// 启动AToolStripMenuItem
//
this.启动AToolStripMenuItem.Name = "启动AToolStripMenuItem";
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.启动AToolStripMenuItem.Text = "启动 ";
this.启动AToolStripMenuItem.Click += new System.EventHandler(this.启动所有料仓AToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(141, 6);
this.toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
//
// 复位RToolStripMenuItem
//
this.复位RToolStripMenuItem.Name = "复位RToolStripMenuItem";
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.复位RToolStripMenuItem.Text = "复位";
this.复位RToolStripMenuItem.Click += new System.EventHandler(this.复位RToolStripMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(141, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6);
//
// 停止TToolStripMenuItem
//
this.停止TToolStripMenuItem.Name = "停止TToolStripMenuItem";
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.停止TToolStripMenuItem.Text = "停止";
this.停止TToolStripMenuItem.Click += new System.EventHandler(this.停止所有料仓TToolStripMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(141, 6);
this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6);
//
// 入库模式ToolStripMenuItem
//
this.入库模式ToolStripMenuItem.Name = "入库模式ToolStripMenuItem";
this.入库模式ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.入库模式ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.入库模式ToolStripMenuItem.Text = "入库模式";
this.入库模式ToolStripMenuItem.Visible = false;
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(141, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator2.Visible = false;
//
// 退出ToolStripMenuItem
//
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.退出ToolStripMenuItem.Text = "退出";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click_1);
//
......@@ -419,7 +421,9 @@
this.设置TToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.扫码测试ToolStripMenuItem,
this.toolStripSeparator6,
this.二维码学习ToolStripMenuItem});
this.二维码学习ToolStripMenuItem,
this.toolStripSeparator7,
this.托盘初始化ToolStripMenuItem});
this.设置TToolStripMenuItem.Name = "设置TToolStripMenuItem";
this.设置TToolStripMenuItem.Size = new System.Drawing.Size(91, 25);
this.设置TToolStripMenuItem.Text = "设备调试 ";
......@@ -427,19 +431,19 @@
// 扫码测试ToolStripMenuItem
//
this.扫码测试ToolStripMenuItem.Name = "扫码测试ToolStripMenuItem";
this.扫码测试ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.扫码测试ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.扫码测试ToolStripMenuItem.Text = "扫码测试";
this.扫码测试ToolStripMenuItem.Click += new System.EventHandler(this.扫码测试ToolStripMenuItem_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(157, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6);
//
// 二维码学习ToolStripMenuItem
//
this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem";
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.二维码学习ToolStripMenuItem.Text = "二维码学习";
this.二维码学习ToolStripMenuItem.Click += new System.EventHandler(this.二维码学习ToolStripMenuItem_Click);
//
......@@ -511,6 +515,18 @@
this.listView1.View = System.Windows.Forms.View.Details;
this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6);
//
// 托盘初始化ToolStripMenuItem
//
this.托盘初始化ToolStripMenuItem.Name = "托盘初始化ToolStripMenuItem";
this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.托盘初始化ToolStripMenuItem.Text = "托盘编码";
this.托盘初始化ToolStripMenuItem.Click += new System.EventHandler(this.托盘初始化ToolStripMenuItem_Click);
//
// FrmLineStore
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......@@ -593,6 +609,8 @@
private System.Windows.Forms.Label lblPosId;
private System.Windows.Forms.Button btnUpdateStatus;
private System.Windows.Forms.CheckBox chbLineDebug;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
private System.Windows.Forms.ToolStripMenuItem 托盘初始化ToolStripMenuItem;
}
}
......@@ -700,5 +700,11 @@ namespace OnlineStore.AssemblyLine
TrayManager.LineRunTest = chbLineDebug.Checked;
}
}
private void 托盘初始化ToolStripMenuItem_Click(object sender, EventArgs e)
{
FrmRFIPEdit FRM = new FrmRFIPEdit();
FRM.ShowDialog();
}
}
}
......@@ -112,21 +112,21 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, internalKeyToken=b77a5c561934e089</value>
<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, internalKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, internalKeyToken=b03f5f7f11d50a3a">
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="notifyIcon1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, internalKeyToken=b03f5f7f11d50a3a">
<metadata name="notifyIcon1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>137, 17</value>
</metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, internalKeyToken=b03f5f7f11d50a3a">
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>255, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, internalKeyToken=b03f5f7f11d50a3a" />
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="notifyIcon1.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAA8AMDAQAAEABABoBgAA9gAAACgoEAABAAQAyAQAAF4HAAAgIBAAAQAEAOgCAAAmDAAAGBgQAAEA
......@@ -814,7 +814,7 @@
rEGAAKxBgACsQYAArEHAAaxB/D+sQQ==
</value>
</data>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, internalKeyToken=b03f5f7f11d50a3a">
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>420, 17</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
......
......@@ -79,7 +79,7 @@ namespace OnlineStore.AssemblyLine
if (chbAutoRead.Checked && this.Visible)
{
ReadIOList();
lblTrayNum.Text = "托盘编码:" + TrayManager.GetNum(equipBean.DeviceID);
lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID);
}
string canOut = LineManager.Line.CanOutStore(equipBean.DeviceID) ? "可出库":"不可出库" ;
......
......@@ -78,7 +78,7 @@ namespace OnlineStore.AssemblyLine
if (chbAutoRead.Checked && this.Visible)
{
ReadIOList();
lblTrayNum.Text = "托盘编码:" + TrayManager.GetNum(equipBean.DeviceID);
lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID);
}
string canOut = LineManager.Line.CanOutStore(equipBean.DeviceID) ? "可出库":"不可出库" ;
......

using OnlineStore.Common;
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.AssemblyLine
{
internal partial class FrmRFIPEdit : FrmBase
{
internal FrmRFIPEdit( )
{
InitializeComponent();
}
private Dictionary<string, string> rfMap = new Dictionary<string, string>();
private void FrmPwd_Load(object sender, EventArgs e)
{
comboxType.Items.Clear();
foreach (EquipBase b in LineManager.Line.AllEquipMap.Values)
{
string key = b.Name + "-托盘RF";
string value = TrayManager.GetRFIP(b.DeviceID);
rfMap.Add(key, value);
comboxType.Items.Add(key);
}
comboxType.SelectedIndex = 0;
comType.SelectedIndex = 0;
}
private void btnNext_Click(object sender, EventArgs e)
{
string ip = txtIP.Text;
int type = comType.SelectedIndex+1;
int value = (int)numNum.Value;
DialogResult result = MessageBox.Show( "确定将【"+comboxType.Text+"】当前的托盘编号定为【"+value+"】?", "确定提示", MessageBoxButtons.OKCancel);
if (result.Equals(DialogResult.OK))
{
RFIPManager.WriteData(ip, new RFIPData(value, type));
}
}
private void btnBack_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
string ip = txtIP.Text;
RFIPData data= RFIPManager.ReadData(ip);
string resul = "";
if (data != null)
{
resul = data.ToStr();
}
MessageBox.Show("读取到数据:" + resul);
}
private void comboxType_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboxType.SelectedIndex >= 0)
{
string V = rfMap[comboxType.Text];
if (!txtIP.Text.Equals(V))
{
txtIP.Text = V;
}
}
}
private void btnFind_Click(object sender, EventArgs e)
{
string ip = txtIP.Text;
bool result = RFIPManager.FindRFID(ip);
if (result)
{
lblHas.Text = "有标签";
lblHas.ForeColor = Color.Green;
}
else
{
lblHas.Text = "无标签";
lblHas.ForeColor = Color.Red;
}
}
}
}
......@@ -17,38 +17,6 @@ PRO,0,模拟信号2的地址,AIDI2_Addr,1,,,,,
PRO,0,模拟信号3的地址,AIDI3_Addr,2,,,,,
PRO,0,模拟信号4的地址,AIDI4_Addr,3,,,,,
,,,,,,,,,
PRO,0,流水线总电器箱,PRO_AOI_IP_1,192.168.100.11,,,,,
PRO,0,出料皮带线1,PRO_AOI_IP_2,192.168.100.12,,,,,
PRO,0,出料皮带线2,PRO_AOI_IP_3,192.168.100.13,,,,,
,,,,,,,,,
PRO,0,上料流水线SL1,PRO_AOI_IP_11,192.168.100.21,,,,,
PRO,0,上料流水线SL1,PRO_AOI_IP_12,192.168.100.22,,,,,
PRO,0,上料流水线SL2,PRO_AOI_IP_13,192.168.100.23,,,,,
PRO,0,上料流水线SL2,PRO_AOI_IP_14,192.168.100.24,,,,,
PRO,0,上料流水线SL3,PRO_AOI_IP_15,192.168.100.25,,,,,
PRO,0,上料流水线SL3,PRO_AOI_IP_16,192.168.100.26,,,,,
PRO,0,下料流水线SL4,PRO_AOI_IP_17,192.168.100.27,,,,,
PRO,0,下料流水线SL4,PRO_AOI_IP_18,192.168.100.28,,,,,
,,,,,,,,,
PRO,0,移载装置(上下为伺服)01、02,PRO_AOI_IP_19,192.168.100.29,,,,,
PRO,0,移载装置(上下为伺服)01、02(8进8出),PRO_AOI_IP_20,192.168.100.30,,,,,
PRO,0,移载装置(上下为伺服)03、04,PRO_AOI_IP_21,192.168.100.31,,,,,
PRO,0,移载装置(上下为伺服)03、04(8进8出),PRO_AOI_IP_22,192.168.100.32,,,,,
PRO,0,移载装置(上下为伺服)05、06,PRO_AOI_IP_23,192.168.100.33,,,,,
PRO,0,移载装置(上下为伺服)05、06(8进8出),PRO_AOI_IP_24,192.168.100.34,,,,,
PRO,0,移载装置(上下为伺服)07、08,PRO_AOI_IP_25,192.168.100.35,,,,,
PRO,0,移载装置(上下为伺服)07、08(8进8出),PRO_AOI_IP_26,192.168.100.36,,,,,
PRO,0,移载装置(上下为伺服)09、10,PRO_AOI_IP_27,192.168.100.37,,,,,
PRO,0,移载装置(上下为伺服)09、10(8进8出),PRO_AOI_IP_28,192.168.100.38,,,,,
PRO,0,移载装置(上下为气缸)11、12,PRO_AOI_IP_29,192.168.100.39,,,,,
PRO,0,移载装置(上下为气缸)11、12,PRO_AOI_IP_30,192.168.100.40,,,,,
PRO,0,移载装置(上下为气缸)13、14,PRO_AOI_IP_31,192.168.100.41,,,,,
PRO,0,移载装置(上下为气缸)13、14,PRO_AOI_IP_32,192.168.100.42,,,,,
PRO,0,移载装置(上下为气缸)15、16,PRO_AOI_IP_33,192.168.100.43,,,,,
PRO,0,移载装置(上下为气缸)15、16,PRO_AOI_IP_34,192.168.100.44,,,,,
PRO,0,移载装置(上下为气缸)17、18,PRO_AOI_IP_35,192.168.100.45,,,,,
PRO,0,移载装置(上下为气缸)17、18,PRO_AOI_IP_36,192.168.100.46,,,,,
,,,,,,,,,
,,,,,,,,,
DI,0,急停,SuddenStop_BTN,0,PRO_AOI_IP_1,0,急停,X001,X001
DI,0,复位,Reset_BTN,1,PRO_AOI_IP_1,0,复位,X002,X002
......@@ -83,4 +51,68 @@ DO,0,环形线横移4定位下降SOL,SW4_LocationCylinder_Down,12,PRO_AOI_IP_1,0,环形线横
,0,,,13,PRO_AOI_IP_1,0,,Y014,Y014
,0,,,14,PRO_AOI_IP_1,0,,Y015,Y015
,0,,,15,PRO_AOI_IP_1,0,,Y016,Y016
,,,,,,
\ No newline at end of file
,,,,,,,,,
,,,,,,,,,
PRO,0,流水线总电器箱,PRO_AOI_IP_1,192.168.100.11,,,,,
PRO,0,出料皮带线1,PRO_AOI_IP_2,192.168.100.12,,,,,
PRO,0,出料皮带线2,PRO_AOI_IP_3,192.168.100.13,,,,,
,,,,,,,,,
PRO,0,上料流水线SL1,PRO_AOI_IP_11,192.168.100.21,,,,,
PRO,0,上料流水线SL1,PRO_AOI_IP_12,192.168.100.22,,,,,
PRO,0,上料流水线SL2,PRO_AOI_IP_13,192.168.100.23,,,,,
PRO,0,上料流水线SL2,PRO_AOI_IP_14,192.168.100.24,,,,,
PRO,0,上料流水线SL3,PRO_AOI_IP_15,192.168.100.25,,,,,
PRO,0,上料流水线SL3,PRO_AOI_IP_16,192.168.100.26,,,,,
PRO,0,下料流水线SL4,PRO_AOI_IP_17,192.168.100.27,,,,,
PRO,0,下料流水线SL4,PRO_AOI_IP_18,192.168.100.28,,,,,
,,,,,,,,,
PRO,0,移载装置(上下为伺服)01、02,PRO_AOI_IP_19,192.168.100.29,,,,,
PRO,0,移载装置(上下为伺服)01、02(8进8出),PRO_AOI_IP_20,192.168.100.30,,,,,
PRO,0,移载装置(上下为伺服)03、04,PRO_AOI_IP_21,192.168.100.31,,,,,
PRO,0,移载装置(上下为伺服)03、04(8进8出),PRO_AOI_IP_22,192.168.100.32,,,,,
PRO,0,移载装置(上下为伺服)05、06,PRO_AOI_IP_23,192.168.100.33,,,,,
PRO,0,移载装置(上下为伺服)05、06(8进8出),PRO_AOI_IP_24,192.168.100.34,,,,,
PRO,0,移载装置(上下为伺服)07、08,PRO_AOI_IP_25,192.168.100.35,,,,,
PRO,0,移载装置(上下为伺服)07、08(8进8出),PRO_AOI_IP_26,192.168.100.36,,,,,
PRO,0,移载装置(上下为伺服)09、10,PRO_AOI_IP_27,192.168.100.37,,,,,
PRO,0,移载装置(上下为伺服)09、10(8进8出),PRO_AOI_IP_28,192.168.100.38,,,,,
PRO,0,移载装置(上下为气缸)11、12,PRO_AOI_IP_29,192.168.100.39,,,,,
PRO,0,移载装置(上下为气缸)11、12,PRO_AOI_IP_30,192.168.100.40,,,,,
PRO,0,移载装置(上下为气缸)13、14,PRO_AOI_IP_31,192.168.100.41,,,,,
PRO,0,移载装置(上下为气缸)13、14,PRO_AOI_IP_32,192.168.100.42,,,,,
PRO,0,移载装置(上下为气缸)15、16,PRO_AOI_IP_33,192.168.100.43,,,,,
PRO,0,移载装置(上下为气缸)15、16,PRO_AOI_IP_34,192.168.100.44,,,,,
PRO,0,移载装置(上下为气缸)17、18,PRO_AOI_IP_35,192.168.100.45,,,,,
PRO,0,移载装置(上下为气缸)17、18,PRO_AOI_IP_36,192.168.100.46,,,,,
,,,,,,,,,
,,,,,,,,,
PRO,0,移栽装置1-托盘-RFID-IP,PRO_RFIP_001,192.168.1.190,,,,,
PRO,0,移栽装置2-托盘-RFID-IP,PRO_RFIP_002,192.168.100.112,,,,,
PRO,0,移栽装置3-托盘-RFID-IP,PRO_RFIP_003,192.168.100.113,,,,,
PRO,0,移栽装置4-托盘-RFID-IP,PRO_RFIP_004,192.168.100.114,,,,,
PRO,0,移栽装置5-托盘-RFID-IP,PRO_RFIP_005,192.168.100.115,,,,,
PRO,0,移栽装置6-托盘-RFID-IP,PRO_RFIP_006,192.168.100.116,,,,,
PRO,0,移栽装置7-托盘-RFID-IP,PRO_RFIP_007,192.168.100.117,,,,,
PRO,0,移栽装置8-托盘-RFID-IP,PRO_RFIP_008,192.168.100.118,,,,,
PRO,0,移栽装置9-托盘-RFID-IP,PRO_RFIP_009,192.168.100.119,,,,,
PRO,0,移栽装置10-托盘-RFID-IP,PRO_RFIP_010,192.168.100.120,,,,,
PRO,0,移栽装置11-托盘-RFID-IP,PRO_RFIP_011,192.168.100.121,,,,,
PRO,0,移栽装置12-托盘-RFID-IP,PRO_RFIP_012,192.168.100.122,,,,,
PRO,0,移栽装置13-托盘-RFID-IP,PRO_RFIP_013,192.168.100.123,,,,,
PRO,0,移栽装置14-托盘-RFID-IP,PRO_RFIP_014,192.168.100.124,,,,,
PRO,0,移栽装置15-托盘-RFID-IP,PRO_RFIP_015,192.168.100.125,,,,,
PRO,0,移栽装置16-托盘-RFID-IP,PRO_RFIP_016,192.168.100.126,,,,,
PRO,0,移栽装置17-托盘-RFID-IP,PRO_RFIP_017,192.168.100.127,,,,,
PRO,0,移栽装置18-托盘-RFID-IP,PRO_RFIP_018,192.168.100.128,,,,,
PRO,0,出料移栽1-托盘-RFID-IP,PRO_RFIP_201,192.168.100.129,,,,,
PRO,0,出料移栽2-托盘-RFID-IP,PRO_RFIP_202,192.168.100.130,,,,,
PRO,0,出料移栽3-托盘-RFID-IP,PRO_RFIP_203,192.168.100.131,,,,,
PRO,0,出料移栽4-托盘-RFID-IP,PRO_RFIP_204,192.168.100.132,,,,,
PRO,0,入料流水线1-上料模块-RFID-IP,PRO_RFIP_101-1,192.168.100.133,,,,,
PRO,0,入料流水线2-上料模块-RFID-IP,PRO_RFIP_102-1,192.168.100.134,,,,,
PRO,0,入料流水线3-上料模块-RFID-IP,PRO_RFIP_103-1,192.168.100.135,,,,,
PRO,0,入料流水线4-上料模块-RFID-IP,PRO_RFIP_104-1,192.168.100.136,,,,,
PRO,0,入料流水线1-托盘-RFID-IP,PRO_RFIP_101-2,192.168.100.137,,,,,
PRO,0,入料流水线2-托盘-RFID-IP,PRO_RFIP_102-2,192.168.100.138,,,,,
PRO,0,入料流水线3-托盘-RFID-IP,PRO_RFIP_103-2,192.168.100.139,,,,,
PRO,0,入料流水线4-托盘-RFID-IP,PRO_RFIP_104-2,192.168.100.140,,,,,
......@@ -3,5 +3,4 @@ PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
PRO,0,对应的横移模块,SidesWayNum,0,,,,,
PRO,0,设备对应的出料流水线的编号,DLineEquipNum,1,,,,,
PRO,0,设备对应的出料流水线的第几条流水线,DLineLineNum,1,,,,,
PRO,0,对应的RFID设备IP,RTF_IP,192.168.100.111,,,,,
\ No newline at end of file
......@@ -54,7 +54,8 @@ namespace OnlineStore.DeviceLibrary
DeviceConfig.SubDIList = new Dictionary<int, Dictionary<string, ConfigIO>>();
DeviceConfig.SubDOList = new Dictionary<int, Dictionary<string, ConfigIO>>();
DeviceConfig.ProIpMap = new Dictionary<string, string>();
DeviceConfig.ProIOIpMap = new Dictionary<string, string>();
DeviceConfig.ProRFIpMap = new Dictionary<string, string>();
moveECMap = new Dictionary<int, MoveEquip_Config>();
feedingECMap = new Dictionary<int, FeedingEquip_Config>();
providingECMap = new Dictionary<int, ProvidingEquip_Config>();
......
......@@ -239,7 +239,7 @@ namespace OnlineStore.DeviceLibrary
/// <returns></returns>
internal bool NeedCurrTray()
{
int num = TrayManager.GetNum(Config.Id);
int num = TrayManager.GetTrayNum(Config.Id);
bool isFull = TrayManager.IsFixTureFull(num);
if (Config.IsCanOut.Equals(1))
{
......
......@@ -13,7 +13,7 @@ namespace OnlineStore.DeviceLibrary
#region 托盘检测
private void StartCheckFixture()
{
int num = TrayManager.GetNum(DeviceID);
int num = TrayManager.GetTrayNum(DeviceID);
if (IOValue(IO_Type.StopCylinder_Check2).Equals(IO_VALUE.HIGH))
{
//托盘在两个阻挡内
......@@ -90,7 +90,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要顶升
// bool isNeed = false;
//此处先对托盘号进行验证
currMoveTrayNum = TrayManager.GetNum(DeviceID);
currMoveTrayNum = TrayManager.GetTrayNum(DeviceID);
bool isFull = TrayManager.IsFixTureFull(currMoveTrayNum);
if (TrayManager.RightTrayCode(currMoveTrayNum, preTrayNum, false))
{
......
......@@ -117,6 +117,9 @@ namespace OnlineStore.DeviceLibrary
Task.Factory.StartNew(delegate
{
//连接rfip
RFIPManager.ConnectRFIOList(new List<string>(DeviceConfig.ProRFIpMap.Values));
Thread.Sleep(5);
IOManager.instance.ConnectionIOList(ioList);
Thread.Sleep(10);
AIManager.ConnectionIP(Config.AIDevice_IP);
......@@ -885,7 +888,7 @@ namespace OnlineStore.DeviceLibrary
//取盘号
string wareNum = serverResult.barcode ;
int trayCode = TrayManager.GetNum(0);
int trayCode = TrayManager.GetTrayNum(0);
LogUtil.info( "更新盘空满信息,托盘号【" + trayCode + "】,是否有料盘【" + true + "】,出库入库【" + 1 + "】");
TrayManager.UpdateFixtureValue(trayCode, true, ReelType.InStore,wareNum,posId,plateH,plateW);
......
......@@ -414,7 +414,7 @@ namespace OnlineStore.DeviceLibrary
#region 托盘检测
private void StartCheckFixture()
{
int num = TrayManager.GetNum(DeviceID);
int num = TrayManager.GetTrayNum(DeviceID);
if (IOValue(IO_Type.StopCylinder_Check2).Equals(IO_VALUE.HIGH))
{
//托盘在两个阻挡内
......@@ -490,7 +490,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要顶升
bool isNeed = false;
//此处先对托盘号进行验证
currMoveTrayNum = TrayManager.GetNum(DeviceID);
currMoveTrayNum = TrayManager.GetTrayNum(DeviceID);
bool isFull = TrayManager.IsFixTureFull(currMoveTrayNum);
if (TrayManager.RightTrayCode(currMoveTrayNum, preTrayNum, false))
{
......
......@@ -31,7 +31,7 @@ namespace OnlineStore.DeviceLibrary
private void StartCheckFixture()
{
int num = TrayManager.GetNum(DeviceID);
int num = TrayManager.GetTrayNum(DeviceID);
if (IOValue(IO_Type.StopCylinder_Check2).Equals(IO_VALUE.HIGH))
{
//托盘在两个阻挡内
......@@ -109,7 +109,7 @@ namespace OnlineStore.DeviceLibrary
try
{
//此处先对托盘号进行验证
currMoveTrayNum = TrayManager.GetNum(DeviceID);
currMoveTrayNum = TrayManager.GetTrayNum(DeviceID);
bool isFull = TrayManager.IsFixTureFull(currMoveTrayNum);
if (TrayManager.RightTrayCode(currMoveTrayNum, preTrayNum, false))
{
......
......@@ -170,19 +170,31 @@ namespace OnlineStore.DeviceLibrary
TrayErrorMsg = errorMsg;
ErrorStoreId = errorStoreID;
}
public static int GetNum(int subType )
public static int GetTrayNum(int subType, int rtType = 0)
{
//int check1 = (int)IOManager.IOValue(IO_Type.Fixture_Check_1,subType);
//int check2 = (int)IOManager.IOValue(IO_Type.Fixture_Check_2,subType);
//int check3 = (int)IOManager.IOValue(IO_Type.Fixture_Check_3,subType);
//string value = "" + check3 + check2 + check1 + "";
//int panHao = Convert.ToInt16(value, 2);
//return panHao;
return subType;
string ip = GetRFIP(subType, rtType);
//获取盘号
RFIPData data = RFIPManager.ReadData(ip);
if (data != null)
{
return data.Num;
}
return 0;
}
public static string GetRFIP(int subType, int rtType = 0)
{
string ip = "";
string rtName = DeviceConfig.RFIP_Str +"_"+ subType.ToString().PadLeft(3, '0');
if (rtType > 0)
{
rtName += "-" + rtType.ToString();
}
if (DeviceConfig.ProRFIpMap.ContainsKey(rtName))
{
ip = DeviceConfig.ProRFIpMap[rtName];
}
return ip;
}
#region 横移状态缓存
......
using System;
using Asa.RFID;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public class RFIDManager
public class RFIPManager
{
public static Dictionary<string, Reader> RFReaderMap = new Dictionary<string, Reader>();
private static List<string> RfIPList = new List<string>();
private static System.Timers.Timer conTimer = null;
internal static void ConnectRFIOList(List<string> rfioNameList)
{
if (conTimer == null)
{
conTimer = new System.Timers.Timer();
conTimer.AutoReset = true;
conTimer.Interval = 60000;
conTimer.Elapsed += ConTimer_Elapsed;
}
conTimer.Enabled = false;
RfIPList = new List<string>(rfioNameList);
foreach (string ip in rfioNameList)
{
ConnectionIP(ip);
}
if (RfIPList.Count > 0)
{
conTimer.Start();
}
}
private static bool isProcess = false;
private static DateTime lastTime = DateTime.Now;
private static void ConTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
TimeSpan span = DateTime.Now - lastTime;
if (span.TotalMinutes < RfIPList.Count && isProcess)
{
return;
}
isProcess = true;
lastTime = DateTime.Now;
try
{
List<string> list = new List<string>(RfIPList);
if (list.Count > 0)
{
LogUtil.info("开始重连RFIP模块 ------------");
foreach (string ip in list)
{
ConnectionIP(ip);
}
LogUtil.info("结束重连RFIP模块 ------------");
}
GC.Collect();
}
catch (Exception ex)
{
LogUtil.error("RFIP ConTimer_Elapsed 出错: " + ex.ToString());
}
isProcess = false;
}
internal static void ConnectionIP(string rfip)
{
Reader rfipReader = null;
if (RFReaderMap.ContainsKey(rfip))
{
rfipReader = RFReaderMap[rfip];
if (null != rfipReader)
{
rfipReader.Close();
rfipReader = null;
}
RFReaderMap.Remove(rfip);
}
string logName = "RFIP模块[" + rfip + "] ";
try
{
rfipReader = new Reader();
rfipReader.LocalIP = "192.168.100.101";
rfipReader.RemoteIP = rfip;
RFReaderMap.Add(rfip, rfipReader);
LogUtil.debug("开始连接" + logName + ",尝试重连3次");
for (int i = 1; i <= 3; i++)
{
bool result = rfipReader.Connect();
if (result)
{
LogUtil.info("第【" + i + "】次连接 " + logName + " 成功:");
Thread.Sleep(10);
if (RfIPList.Contains(rfip))
{
RfIPList.Remove(rfip);
}
break;
}
else
{
LogUtil.error("第【" + i + "】次连接 " + logName + " 失败:" + "");
}
Thread.Sleep(5);
GC.Collect();
}
}
catch (Exception error)
{
LogUtil.error("连接RFIP模块 " + logName + " 出错:" + error.ToString());
}
}
internal static void CloseAllConnection()
{
foreach (Reader reader in RFReaderMap.Values)
{
reader.Close();
}
}
public static bool WriteData(string rfIp, RFIPData obj)
{
byte[] sendData = obj.ToData();
return WriteData(rfIp, sendData, 3);
}
public static RFIPData ReadData(string rfIp)
{
byte[] reviceData = ReadData(rfIp, 3);
if (reviceData != null)
{
return new RFIPData(reviceData);
}
return null;
}
public static bool FindRFID(string rfIp)
{
try
{
Reader rfReader = getRfReader(rfIp);
if (rfReader != null)
{
return rfReader.FindRFID();
}
}
catch (Exception ex)
{
LogUtil.error("RFIP FindRFID [" + rfIp + "] 出错 :" + ex.ToString());
}
return false;
}
public static byte[] ReadData(string rfIp, int reReadCount = 1,int startIndex=0,int readLength=10)
{
try
{
Reader rfReader = getRfReader(rfIp);
if (rfReader == null)
{
return null;
}
for (int i = 1; i <= reReadCount; i++)
{
byte[] reviceData = rfReader.Read(startIndex, readLength);
if (reviceData != null)
{
return reviceData;
}
LogUtil.error("RFIP ReadData [" + rfIp + "] 第" + i + "次失败 ");
}
}
catch (Exception ex)
{
LogUtil.error("RFIP ReadData [" + rfIp + "] 出错 :" + ex.ToString());
}
return null;
}
public static bool WriteData(string rfIp, byte[] data, int reWriteCount = 1)
{
try
{
Reader rfReader = getRfReader(rfIp);
if (rfReader == null)
{
return false;
}
for (int i = 1; i <= reWriteCount; i++)
{
bool result = rfReader.Write(data);
if (result)
{
return result;
}
LogUtil.error("RFIP WriteData [" + rfIp + "] 第" + i + "次失败:");
}
}
catch (Exception ex)
{
LogUtil.error("RFIP WriteData [" + rfIp + "] 出错 :" + ex.ToString());
}
return false;
}
private static Reader getRfReader(string rfIp)
{
Reader rfReader = null;
if (RFReaderMap.ContainsKey(rfIp))
{
rfReader = RFReaderMap[rfIp];
}
else
{
LogUtil.error("getRfReader 没有连接RFIP模块:" + rfIp);
}
return rfReader;
}
}
public class RFIPData
{
/// <summary>
/// RFID类型,区分是料架还是托盘,托盘=L
/// </summary>
public int RFType= 1;
/// <summary>
/// 托盘编号,从1-32
/// </summary>
public int Num = 0;
public RFIPData (int num,int t=1)
{
this.RFType = t;
this.Num = num;
}
public RFIPData(byte[] data)
{
try
{
RFType = (int)data[0];
Num = Convert.ToInt32(data[1]);
}
catch (Exception ex)
{
LogUtil.error("RFIP 数据【" + data + "】 获取编码失败");
}
}
public byte[] ToData(int dataLength=10)
{
byte[] sendData = new byte[dataLength];
for (int i = 0; i < sendData.Length; i++)
{
sendData[i] = 0x00;
}
sendData[0] = (byte)RFType;
sendData[1] = (byte)Num;
return sendData;
}
public string ToStr()
{
return "["+RFType+"],Num=["+Num+"]";
}
}
}
......@@ -234,9 +234,9 @@ namespace OnlineStore.LoadCSVLibrary
{
get
{
if (DeviceConfig.ProIpMap != null && DeviceConfig.ProIpMap.ContainsKey(DeviceName))
if (DeviceConfig.ProIOIpMap != null && DeviceConfig.ProIOIpMap.ContainsKey(DeviceName))
{
return DeviceConfig.ProIpMap[DeviceName];
return DeviceConfig.ProIOIpMap[DeviceName];
}
return DeviceName;
}
......
......@@ -12,7 +12,10 @@ namespace OnlineStore.LoadCSVLibrary
public static Dictionary<int, Dictionary<string, ConfigIO>> SubDIList { get; set; }
public static Dictionary<int, Dictionary<string, ConfigIO>> SubDOList { get; set; }
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static Dictionary<string, string> ProIpMap = null;
public static Dictionary<string, string> ProIOIpMap = null;
public static Dictionary<string, string> ProRFIpMap = null;
public const string IOIP_Str = "PRO_AOI_IP";
public const string RFIP_Str = "PRO_RFIP";
/// <summary>
/// ID
/// </summary>
......@@ -120,9 +123,12 @@ namespace OnlineStore.LoadCSVLibrary
LOGGER.Error("配置文件:" + this.ConfigFilePath + ",属性名=" + con.ProName + "的属性未找到匹配字段!");
}
}
else if (!ProIpMap.ContainsKey(con.ProName) && con.ProName.ToUpper().Contains("IP"))
else if (!ProIOIpMap.ContainsKey(con.ProName) && con.ProName.ToUpper().Contains(IOIP_Str))
{
ProIpMap.Add(con.ProName, con.ProVale);
ProIOIpMap.Add(con.ProName, con.ProVale);
}else if(!ProRFIpMap.ContainsKey(con.ProName) && con.ProName.ToUpper().Contains(RFIP_Str))
{
ProRFIpMap.Add(con.ProName, con.ProVale);
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!