Commit a3ea18af 刘韬

添加IO重连机制

1 个父辈 13d512f3
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
// timer1 // timer1
// //
this.timer1.Enabled = true; this.timer1.Enabled = true;
this.timer1.Interval = 1000; this.timer1.Interval = 500;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick); this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
// //
// groupBox1 // groupBox1
......
...@@ -1212,4 +1212,7 @@ ...@@ -1212,4 +1212,7 @@
<data name="InstoreInfo" xml:space="preserve"> <data name="InstoreInfo" xml:space="preserve">
<value> batch storage and retrieval info: storage: </value> <value> batch storage and retrieval info: storage: </value>
</data> </data>
<data name="FrmStoreBox_tabPage6_Text" xml:space="preserve">
<value>Storage Adjust</value>
</data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -76,15 +76,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -76,15 +76,20 @@ namespace OnlineStore.DeviceLibrary
aioBox.IP = ioIp; aioBox.IP = ioIp;
aioBox.Upload = false; aioBox.Upload = false;
aioBox.DI_Changed_Event += AioBox_DI_Changed_Event;
aioBox.DI_Changed_Event += AioBox_DI_Changed_Event; ;
aioBox.DO_Changed_Event += AioBox_DO_Changed_Event; aioBox.DO_Changed_Event += AioBox_DO_Changed_Event;
LogUtil.info("开始连接:" + logName + ":"); LogUtil.info("开始连接:" + logName + ":");
aioBox.Connect(); aioBox.Connect();
AIOMap.Add(ioIp, aioBox); AIOMap.Add(ioIp, aioBox);
Thread.Sleep(5);
for (int i=0;i<15;i++)
{
if (aioBox.IsConn)
break;
Thread.Sleep(1000);
}
LogUtil.info("连接成功:" + logName + ":");
//读取所有的DO //读取所有的DO
ReadAllDI(ioIp, 0); ReadAllDI(ioIp, 0);
Thread.Sleep(5); Thread.Sleep(5);
......
...@@ -23,7 +23,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -23,7 +23,7 @@ namespace OnlineStore.DeviceLibrary
{ {
checkTimer = new System.Timers.Timer(); checkTimer = new System.Timers.Timer();
checkTimer.AutoReset = true; checkTimer.AutoReset = true;
checkTimer.Interval += 30; checkTimer.Interval += 10;
checkTimer.Elapsed += CheckTimer_Elapsed; checkTimer.Elapsed += CheckTimer_Elapsed;
checkTimer.Enabled = false; checkTimer.Enabled = false;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!