Merge branch 'release/FixPingDisconnectOnLoad01'

This commit is contained in:
Samuele Locatelli
2023-09-05 14:47:46 +02:00
4 changed files with 23 additions and 2 deletions
+1
View File
@@ -58,5 +58,6 @@ CLI_INST=SteamWareSim
;STARTLIST=SIMUL_02
;NB: mettere copy always ai file di conf x fare test...
STARTLIST=SIMUL_01
;STARTLIST=PING
MAXCNC=10
+3 -1
View File
@@ -2,13 +2,15 @@
[IOB]
CNCTYPE=PingWatchdog
PING_MS_TIMEOUT=500
IOB_NAME=SIMUL_09
[MACHINE]
VENDOR=STEAMWARE
MODEL=WATCHDOG
[CNC]
IP=10.74.83.112
;IP=10.74.83.112
IP=10.74.82.253
PORT=0000
[SERVER]
+3 -1
View File
@@ -552,7 +552,9 @@
<None Include="DATA\CONF\PIZ08.ini" />
<None Include="DATA\CONF\PIZ08.json" />
<None Include="DATA\CONF\PIZ08_alarm.json" />
<None Include="DATA\CONF\PING.ini" />
<None Include="DATA\CONF\PING.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\PIZ09.ini" />
<None Include="DATA\CONF\PIZ09.json" />
<None Include="DATA\CONF\PIZ09_alarm.json" />
+16
View File
@@ -21,6 +21,9 @@ namespace IOB_WIN_NEXT.IobNet
lastPzCountSend = adesso;
lastWarnODL = adesso;
vetoCheckStatus = adesso;
// 2023.09.05 imposto anche primo ping e check disconnected...
lastPING = adesso;
lastDisconnCheck = adesso;
var POWEROFF_TIMEOUT_SEC = getOptPar("POWEROFF_TIMEOUT_SEC");
if (!string.IsNullOrEmpty(POWEROFF_TIMEOUT_SEC))
{
@@ -29,6 +32,19 @@ namespace IOB_WIN_NEXT.IobNet
lgDebug($"L'adapter effettuera' PING di controllo all'indirizzo {cIobConf.cncPingAddr} per forzare stato poweroff dopo {PoweroffTimeoutSec} sec");
}
public override void startAdapter(bool resetQueue)
{
base.startAdapter(resetQueue);
// 2023.09.05 imposto anche primo ping e check disconnected...
DateTime adesso = DateTime.Now;
lastWatchDog = adesso;
lastPING = adesso;
lastReadPLC = adesso;
lastDisconnCheck = adesso;
// faccio un primo check
tryConnect();
}
#endregion Public Constructors
#region Public Methods