diff --git a/IOB-WIN-NEXT/IobOpc/OpcUa.cs b/IOB-WIN-NEXT/IobOpc/OpcUa.cs index bcce9673..b50a9324 100644 --- a/IOB-WIN-NEXT/IobOpc/OpcUa.cs +++ b/IOB-WIN-NEXT/IobOpc/OpcUa.cs @@ -422,7 +422,47 @@ namespace IOB_WIN_NEXT.IobOpc { if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCounteByIob)) { - // da ridefinire la gestione base del contapezzi OPC-UA... + if (string.IsNullOrEmpty(opcUaParams.keyPartCount)) + { + lgTrace("Gestione contapezzi: manca parametro per keyPartCount"); + } + else + { + // cerco parametro contapezzi... + string currPzCount = getDataItemValue(opcUaParams.keyPartCount); + + // se ho un contapezzi... processo... + if (!string.IsNullOrEmpty(currPzCount)) + { + int newVal = -1; + bool fatto = Int32.TryParse(currPzCount, out newVal); + + if (fatto) + { + // gestione decremento contapezzi: viene "messo via" solo SE c'รจ un + // effettivo decremento contapezzi... + if (newVal < contapezziPLC) + { + pzCountResetted = true; + // incremento contatore richiesta + countKeyRichiesta = countKeyRichiesta + 1; + // log + lgInfo("Contapezzi resettato (PLC) --> pzCountResetted = true"); + } + + // salvo nuovo valore contapezziPLC + contapezziPLC = newVal > -1 ? newVal : contapezziPLC; + } + else + { + lgError($"Errore in decodifica valore contapezzi, valore rilevato: {currPzCount}"); + } + } + else + { + lgError("Errore in decodifica valore contapezzi, valore vuoto!"); + } + } } } @@ -1482,6 +1522,7 @@ namespace IOB_WIN_NEXT.IobOpc threshDBand = 0; dSamplePeriod = 60; } + lgDebug($"Deadband | item {uuid} | DBand {threshDBand} | samplePeriod {dSamplePeriod}"); // salvo oggetto x "uso interno" currDataItem = new OpcUaDataItemExt(dataItem) diff --git a/IOB-WIN-NEXT/UAClient.cs b/IOB-WIN-NEXT/UAClient.cs index 44bc3b5d..2bea698a 100644 --- a/IOB-WIN-NEXT/UAClient.cs +++ b/IOB-WIN-NEXT/UAClient.cs @@ -225,7 +225,7 @@ namespace IOB_WIN_NEXT // se veto --> loggo veto if (vetoBrowse.Contains($"{result.NodeId}")) { - lgTrace($"| FILTERED --> NodeId = {result.NodeId}, DisplayName = {result.DisplayName.Text}, NodeClass = {result.NodeClass}, Others: {result.BinaryEncodingId} | {result.BrowseName}"); + lgInfo($"| FILTERED --> NodeId = {result.NodeId}, DisplayName = {result.DisplayName.Text}, NodeClass = {result.NodeClass}, Others: {result.BinaryEncodingId} | {result.BrowseName}"); } // se NON fa parte dell'elenco dei VETO di filterItems... else