IOB-WIN-NEXT:
- Refresh frequenza update lastPLC - refreh MAN
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -169,7 +169,6 @@ namespace IOB_UT_NEXT
|
||||
{
|
||||
string rawData = JsonConvert.SerializeObject(value);
|
||||
saveAndSendMessage(redIobKey, redIobChannel, rawData);
|
||||
//setRSV(redIobKey, rawData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user