Commit 9baff2b0 LN

更新aio.dll

1 个父辈 a0bdb503
......@@ -9,7 +9,7 @@
AIOBOX操作类
</summary>
</member>
<member name="F:Asa.IOModule.AIOBOX.suspend">
<member name="F:Asa.IOModule.AIOBOX._unrevdRemote">
<summary>
暂停次数
WriteDO 命令非常多时,暂停一次发送 ReadDI 或 ReadDO
......@@ -22,17 +22,12 @@
小于30时,会出现接收数据连包的情况
</summary>
</member>
<member name="F:Asa.IOModule.AIOBOX.NET_SLEEP">
<member name="F:Asa.IOModule.AIOBOX.LISTEN_SLEEP">
<summary>
监听网络接收数据的间隔
必须小于SEND_SLEEP
</summary>
</member>
<member name="F:Asa.IOModule.AIOBOX.TRIG_SLEEP">
<summary>
触发DIO状态事件的间隔
</summary>
</member>
<member name="T:Asa.IOModule.AIOBOX.DI_Changed">
<summary>
自动读取DI委托
......@@ -157,6 +152,13 @@
<param name="localIP">本地IP地址</param>
<returns></returns>
</member>
<member name="M:Asa.IOModule.AIOBOX.CheckIP(System.String)">
<summary>
检查IP地址
</summary>
<param name="ip"></param>
<returns></returns>
</member>
<member name="M:Asa.IOModule.AIOBOX.Connect">
<summary>
连接
......@@ -170,17 +172,23 @@
</member>
<member name="M:Asa.IOModule.AIOBOX.AutoReadInput(System.Boolean,System.Int32)">
<summary>
自动读取输入端,触发事件
自动读取输入端并触发事件(主动上传数据 = 禁止)
</summary>
<param name="read">是否自动读取</param>
<param name="sleep">间隔,必须大于等于15ms</param>
</member>
<member name="M:Asa.IOModule.AIOBOX.AutoReadInput(System.Boolean)">
<summary>
自动读取输入端并触发事件(主动上传数据 = 使能)
</summary>
<param name="read">是否自动读取</param>
<param name="sleep">间隔,必须大于15ms</param>
</member>
<member name="M:Asa.IOModule.AIOBOX.AutoReadOutput(System.Boolean,System.Int32)">
<summary>
自动读取输出端,触发事件
</summary>
<param name="read">是否自动读取</param>
<param name="sleep">间隔,必须大于10ms</param>
<param name="sleep">间隔,必须大于等于15ms</param>
</member>
<member name="M:Asa.IOModule.AIOBOX.ReverseStatus(Asa.IOModule.Box_Sta)">
<summary>
......@@ -365,248 +373,5 @@
闭合,打开,高电平
</summary>
</member>
<member name="T:Asa.IOModule.Reg">
<summary>
IO模块寄存器
</summary>
</member>
<member name="F:Asa.IOModule.Reg.ID">
<summary>
标识
</summary>
</member>
<member name="F:Asa.IOModule.Reg.Text">
<summary>
文本,仅用于显示
</summary>
</member>
<member name="F:Asa.IOModule.Reg.Address">
<summary>
寄存器地址
</summary>
</member>
<member name="F:Asa.IOModule.Reg.Status">
<summary>
当前的状态
</summary>
</member>
<member name="M:Asa.IOModule.Reg.#ctor(Asa.IOModule.Box_Addr)">
<summary>
寄存器,文本空,状态OFF
</summary>
<param name="address">地址</param>
</member>
<member name="M:Asa.IOModule.Reg.#ctor(System.String,Asa.IOModule.Box_Addr)">
<summary>
寄存器,状态OFF
</summary>
<param name="text">文本</param>
<param name="addr">地址</param>
</member>
<member name="M:Asa.IOModule.Reg.#ctor(System.Int32,System.String,Asa.IOModule.Box_Addr)">
<summary>
寄存器,状态OFF
</summary>
<param name="id">标志</param>
<param name="text">文本</param>
<param name="addr">地址</param>
</member>
<member name="M:Asa.IOModule.Reg.#ctor(System.String,Asa.IOModule.Box_Addr,Asa.IOModule.Box_Sta)">
<summary>
寄存器
</summary>
<param name="text">文本</param>
<param name="addr">地址</param>
<param name="status">状态</param>
</member>
<member name="M:Asa.IOModule.Reg.#ctor(System.Int32,System.String,Asa.IOModule.Box_Addr,Asa.IOModule.Box_Sta)">
<summary>
寄存器
</summary>
<param name="id">标志</param>
<param name="text">文本</param>
<param name="address">地址</param>
<param name="status">状态</param>
</member>
<member name="T:Asa.IOModule.Box_Addr">
<summary>
IO模块寄存器地址
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_1">
<summary>
输入点,DI01
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_2">
<summary>
输入点,DI02
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_3">
<summary>
输入点,DI03
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_4">
<summary>
输入点,DI04
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_5">
<summary>
输入点,DI05
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_6">
<summary>
输入点,DI06
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_7">
<summary>
输入点,DI07
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_8">
<summary>
输入点,DI08
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_9">
<summary>
输入点,DI09
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_10">
<summary>
输入点,DI10
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_11">
<summary>
输入点,DI11
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_12">
<summary>
输入点,DI12
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_13">
<summary>
输入点,DI13
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_14">
<summary>
输入点,DI14
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_15">
<summary>
输入点,DI15
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DI_16">
<summary>
输入点,DI16
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_1">
<summary>
输出点,DO01
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_2">
<summary>
输出点,DO02
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_3">
<summary>
输出点,DO03
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_4">
<summary>
输出点,DO04
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_5">
<summary>
输出点,DO05
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_6">
<summary>
输出点,DO06
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_7">
<summary>
输出点,DO07
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_8">
<summary>
输出点,DO08
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_9">
<summary>
输出点,DO09
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_10">
<summary>
输出点,DO10
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_11">
<summary>
输出点,DO11
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_12">
<summary>
输出点,DO12
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_13">
<summary>
输出点,DO13
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_14">
<summary>
输出点,DO14
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_15">
<summary>
输出点,DO15
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.DO_16">
<summary>
输出点,DO16
</summary>
</member>
<member name="F:Asa.IOModule.Box_Addr.NONE">
<summary>
</summary>
</member>
<member name="T:Asa.IOModule.DI_Addr">
<summary>
输入端地址
</summary>
</member>
<member name="T:Asa.IOModule.DO_Addr">
<summary>
输入端地址
</summary>
</member>
</members>
</doc>
......@@ -104,6 +104,12 @@
<DependentUpon>FrmBox.cs</DependentUpon>
</Compile>
<Compile Include="ManagerUtil.cs" />
<Compile Include="positionTool\FrmPositionTool.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="positionTool\FrmPositionTool.Designer.cs">
<DependentUpon>FrmPositionTool.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="useControl\AxisMoveControl.cs">
......@@ -133,6 +139,9 @@
<EmbeddedResource Include="FrmBox.resx">
<DependentUpon>FrmBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="positionTool\FrmPositionTool.resx">
<DependentUpon>FrmPositionTool.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
......
......@@ -43,6 +43,8 @@
<!--是否调试状态-->
<add key ="IsInDebug" value ="1"/>
<add key ="UseBuzzer" value ="1"/>
<!--IO模块是否主动上传-->
<add key ="AIOAutoUpload" value ="1"/>
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
......@@ -165,6 +165,7 @@
this.btnAxisP = new System.Windows.Forms.Button();
this.btnIO = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.btnUpdown = new System.Windows.Forms.Button();
this.btnScanTest = new System.Windows.Forms.Button();
this.cmbShelfPosition = new System.Windows.Forms.ComboBox();
this.groupShelf = new System.Windows.Forms.GroupBox();
......@@ -178,6 +179,14 @@
this.txtUpdownP102 = new System.Windows.Forms.TextBox();
this.btnUpdownP101 = new System.Windows.Forms.Button();
this.btnUpdownP102 = new System.Windows.Forms.Button();
this.label17 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.btnReadLimit2 = new System.Windows.Forms.Button();
this.txtLimit2 = new System.Windows.Forms.TextBox();
this.label19 = new System.Windows.Forms.Label();
this.label20 = new System.Windows.Forms.Label();
this.btnReadLimit1 = new System.Windows.Forms.Button();
this.txtLimit1 = new System.Windows.Forms.TextBox();
this.groupAxis.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupInout.SuspendLayout();
......@@ -212,6 +221,14 @@
//
this.groupAxis.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupAxis.Controls.Add(this.label17);
this.groupAxis.Controls.Add(this.label18);
this.groupAxis.Controls.Add(this.btnReadLimit2);
this.groupAxis.Controls.Add(this.txtLimit2);
this.groupAxis.Controls.Add(this.label19);
this.groupAxis.Controls.Add(this.label20);
this.groupAxis.Controls.Add(this.btnReadLimit1);
this.groupAxis.Controls.Add(this.txtLimit1);
this.groupAxis.Controls.Add(this.label6);
this.groupAxis.Controls.Add(this.label5);
this.groupAxis.Controls.Add(this.btnReadHomeSingle);
......@@ -257,7 +274,7 @@
this.groupAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupAxis.Location = new System.Drawing.Point(6, 6);
this.groupAxis.Name = "groupAxis";
this.groupAxis.Size = new System.Drawing.Size(558, 351);
this.groupAxis.Size = new System.Drawing.Size(558, 421);
this.groupAxis.TabIndex = 216;
this.groupAxis.TabStop = false;
this.groupAxis.Text = "伺服运动";
......@@ -265,7 +282,7 @@
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(49, 303);
this.label6.Location = new System.Drawing.Point(49, 306);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(68, 17);
this.label6.TabIndex = 300;
......@@ -274,7 +291,7 @@
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(155, 303);
this.label5.Location = new System.Drawing.Point(155, 306);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(94, 17);
this.label5.TabIndex = 299;
......@@ -282,7 +299,7 @@
//
// btnReadHomeSingle
//
this.btnReadHomeSingle.Location = new System.Drawing.Point(278, 298);
this.btnReadHomeSingle.Location = new System.Drawing.Point(278, 295);
this.btnReadHomeSingle.Name = "btnReadHomeSingle";
this.btnReadHomeSingle.Size = new System.Drawing.Size(105, 33);
this.btnReadHomeSingle.TabIndex = 298;
......@@ -293,7 +310,7 @@
// txtHomeSingle
//
this.txtHomeSingle.Enabled = false;
this.txtHomeSingle.Location = new System.Drawing.Point(121, 300);
this.txtHomeSingle.Location = new System.Drawing.Point(121, 303);
this.txtHomeSingle.Name = "txtHomeSingle";
this.txtHomeSingle.Size = new System.Drawing.Size(25, 23);
this.txtHomeSingle.TabIndex = 297;
......@@ -301,7 +318,7 @@
// chbAutoRead
//
this.chbAutoRead.AutoSize = true;
this.chbAutoRead.Location = new System.Drawing.Point(395, 205);
this.chbAutoRead.Location = new System.Drawing.Point(400, 371);
this.chbAutoRead.Name = "chbAutoRead";
this.chbAutoRead.Size = new System.Drawing.Size(99, 21);
this.chbAutoRead.TabIndex = 296;
......@@ -311,7 +328,7 @@
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(152, 270);
this.label16.Location = new System.Drawing.Point(155, 272);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(112, 17);
this.label16.TabIndex = 295;
......@@ -320,7 +337,7 @@
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(152, 239);
this.label15.Location = new System.Drawing.Point(155, 238);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(124, 17);
this.label15.TabIndex = 294;
......@@ -329,7 +346,7 @@
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(152, 204);
this.label14.Location = new System.Drawing.Point(155, 204);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(100, 17);
this.label14.TabIndex = 293;
......@@ -338,7 +355,7 @@
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(3, 270);
this.label11.Location = new System.Drawing.Point(3, 272);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(114, 17);
this.label11.TabIndex = 292;
......@@ -347,14 +364,14 @@
// txtHomeStatus
//
this.txtHomeStatus.Enabled = false;
this.txtHomeStatus.Location = new System.Drawing.Point(121, 267);
this.txtHomeStatus.Location = new System.Drawing.Point(121, 269);
this.txtHomeStatus.Name = "txtHomeStatus";
this.txtHomeStatus.Size = new System.Drawing.Size(25, 23);
this.txtHomeStatus.TabIndex = 291;
//
// button2
//
this.button2.Location = new System.Drawing.Point(278, 263);
this.button2.Location = new System.Drawing.Point(278, 261);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(105, 33);
this.button2.TabIndex = 290;
......@@ -365,7 +382,7 @@
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(42, 237);
this.label10.Location = new System.Drawing.Point(42, 238);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(75, 17);
this.label10.TabIndex = 289;
......@@ -374,14 +391,14 @@
// txtBusyStatus
//
this.txtBusyStatus.Enabled = false;
this.txtBusyStatus.Location = new System.Drawing.Point(121, 234);
this.txtBusyStatus.Location = new System.Drawing.Point(121, 235);
this.txtBusyStatus.Name = "txtBusyStatus";
this.txtBusyStatus.Size = new System.Drawing.Size(25, 23);
this.txtBusyStatus.TabIndex = 288;
//
// btnMP101
//
this.btnMP101.Location = new System.Drawing.Point(278, 228);
this.btnMP101.Location = new System.Drawing.Point(278, 227);
this.btnMP101.Name = "btnMP101";
this.btnMP101.Size = new System.Drawing.Size(105, 33);
this.btnMP101.TabIndex = 287;
......@@ -597,7 +614,7 @@
//
// btnComAlarmClear
//
this.btnComAlarmClear.Location = new System.Drawing.Point(400, 295);
this.btnComAlarmClear.Location = new System.Drawing.Point(400, 196);
this.btnComAlarmClear.Name = "btnComAlarmClear";
this.btnComAlarmClear.Size = new System.Drawing.Size(105, 33);
this.btnComAlarmClear.TabIndex = 50;
......@@ -745,7 +762,7 @@
this.groupBox1.Controls.Add(this.label43);
this.groupBox1.Controls.Add(this.label42);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(6, 368);
this.groupBox1.Location = new System.Drawing.Point(6, 434);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(558, 182);
this.groupBox1.TabIndex = 217;
......@@ -1551,6 +1568,7 @@
this.groupBox3.Controls.Add(this.lblMoveEquipInfo);
this.groupBox3.Controls.Add(this.lblWarnMsg);
this.groupBox3.Controls.Add(this.lblThisSta);
this.groupBox3.Controls.Add(this.chbDebug);
this.groupBox3.Location = new System.Drawing.Point(7, 73);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(762, 124);
......@@ -1574,7 +1592,7 @@
this.chbDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chbDebug.AutoSize = true;
this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDebug.Location = new System.Drawing.Point(1243, 10);
this.chbDebug.Location = new System.Drawing.Point(646, 24);
this.chbDebug.Name = "chbDebug";
this.chbDebug.Size = new System.Drawing.Size(93, 25);
this.chbDebug.TabIndex = 271;
......@@ -1877,9 +1895,9 @@
// btnStoreHome
//
this.btnStoreHome.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStoreHome.Location = new System.Drawing.Point(410, 3);
this.btnStoreHome.Location = new System.Drawing.Point(402, 4);
this.btnStoreHome.Name = "btnStoreHome";
this.btnStoreHome.Size = new System.Drawing.Size(132, 39);
this.btnStoreHome.Size = new System.Drawing.Size(128, 39);
this.btnStoreHome.TabIndex = 3;
this.btnStoreHome.Text = "回待机位";
this.btnStoreHome.UseVisualStyleBackColor = true;
......@@ -1888,9 +1906,9 @@
// btnSotreReset
//
this.btnSotreReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSotreReset.Location = new System.Drawing.Point(276, 3);
this.btnSotreReset.Location = new System.Drawing.Point(269, 4);
this.btnSotreReset.Name = "btnSotreReset";
this.btnSotreReset.Size = new System.Drawing.Size(132, 39);
this.btnSotreReset.Size = new System.Drawing.Size(128, 39);
this.btnSotreReset.TabIndex = 2;
this.btnSotreReset.Text = "复位";
this.btnSotreReset.UseVisualStyleBackColor = true;
......@@ -1899,9 +1917,9 @@
// btnStoreStop
//
this.btnStoreStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStoreStop.Location = new System.Drawing.Point(142, 3);
this.btnStoreStop.Location = new System.Drawing.Point(136, 4);
this.btnStoreStop.Name = "btnStoreStop";
this.btnStoreStop.Size = new System.Drawing.Size(132, 39);
this.btnStoreStop.Size = new System.Drawing.Size(128, 39);
this.btnStoreStop.TabIndex = 1;
this.btnStoreStop.Text = "停止";
this.btnStoreStop.UseVisualStyleBackColor = true;
......@@ -1910,9 +1928,9 @@
// btnStoreStart
//
this.btnStoreStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStoreStart.Location = new System.Drawing.Point(8, 3);
this.btnStoreStart.Location = new System.Drawing.Point(3, 4);
this.btnStoreStart.Name = "btnStoreStart";
this.btnStoreStart.Size = new System.Drawing.Size(132, 39);
this.btnStoreStart.Size = new System.Drawing.Size(128, 39);
this.btnStoreStart.TabIndex = 0;
this.btnStoreStart.Text = "启动";
this.btnStoreStart.UseVisualStyleBackColor = true;
......@@ -1921,9 +1939,9 @@
// btnAxisOff
//
this.btnAxisOff.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisOff.Location = new System.Drawing.Point(946, 3);
this.btnAxisOff.Location = new System.Drawing.Point(934, 4);
this.btnAxisOff.Name = "btnAxisOff";
this.btnAxisOff.Size = new System.Drawing.Size(132, 39);
this.btnAxisOff.Size = new System.Drawing.Size(128, 39);
this.btnAxisOff.TabIndex = 11;
this.btnAxisOff.Text = "料仓运转OFF";
this.btnAxisOff.UseVisualStyleBackColor = true;
......@@ -1932,9 +1950,9 @@
// btnAxisOn
//
this.btnAxisOn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisOn.Location = new System.Drawing.Point(812, 3);
this.btnAxisOn.Location = new System.Drawing.Point(801, 4);
this.btnAxisOn.Name = "btnAxisOn";
this.btnAxisOn.Size = new System.Drawing.Size(132, 39);
this.btnAxisOn.Size = new System.Drawing.Size(128, 39);
this.btnAxisOn.TabIndex = 10;
this.btnAxisOn.Text = "料仓运转ON";
this.btnAxisOn.UseVisualStyleBackColor = true;
......@@ -1943,9 +1961,9 @@
// btnAxisP
//
this.btnAxisP.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisP.Location = new System.Drawing.Point(678, 3);
this.btnAxisP.Location = new System.Drawing.Point(668, 4);
this.btnAxisP.Name = "btnAxisP";
this.btnAxisP.Size = new System.Drawing.Size(132, 39);
this.btnAxisP.Size = new System.Drawing.Size(128, 39);
this.btnAxisP.TabIndex = 8;
this.btnAxisP.Text = "轴卡点动";
this.btnAxisP.UseVisualStyleBackColor = true;
......@@ -1954,9 +1972,9 @@
// btnIO
//
this.btnIO.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnIO.Location = new System.Drawing.Point(544, 3);
this.btnIO.Location = new System.Drawing.Point(535, 4);
this.btnIO.Name = "btnIO";
this.btnIO.Size = new System.Drawing.Size(132, 39);
this.btnIO.Size = new System.Drawing.Size(128, 39);
this.btnIO.TabIndex = 5;
this.btnIO.Text = "查看IO";
this.btnIO.UseVisualStyleBackColor = true;
......@@ -1966,10 +1984,10 @@
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.Controls.Add(this.btnUpdown);
this.panel1.Controls.Add(this.btnScanTest);
this.panel1.Controls.Add(this.btnStoreHome);
this.panel1.Controls.Add(this.btnAxisOff);
this.panel1.Controls.Add(this.chbDebug);
this.panel1.Controls.Add(this.btnAxisOn);
this.panel1.Controls.Add(this.btnAxisP);
this.panel1.Controls.Add(this.btnIO);
......@@ -1981,12 +1999,23 @@
this.panel1.Size = new System.Drawing.Size(1347, 55);
this.panel1.TabIndex = 273;
//
// btnUpdown
//
this.btnUpdown.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdown.Location = new System.Drawing.Point(1200, 4);
this.btnUpdown.Name = "btnUpdown";
this.btnUpdown.Size = new System.Drawing.Size(128, 39);
this.btnUpdown.TabIndex = 273;
this.btnUpdown.Text = "升降轴位置调试";
this.btnUpdown.UseVisualStyleBackColor = true;
this.btnUpdown.Click += new System.EventHandler(this.btnUpdown_Click);
//
// btnScanTest
//
this.btnScanTest.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnScanTest.Location = new System.Drawing.Point(1084, 3);
this.btnScanTest.Location = new System.Drawing.Point(1067, 4);
this.btnScanTest.Name = "btnScanTest";
this.btnScanTest.Size = new System.Drawing.Size(132, 39);
this.btnScanTest.Size = new System.Drawing.Size(128, 39);
this.btnScanTest.TabIndex = 272;
this.btnScanTest.Text = "扫码测试";
this.btnScanTest.UseVisualStyleBackColor = true;
......@@ -2074,7 +2103,7 @@
this.btnInoutP101.Location = new System.Drawing.Point(18, 289);
this.btnInoutP101.Name = "btnInoutP101";
this.btnInoutP101.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnInoutP101.Size = new System.Drawing.Size(114, 33);
this.btnInoutP101.Size = new System.Drawing.Size(118, 33);
this.btnInoutP101.TabIndex = 279;
this.btnInoutP101.Text = "进出轴位置P101:";
this.btnInoutP101.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
......@@ -2106,7 +2135,7 @@
this.button5.Location = new System.Drawing.Point(18, 239);
this.button5.Name = "button5";
this.button5.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.button5.Size = new System.Drawing.Size(114, 33);
this.button5.Size = new System.Drawing.Size(118, 33);
this.button5.TabIndex = 277;
this.button5.Text = "旋转轴位置P101:";
this.button5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
......@@ -2168,12 +2197,86 @@
this.btnUpdownP102.Location = new System.Drawing.Point(18, 189);
this.btnUpdownP102.Name = "btnUpdownP102";
this.btnUpdownP102.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnUpdownP102.Size = new System.Drawing.Size(114, 33);
this.btnUpdownP102.Size = new System.Drawing.Size(118, 33);
this.btnUpdownP102.TabIndex = 275;
this.btnUpdownP102.Text = "升降轴高点P102:";
this.btnUpdownP102.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnUpdownP102.UseVisualStyleBackColor = true;
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(46, 374);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(71, 17);
this.label17.TabIndex = 316;
this.label17.Text = "负极限信号:";
this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label18
//
this.label18.AutoSize = true;
this.label18.Location = new System.Drawing.Point(155, 374);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(94, 17);
this.label18.TabIndex = 315;
this.label18.Text = "1=ON,0=OFF";
//
// btnReadLimit2
//
this.btnReadLimit2.Location = new System.Drawing.Point(278, 363);
this.btnReadLimit2.Name = "btnReadLimit2";
this.btnReadLimit2.Size = new System.Drawing.Size(105, 33);
this.btnReadLimit2.TabIndex = 314;
this.btnReadLimit2.Text = "读负极限信号";
this.btnReadLimit2.UseVisualStyleBackColor = true;
this.btnReadLimit2.Click += new System.EventHandler(this.btnReadLimit2_Click);
//
// txtLimit2
//
this.txtLimit2.Enabled = false;
this.txtLimit2.Location = new System.Drawing.Point(122, 371);
this.txtLimit2.Name = "txtLimit2";
this.txtLimit2.Size = new System.Drawing.Size(25, 23);
this.txtLimit2.TabIndex = 313;
//
// label19
//
this.label19.AutoSize = true;
this.label19.Location = new System.Drawing.Point(46, 340);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(71, 17);
this.label19.TabIndex = 312;
this.label19.Text = "正极限信号:";
this.label19.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label20
//
this.label20.AutoSize = true;
this.label20.Location = new System.Drawing.Point(155, 340);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(94, 17);
this.label20.TabIndex = 311;
this.label20.Text = "1=ON,0=OFF";
//
// btnReadLimit1
//
this.btnReadLimit1.Location = new System.Drawing.Point(278, 329);
this.btnReadLimit1.Name = "btnReadLimit1";
this.btnReadLimit1.Size = new System.Drawing.Size(105, 33);
this.btnReadLimit1.TabIndex = 310;
this.btnReadLimit1.Text = "读正极限信号";
this.btnReadLimit1.UseVisualStyleBackColor = true;
this.btnReadLimit1.Click += new System.EventHandler(this.btnReadLimit1_Click);
//
// txtLimit1
//
this.txtLimit1.Enabled = false;
this.txtLimit1.Location = new System.Drawing.Point(122, 337);
this.txtLimit1.Name = "txtLimit1";
this.txtLimit1.Size = new System.Drawing.Size(25, 23);
this.txtLimit1.TabIndex = 309;
//
// FrmBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......@@ -2207,7 +2310,6 @@
this.groupBox7.ResumeLayout(false);
this.groupBox7.PerformLayout();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.groupShelf.ResumeLayout(false);
this.groupShelf.PerformLayout();
this.ResumeLayout(false);
......@@ -2370,6 +2472,15 @@
public System.Windows.Forms.Button btnUpdownP102;
public System.Windows.Forms.Label label13;
private System.Windows.Forms.Button btnSaveShelf;
private System.Windows.Forms.Button btnUpdown;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.Button btnReadLimit2;
private System.Windows.Forms.TextBox txtLimit2;
private System.Windows.Forms.Label label19;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.Button btnReadLimit1;
private System.Windows.Forms.TextBox txtLimit1;
}
}
......@@ -1136,5 +1136,35 @@ namespace OnlineStore.ACPackingStore
MessageBox.Show("库位【" + selectPositionNum + "】保存失败!");
}
}
private void btnUpdown_Click(object sender, EventArgs e)
{
string PortName = BoxBean.Config.UpDown_Axis.DeviceName;
int slvAddr = BoxBean.Config.UpDown_Axis.GetAxisValue();
string ioIP = "192.168.200.13";
int ioIndex = 0;
// if (store.Config.StoreDIList.ContainsKey(IO_Type.UpdownPositionSingal))
if (BoxBean.Config.DIList.ContainsKey(IO_Type.TrayCheck_Fixture))
{
ioIP = BoxBean.Config.DIList[IO_Type.TrayCheck_Fixture].DeviceName;
ioIndex = BoxBean.Config.DIList[IO_Type.TrayCheck_Fixture].GetIOAddr();
}
FrmPositionTool frm = new FrmPositionTool(PortName, slvAddr, ioIP, ioIndex,Text);
frm.ShowDialog();
}
private void btnReadLimit1_Click(object sender, EventArgs e)
{
int value = ACServerManager.GetLimitPositiveSingle(GetPortName(), GetSlaveAddr());
this.txtLimit1.Text = value.ToString();
}
private void btnReadLimit2_Click(object sender, EventArgs e)
{
int value = ACServerManager.GetLimitNegativeSingle(GetPortName(), GetSlaveAddr());
this.txtLimit2.Text = value.ToString();
}
}
}
......@@ -18,6 +18,8 @@
this.components = new System.ComponentModel.Container();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnBlow = new System.Windows.Forms.Button();
this.btnStoreOn = new System.Windows.Forms.Button();
this.btnStopMove = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.btnCamerLed = new System.Windows.Forms.Button();
......@@ -47,8 +49,6 @@
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.btnStoreOn = new System.Windows.Forms.Button();
this.btnBlow = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout();
......@@ -96,6 +96,30 @@
this.groupBox1.TabStop = false;
this.groupBox1.Text = "DO写入";
//
// btnBlow
//
this.btnBlow.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBlow.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBlow.Location = new System.Drawing.Point(175, 469);
this.btnBlow.Name = "btnBlow";
this.btnBlow.Size = new System.Drawing.Size(125, 34);
this.btnBlow.TabIndex = 294;
this.btnBlow.Text = "开始吹气";
this.btnBlow.UseVisualStyleBackColor = false;
this.btnBlow.Click += new System.EventHandler(this.btnBlow_Click);
//
// btnStoreOn
//
this.btnStoreOn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStoreOn.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStoreOn.Location = new System.Drawing.Point(175, 375);
this.btnStoreOn.Name = "btnStoreOn";
this.btnStoreOn.Size = new System.Drawing.Size(125, 34);
this.btnStoreOn.TabIndex = 293;
this.btnStoreOn.Text = "料仓运转ON";
this.btnStoreOn.UseVisualStyleBackColor = false;
this.btnStoreOn.Click += new System.EventHandler(this.btnStoreOn_Click);
//
// btnStopMove
//
this.btnStopMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
......@@ -290,7 +314,7 @@
this.txtWriteTime.Location = new System.Drawing.Point(236, 77);
this.txtWriteTime.MaxLength = 10;
this.txtWriteTime.Name = "txtWriteTime";
this.txtWriteTime.Size = new System.Drawing.Size(74, 23);
this.txtWriteTime.Size = new System.Drawing.Size(72, 23);
this.txtWriteTime.TabIndex = 238;
this.txtWriteTime.Text = "0";
//
......@@ -448,30 +472,6 @@
this.tableLayoutPanel1.Size = new System.Drawing.Size(218, 570);
this.tableLayoutPanel1.TabIndex = 102;
//
// btnStoreOn
//
this.btnStoreOn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStoreOn.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStoreOn.Location = new System.Drawing.Point(175, 375);
this.btnStoreOn.Name = "btnStoreOn";
this.btnStoreOn.Size = new System.Drawing.Size(125, 34);
this.btnStoreOn.TabIndex = 293;
this.btnStoreOn.Text = "料仓运转ON";
this.btnStoreOn.UseVisualStyleBackColor = false;
this.btnStoreOn.Click += new System.EventHandler(this.btnStoreOn_Click);
//
// btnBlow
//
this.btnBlow.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBlow.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBlow.Location = new System.Drawing.Point(175, 469);
this.btnBlow.Name = "btnBlow";
this.btnBlow.Size = new System.Drawing.Size(125, 34);
this.btnBlow.TabIndex = 294;
this.btnBlow.Text = "开始吹气";
this.btnBlow.UseVisualStyleBackColor = false;
this.btnBlow.Click += new System.EventHandler(this.btnBlow_Click);
//
// FrmIOStatus
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
......
namespace OnlineStore.ACPackingStore
{
partial class FrmPositionTool
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txtP4Offset = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.txtP3Offset = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.txtP6Offset = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.txtP5Offset = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.btnOpenFolder = new System.Windows.Forms.Button();
this.btnGetActualPosition = new System.Windows.Forms.Button();
this.txtSpeed = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.txtFileName = new System.Windows.Forms.TextBox();
this.btnAbsMove = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.txtPosition = new System.Windows.Forms.TextBox();
this.txtActualPosition = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.btnSdStop = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
this.txtTargetPosition = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label12 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.txtAddr = new System.Windows.Forms.TextBox();
this.btnHomeMove = new System.Windows.Forms.Button();
this.btnServoOn = new System.Windows.Forms.Button();
this.txtPortName = new System.Windows.Forms.TextBox();
this.btnServoOff = new System.Windows.Forms.Button();
this.txtIOIndex = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.txtIoIp = new System.Windows.Forms.TextBox();
this.btnExit = new System.Windows.Forms.Button();
this.btnClear = new System.Windows.Forms.Button();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.ioStatusControl1 = new UserFromControl.IOStatusControl();
this.groupBox6.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// groupBox6
//
this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox6.Controls.Add(this.groupBox2);
this.groupBox6.Controls.Add(this.groupBox1);
this.groupBox6.Controls.Add(this.btnExit);
this.groupBox6.Controls.Add(this.btnClear);
this.groupBox6.Controls.Add(this.richTextBox1);
this.groupBox6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox6.Location = new System.Drawing.Point(6, 5);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(1008, 707);
this.groupBox6.TabIndex = 250;
this.groupBox6.TabStop = false;
//
// groupBox2
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox2.Controls.Add(this.txtP4Offset);
this.groupBox2.Controls.Add(this.label10);
this.groupBox2.Controls.Add(this.txtP3Offset);
this.groupBox2.Controls.Add(this.label9);
this.groupBox2.Controls.Add(this.txtP6Offset);
this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Controls.Add(this.txtP5Offset);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.btnOpenFolder);
this.groupBox2.Controls.Add(this.btnGetActualPosition);
this.groupBox2.Controls.Add(this.txtSpeed);
this.groupBox2.Controls.Add(this.label8);
this.groupBox2.Controls.Add(this.txtFileName);
this.groupBox2.Controls.Add(this.ioStatusControl1);
this.groupBox2.Controls.Add(this.btnAbsMove);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Controls.Add(this.txtPosition);
this.groupBox2.Controls.Add(this.txtActualPosition);
this.groupBox2.Controls.Add(this.label13);
this.groupBox2.Controls.Add(this.btnSdStop);
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Controls.Add(this.txtTargetPosition);
this.groupBox2.Location = new System.Drawing.Point(9, 192);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(458, 504);
this.groupBox2.TabIndex = 283;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "位置信息";
//
// txtP4Offset
//
this.txtP4Offset.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtP4Offset.Location = new System.Drawing.Point(184, 174);
this.txtP4Offset.MaxLength = 30;
this.txtP4Offset.Name = "txtP4Offset";
this.txtP4Offset.Size = new System.Drawing.Size(121, 26);
this.txtP4Offset.TabIndex = 287;
this.txtP4Offset.Text = "-6000";
//
// label10
//
this.label10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label10.Location = new System.Drawing.Point(6, 177);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(173, 20);
this.label10.TabIndex = 288;
this.label10.Text = "入料缓冲点P4偏移量:";
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtP3Offset
//
this.txtP3Offset.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtP3Offset.Location = new System.Drawing.Point(184, 142);
this.txtP3Offset.MaxLength = 30;
this.txtP3Offset.Name = "txtP3Offset";
this.txtP3Offset.Size = new System.Drawing.Size(121, 26);
this.txtP3Offset.TabIndex = 285;
this.txtP3Offset.Text = "6000";
//
// label9
//
this.label9.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label9.Location = new System.Drawing.Point(6, 145);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(173, 20);
this.label9.TabIndex = 286;
this.label9.Text = "入料前点P3偏移量:";
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtP6Offset
//
this.txtP6Offset.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtP6Offset.Location = new System.Drawing.Point(184, 110);
this.txtP6Offset.MaxLength = 30;
this.txtP6Offset.Name = "txtP6Offset";
this.txtP6Offset.Size = new System.Drawing.Size(121, 26);
this.txtP6Offset.TabIndex = 283;
this.txtP6Offset.Text = "6000";
//
// label5
//
this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.Location = new System.Drawing.Point(6, 113);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(173, 20);
this.label5.TabIndex = 284;
this.label5.Text = "出料缓冲点P6偏移量:";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtP5Offset
//
this.txtP5Offset.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtP5Offset.Location = new System.Drawing.Point(184, 78);
this.txtP5Offset.MaxLength = 30;
this.txtP5Offset.Name = "txtP5Offset";
this.txtP5Offset.Size = new System.Drawing.Size(121, 26);
this.txtP5Offset.TabIndex = 281;
this.txtP5Offset.Text = "-6000";
//
// label4
//
this.label4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(6, 81);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(173, 20);
this.label4.TabIndex = 282;
this.label4.Text = "出料前点P5偏移值:";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btnOpenFolder
//
this.btnOpenFolder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenFolder.Location = new System.Drawing.Point(312, 22);
this.btnOpenFolder.Name = "btnOpenFolder";
this.btnOpenFolder.Size = new System.Drawing.Size(132, 36);
this.btnOpenFolder.TabIndex = 280;
this.btnOpenFolder.Text = "打开文件夹";
this.btnOpenFolder.UseVisualStyleBackColor = true;
this.btnOpenFolder.Click += new System.EventHandler(this.btnOpenFolder_Click);
//
// btnGetActualPosition
//
this.btnGetActualPosition.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnGetActualPosition.Location = new System.Drawing.Point(312, 342);
this.btnGetActualPosition.Name = "btnGetActualPosition";
this.btnGetActualPosition.Size = new System.Drawing.Size(132, 36);
this.btnGetActualPosition.TabIndex = 269;
this.btnGetActualPosition.Text = "读取位置";
this.btnGetActualPosition.UseVisualStyleBackColor = true;
this.btnGetActualPosition.Click += new System.EventHandler(this.btnGetActualPosition_Click);
//
// txtSpeed
//
this.txtSpeed.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtSpeed.Location = new System.Drawing.Point(184, 227);
this.txtSpeed.MaxLength = 30;
this.txtSpeed.Name = "txtSpeed";
this.txtSpeed.Size = new System.Drawing.Size(121, 26);
this.txtSpeed.TabIndex = 83;
this.txtSpeed.Text = "20";
//
// label8
//
this.label8.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.Location = new System.Drawing.Point(6, 230);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(173, 20);
this.label8.TabIndex = 84;
this.label8.Text = "移动速度:";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtFileName
//
this.txtFileName.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtFileName.Location = new System.Drawing.Point(141, 27);
this.txtFileName.MaxLength = 30;
this.txtFileName.Name = "txtFileName";
this.txtFileName.Size = new System.Drawing.Size(164, 26);
this.txtFileName.TabIndex = 278;
this.txtFileName.Text = "position.csv";
//
// btnAbsMove
//
this.btnAbsMove.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAbsMove.Location = new System.Drawing.Point(312, 222);
this.btnAbsMove.Name = "btnAbsMove";
this.btnAbsMove.Size = new System.Drawing.Size(132, 36);
this.btnAbsMove.TabIndex = 88;
this.btnAbsMove.Text = "开始运动";
this.btnAbsMove.UseVisualStyleBackColor = true;
this.btnAbsMove.Click += new System.EventHandler(this.btnAbsMove_Click);
//
// label3
//
this.label3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(13, 30);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(122, 20);
this.label3.TabIndex = 277;
this.label3.Text = "保存文件名称:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label7
//
this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label7.Location = new System.Drawing.Point(6, 355);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(173, 20);
this.label7.TabIndex = 271;
this.label7.Text = "实际位置:";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtPosition
//
this.txtPosition.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtPosition.Location = new System.Drawing.Point(184, 265);
this.txtPosition.MaxLength = 30;
this.txtPosition.Name = "txtPosition";
this.txtPosition.Size = new System.Drawing.Size(121, 26);
this.txtPosition.TabIndex = 89;
this.txtPosition.Text = "5000";
//
// txtActualPosition
//
this.txtActualPosition.Enabled = false;
this.txtActualPosition.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtActualPosition.Location = new System.Drawing.Point(184, 352);
this.txtActualPosition.MaxLength = 30;
this.txtActualPosition.Name = "txtActualPosition";
this.txtActualPosition.Size = new System.Drawing.Size(121, 26);
this.txtActualPosition.TabIndex = 270;
//
// label13
//
this.label13.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label13.Location = new System.Drawing.Point(6, 268);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(173, 20);
this.label13.TabIndex = 90;
this.label13.Text = "目标位置:";
this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btnSdStop
//
this.btnSdStop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSdStop.Location = new System.Drawing.Point(312, 260);
this.btnSdStop.Name = "btnSdStop";
this.btnSdStop.Size = new System.Drawing.Size(132, 36);
this.btnSdStop.TabIndex = 257;
this.btnSdStop.Text = "停止";
this.btnSdStop.UseVisualStyleBackColor = true;
this.btnSdStop.Click += new System.EventHandler(this.btnSdStop_Click);
//
// label6
//
this.label6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label6.Location = new System.Drawing.Point(6, 321);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(173, 20);
this.label6.TabIndex = 268;
this.label6.Text = "目标位置:";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtTargetPosition
//
this.txtTargetPosition.Enabled = false;
this.txtTargetPosition.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtTargetPosition.Location = new System.Drawing.Point(184, 318);
this.txtTargetPosition.MaxLength = 30;
this.txtTargetPosition.Name = "txtTargetPosition";
this.txtTargetPosition.Size = new System.Drawing.Size(121, 26);
this.txtTargetPosition.TabIndex = 267;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label12);
this.groupBox1.Controls.Add(this.label18);
this.groupBox1.Controls.Add(this.txtAddr);
this.groupBox1.Controls.Add(this.btnHomeMove);
this.groupBox1.Controls.Add(this.btnServoOn);
this.groupBox1.Controls.Add(this.txtPortName);
this.groupBox1.Controls.Add(this.btnServoOff);
this.groupBox1.Controls.Add(this.txtIOIndex);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtIoIp);
this.groupBox1.Location = new System.Drawing.Point(9, 13);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(458, 173);
this.groupBox1.TabIndex = 282;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "设备信息";
//
// label12
//
this.label12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label12.Location = new System.Drawing.Point(8, 28);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(122, 20);
this.label12.TabIndex = 1;
this.label12.Text = "端口号:";
this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label18
//
this.label18.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label18.Location = new System.Drawing.Point(8, 64);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(122, 20);
this.label18.TabIndex = 94;
this.label18.Text = "地址:";
this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtAddr
//
this.txtAddr.Enabled = false;
this.txtAddr.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtAddr.Location = new System.Drawing.Point(136, 61);
this.txtAddr.MaxLength = 30;
this.txtAddr.Name = "txtAddr";
this.txtAddr.Size = new System.Drawing.Size(164, 26);
this.txtAddr.TabIndex = 95;
this.txtAddr.Text = "1";
//
// btnHomeMove
//
this.btnHomeMove.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnHomeMove.Location = new System.Drawing.Point(307, 113);
this.btnHomeMove.Name = "btnHomeMove";
this.btnHomeMove.Size = new System.Drawing.Size(132, 36);
this.btnHomeMove.TabIndex = 110;
this.btnHomeMove.Text = "原点返回";
this.btnHomeMove.UseVisualStyleBackColor = true;
this.btnHomeMove.Click += new System.EventHandler(this.btnHomeMove_Click);
//
// btnServoOn
//
this.btnServoOn.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnServoOn.Location = new System.Drawing.Point(307, 25);
this.btnServoOn.Name = "btnServoOn";
this.btnServoOn.Size = new System.Drawing.Size(132, 36);
this.btnServoOn.TabIndex = 258;
this.btnServoOn.Text = "打开伺服";
this.btnServoOn.UseVisualStyleBackColor = true;
this.btnServoOn.Click += new System.EventHandler(this.btnServoOn_Click);
//
// txtPortName
//
this.txtPortName.Enabled = false;
this.txtPortName.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtPortName.Location = new System.Drawing.Point(136, 25);
this.txtPortName.MaxLength = 30;
this.txtPortName.Name = "txtPortName";
this.txtPortName.Size = new System.Drawing.Size(164, 26);
this.txtPortName.TabIndex = 276;
this.txtPortName.Text = "COM1";
//
// btnServoOff
//
this.btnServoOff.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnServoOff.Location = new System.Drawing.Point(307, 64);
this.btnServoOff.Name = "btnServoOff";
this.btnServoOff.Size = new System.Drawing.Size(132, 36);
this.btnServoOff.TabIndex = 259;
this.btnServoOff.Text = "关闭伺服";
this.btnServoOff.UseVisualStyleBackColor = true;
this.btnServoOff.Click += new System.EventHandler(this.btnServoOff_Click);
//
// txtIOIndex
//
this.txtIOIndex.Enabled = false;
this.txtIOIndex.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtIOIndex.Location = new System.Drawing.Point(136, 133);
this.txtIOIndex.MaxLength = 30;
this.txtIOIndex.Name = "txtIOIndex";
this.txtIOIndex.Size = new System.Drawing.Size(164, 26);
this.txtIOIndex.TabIndex = 275;
this.txtIOIndex.Text = "1";
//
// label1
//
this.label1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(8, 100);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(122, 20);
this.label1.TabIndex = 272;
this.label1.Text = "IO模块IP:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label2
//
this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(8, 136);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(122, 20);
this.label2.TabIndex = 274;
this.label2.Text = "检测信号地址:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtIoIp
//
this.txtIoIp.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtIoIp.Location = new System.Drawing.Point(136, 97);
this.txtIoIp.MaxLength = 30;
this.txtIoIp.Name = "txtIoIp";
this.txtIoIp.Size = new System.Drawing.Size(164, 26);
this.txtIoIp.TabIndex = 273;
this.txtIoIp.Text = "192.168.201.11";
//
// btnExit
//
this.btnExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnExit.Location = new System.Drawing.Point(838, 665);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(132, 36);
this.btnExit.TabIndex = 281;
this.btnExit.Text = "退出";
this.btnExit.UseVisualStyleBackColor = true;
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// btnClear
//
this.btnClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnClear.Location = new System.Drawing.Point(691, 665);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(132, 36);
this.btnClear.TabIndex = 106;
this.btnClear.Text = "清理";
this.btnClear.UseVisualStyleBackColor = true;
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
//
// richTextBox1
//
this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.richTextBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.richTextBox1.Location = new System.Drawing.Point(473, 20);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(526, 642);
this.richTextBox1.TabIndex = 105;
this.richTextBox1.Text = "";
//
// timer1
//
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// ioStatusControl1
//
this.ioStatusControl1.IOName = "检测信号";
this.ioStatusControl1.IOValue = 0;
this.ioStatusControl1.isCanClick = false;
this.ioStatusControl1.Location = new System.Drawing.Point(134, 401);
this.ioStatusControl1.Name = "ioStatusControl1";
this.ioStatusControl1.Size = new System.Drawing.Size(171, 39);
this.ioStatusControl1.TabIndex = 279;
//
// FrmPositionTool
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(1020, 719);
this.Controls.Add(this.groupBox6);
this.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "FrmPositionTool";
this.Text = "升降轴位置测试";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmPositionTool_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
this.groupBox6.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.TextBox txtAddr;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TextBox txtPosition;
private System.Windows.Forms.Button btnAbsMove;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox txtSpeed;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Button btnClear;
private System.Windows.Forms.Button btnHomeMove;
private System.Windows.Forms.Button btnSdStop;
private System.Windows.Forms.Button btnServoOff;
private System.Windows.Forms.Button btnServoOn;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtTargetPosition;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox txtActualPosition;
private System.Windows.Forms.Button btnGetActualPosition;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.TextBox txtIOIndex;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtIoIp;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtPortName;
private System.Windows.Forms.TextBox txtFileName;
private System.Windows.Forms.Label label3;
private UserFromControl.IOStatusControl ioStatusControl1;
private System.Windows.Forms.Button btnOpenFolder;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox txtP4Offset;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox txtP3Offset;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox txtP6Offset;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txtP5Offset;
private System.Windows.Forms.Label label4;
}
}

