IOB-WIN-NEXT:

- Refresh frequenza update lastPLC
- refreh MAN
This commit is contained in:
Samuele Locatelli
2022-07-14 15:29:57 +02:00
parent 81233d0bc4
commit f009dbef37
4 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -124,13 +124,13 @@ namespace IOB_UT_NEXT
// controllo se sia ALMENO 1 sec...
if (lastDataIn != item.lastDataIn)
{
if (lastDataIn.Subtract(item.lastDataIn).TotalSeconds > 1)
if (lastDataIn.Subtract(item.lastDataIn).TotalMilliseconds > 100)
return false;
}
// controllo se sia ALMENO 1 sec...
if (lastDataOut != item.lastDataOut)
{
if (lastDataOut.Subtract(item.lastDataOut).TotalSeconds > 1)
if (lastDataOut.Subtract(item.lastDataOut).TotalMilliseconds > 100)
return false;
}
if (semIn != item.semIn)
-1
View File
@@ -169,7 +169,6 @@ namespace IOB_UT_NEXT
{
string rawData = JsonConvert.SerializeObject(value);
saveAndSendMessage(redIobKey, redIobChannel, rawData);
//setRSV(redIobKey, rawData);
}
}
+2
View File
@@ -211,6 +211,7 @@ namespace IOB_WIN_NEXT
if (adpRunning)
{
lgInfo("Connessione OK");
lastReadPLC = DateTime.Now;
}
}
else
@@ -269,6 +270,7 @@ namespace IOB_WIN_NEXT
sw.Start();
elencoSyncState = dbProxy.DataController.SyncStateDoImportAll();
sw.Stop();
lastReadPLC = DateTime.Now;
lgInfo($"DB: esecuzione task dbProxy.DataController.SyncStateGetAll() in {sw.ElapsedMilliseconds} ms");
if (elencoSyncState != null)
+1 -1
View File
@@ -1451,6 +1451,7 @@ namespace IOB_WIN_NEXT
rawData = currPLC.ReadHoldingRegisters(startAddr - baseAddr, numReg);
stopwatch.Stop();
lgTrace($"Lettura in blocco HoldingRegisters| startAddr: {startAddr} | numReg {numReg} | rawData.lenght: {rawData.Length} | {stopwatch.ElapsedMilliseconds}ms");
lastReadPLC = DateTime.Now;
// salvo in LUT la versione ESPLOSA 2 byte alla volta...
if (rawData.Length > 0)
{
@@ -1478,7 +1479,6 @@ namespace IOB_WIN_NEXT
lgError($"Impossibile copiare dati, array di origine troppo corto: rawData.lenght: {rawData.Length} | base addr richiesto i*2: {i * 2} | errori currReadErrors: {currReadErrors}");
}
}
lastReadPLC = DateTime.Now;
}
}
catch (Exception exc)