using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnlineStore.ACPackingStore
{
public partial class FrmPositionTool : FrmBase
{
private string LogName = ResourceCulture.GetString("升降轴位置调试:");
private string PortName = "";
private int SlvAddr = 0;
private string IoIp = "";
private int IoIndex = 0;
public string Axis_Brake = IO_Type.Axis_Brake;
private System.Timers.Timer toolTimer = new System.Timers.Timer();
private string boxName = "";
public FrmPositionTool(string protName, int slvAddr, string ioIp, int ioIndex, string text)
{
InitializeComponent();
this.PortName = protName;
this.SlvAddr = slvAddr;
this.IoIp = ioIp;
this.IoIndex = ioIndex;
boxName = boxName.Trim().Replace("料仓", "");
this.Text = boxName + "_升降轴位置调试";
LogName = boxName + "_升降轴调试:";
toolTimer.Enabled = false;
toolTimer.Interval = 100;
toolTimer.AutoReset = true;
toolTimer.Elapsed += ToolTimer_Elapsed;
FrmPositionTool.CheckForIllegalCrossThreadCalls = false;
}
private void Form1_Load(object sender, EventArgs e)
{
ACServerManager.IsShowMsg = false;
LogUtil.logBox = this.richTextBox1;
//ACServerManager.richeBox = this.richTextBox1;
CheckForIllegalCrossThreadCalls = false;
txtPortName.Text = PortName;
txtAddr.Text = SlvAddr.ToString();
txtIOIndex.Text = IoIndex.ToString();
txtIoIp.Text = IoIp.ToString();
txtFileName.Text = boxName + "_position.csv";
if (IOManager.instance == null)
{
IOManager.Init();
IOManager.instance.ConnectionIOList(new List<string> { /*IoIp*/ });
}
//判断伺服是否已经打开
bool isOn = ACServerManager.ServerOnStatus(PortName, SlvAddr);
formStatus(isOn);
timer1.Start();
ioStatusControl1.IOName = ResourceCulture.GetString("检测信号");
}
private void btnServoOn_Click(object sender, EventArgs e)
{
//PositionList.Add(32000);
//PositionList.Add(38000);
//PositionList.Add(44000);
//PositionList.Add(50000);
//PositionList.Add(56000);
//P3Offset = FormUtil.GetIntValue(txtP3Offset);
//P4Offset = FormUtil.GetIntValue(txtP4Offset);
//P5Offset = FormUtil.GetIntValue(txtP5Offset);
//P6Offset = FormUtil.GetIntValue(txtP6Offset);
//StopTimer();
this.PortName = txtPortName.Text;
this.SlvAddr = FormUtil.GetIntValue(txtAddr);
bool result = ACServerManager.OpenPort(PortName);
if (!result)
{
MessageBox.Show(ResourceCulture.GetString("打开串口失败"));
return;
}
formStatus(true);
ACServerManager.InitSlvAddr(PortName, SlvAddr);
Thread.Sleep(100);
ACServerManager.AlarmClear(PortName, SlvAddr);
ACServerManager.ServoOn(PortName, SlvAddr);
try
{
IOManager.IOMove(Axis_Brake, IO_VALUE.HIGH);
}catch(Exception ex)
{
}
}
private void btnServoOff_Click(object sender, EventArgs e)
{
StopTimer();
// toolTimer.Stop();
ACServerManager.SuddenStop(PortName, SlvAddr);
Thread.Sleep(100);
try
{
IOManager.IOMove(Axis_Brake, IO_VALUE.LOW);
}
catch (Exception ex)
{
}
ACServerManager.ServoOff(PortName, SlvAddr);
formStatus(false);
}
private void formStatus(bool p)
{
txtPortName.Enabled = !p;
txtAddr.Enabled = !p;
txtIOIndex.Enabled = !p;
// txtIoIp.Enabled = !p;
btnAbsMove.Enabled = p;
btnSdStop.Enabled = p;
btnHomeMove.Enabled = p;
timer1.Enabled = p;
btnServoOff.Enabled = p;
btnServoOn.Enabled = !p;
btnGetActualPosition.Enabled = p;
}
private void btnClear_Click(object sender, EventArgs e)
{
this.richTextBox1.Text = "";
}
private void btnRelMove_Click(object sender, EventArgs e)
{
int position = Convert.ToInt32(txtPosition.Text);
ACServerManager.RelMove(PortName, SlvAddr, position);
}
private void btnHomeMove_Click(object sender, EventArgs e)
{
int speed = Convert.ToInt32(txtSpeed.Text);
ACServerManager.HomeMove(PortName, SlvAddr, speed);
}
private void btnSpeedMove_Click(object sender, EventArgs e)
{
int speed = Convert.ToInt32(txtSpeed.Text);
ACServerManager.SpeedMove(PortName, SlvAddr, speed);
}
private void btnGetActualPosition_Click(object sender, EventArgs e)
{
int value = ACServerManager.GetTargetPosition(PortName, SlvAddr);
txtTargetPosition.Text = value.ToString();
value = ACServerManager.GetActualtPosition(PortName, SlvAddr);
txtActualPosition.Text = value.ToString();
}
private void btnAbsMove_Click(object sender, EventArgs e)
{
int speed = Convert.ToInt32(txtSpeed.Text);
int position = Convert.ToInt32(txtPosition.Text.Trim(), 10);
TargetPostion = position;
if (speed<=(0))
{
MessageBox.Show(ResourceCulture.GetString("请输入正确的速度"));
txtSpeed.Focus();
return;
}
P3Offset = FormUtil.GetIntValue(txtP3Offset);
P4Offset = FormUtil.GetIntValue(txtP4Offset);
P5Offset = FormUtil.GetIntValue(txtP5Offset);
P6Offset = FormUtil.GetIntValue(txtP6Offset);
LastValue = IO_VALUE.LOW;
string fileName = txtFileName.Text;
string filePath = Application.StartupPath + @"\logs\" + fileName;
if (File.Exists(filePath))
{
string msg = "文件【{0}】已存在,是否确定覆盖?";
DialogResult result = MessageBox.Show(msg, "", MessageBoxButtons.OKCancel,MessageBoxIcon.Question);
if (!result.Equals(DialogResult.OK))
{
return;
}
}
PositionList = new List<int>();
LogUtil.info(LogName + "伺服开始运动,速度【"+speed+"】位置【"+position+"】启动定时器 ");
formMoveStatus(false);
ACServerManager.AbsMove(PortName, SlvAddr, position,speed);
toolTimer.Start();
}
private int P3Offset = 0;
private int P4Offset = 0;
private int P5Offset = 0;
private int P6Offset = 0;
private void formMoveStatus(bool status)
{
txtFileName.Enabled = status;
txtP5Offset.Enabled = status;
txtP3Offset.Enabled = status;
txtP4Offset.Enabled = status;
txtP6Offset.Enabled = status;
txtSpeed.Enabled = status;
txtPosition.Enabled = status;
}
private void btnSdStop_Click(object sender, EventArgs e)
{
toolTimer.Stop();
ACServerManager.SuddenStop(PortName, SlvAddr);
}
private IO_VALUE GetSingleValue()
{
return IOManager.instance.GetDIValue(IoIp, 0, (ushort)IoIndex);
}
private int TargetPostion = 0;
private bool isInProcesss = false;
private DateTime LastTime = DateTime.Now;
private List<int> PositionList = new List<int>();
private IO_VALUE LastValue = IO_VALUE.LOW;
private DateTime LastGetPTime = DateTime.Now;
private void ToolTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
TimeSpan span = DateTime.Now - LastTime;
if (isInProcesss && span.TotalSeconds < 1)
{
return;
}
isInProcesss = true;
try
{
int moveS = ACServerManager.GetBusyStatus(PortName, SlvAddr);
if (moveS.Equals(1))
{
IO_VALUE currValue = GetSingleValue();
TimeSpan checkSpan = DateTime.Now - LastGetPTime;
if (LastValue.Equals(IO_VALUE.LOW) && currValue.Equals(IO_VALUE.HIGH)&&checkSpan.TotalSeconds>2)
{
int currPos = ACServerManager.GetActualtPosition(PortName, SlvAddr);
txtActualPosition.Text = currPos.ToString();
PositionList.Add(currPos);
int num = PositionList.Count;
int preValue = 0;
if (PositionList.Count > 1)
{
preValue = PositionList[num - 2];
}
LogUtil.info(LogName + "【"+ num + "】【" + currPos+"】【"+Math.Abs(currPos-preValue)+"】");
if (LogUtil.logBox == null)
{
this.richTextBox1.AppendText(LogName + "【" + num + "】【" + currPos + "】【" + Math.Abs(currPos - preValue) + "】"+Environment.NewLine);
}
LastValue = IO_VALUE.HIGH;
LastGetPTime = DateTime.Now;
}
LastValue = currValue;
}
else
{
StopTimer();
}
}catch(Exception ex)
{
LogUtil.error(LogName+"ToolTimer_Elapsed" + ex.ToString());
}
isInProcesss = false;
}
private void StopTimer()
{
toolTimer.Stop();
if (PositionList.Count <= 0)
{
return;
}
LogUtil.info(LogName + "伺服已停止运动,停止定时器,记录数据");
List<string> strList = new List<string>();
strList.Add("编号,标准位置,升降轴库位出料前点P5,升降轴库位出料缓冲点P6,升降轴库位入料前点P3,升降轴库位入料缓冲点P4");
int index = 1;
foreach (int p in PositionList)
{
int P3 = p + P3Offset;
int P4 = p + P4Offset;
int P5 = p + P5Offset;
int P6 = p + P6Offset;
string resultstr = index + "," + p + ","+P5+","+P6+","+P3+","+P4+"";
strList.Add(resultstr);
index++;
}
string fileName = txtFileName.Text;
string filePath = Application.StartupPath + @"\logs\" + fileName;
try
{
// Clipboard.SetDataObject(resultstr);
File.WriteAllLines(filePath, strList.ToArray());
LogUtil.error(LogName + "保存位置到文件【" + filePath + "】成功");
}
catch (Exception ex)
{
LogUtil.error(LogName + "保存位置到文件【" + filePath + "】出错:" + ex.ToString());
}
formMoveStatus(true );
}
private void timer1_Tick(object sender, EventArgs e)
{
try
{
ioStatusControl1.IOValue = (int)GetSingleValue();
ioStatusControl1.ShowData();
}
catch (Exception ex)
{
}
}
private void FrmPositionTool_FormClosing(object sender, FormClosingEventArgs e)
{
timer1.Stop();
if (btnServoOff.Enabled)
{
StopTimer();
// toolTimer.Stop();
ACServerManager.SuddenStop(PortName, SlvAddr);
Thread.Sleep(100);
}
LogUtil.logBox = null;
//ACServerManager.CloseAllPort();
//IOManager.instance.CloseAllConnection();
}
private void btnOpenFolder_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Explorer.exe", Application.StartupPath + @"\logs\");
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
}
public class ResourceCulture
{
internal static string GetString(string str)
{
return str;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
......@@ -118,7 +118,8 @@ namespace OnlineStore.DeviceLibrary
aioBox.SetInput(Asa.IOModule.Box_Type.DI, DILength);
aioBox.SetOutput(Asa.IOModule.Box_Type.DO, DOLength);
aioBox.AutoReadInput(true, DIMS);
//DI主动上传
aioBox.AutoReadInput(true);
aioBox.AutoReadOutput(true, DOMS);
aioBox.LogOut = true;
......
......@@ -42,6 +42,6 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// 松下伺服控制的包装料料仓
/// </summary>
public static string RC_AC_PA = "RC_AC_P101";
public static string RC_AC_PA = "RC_AC_PA";
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!