From 40411f56ddea4c59e552a7d993655b550cf53641 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Sat, 2 Oct 2021 11:33:12 +0200 Subject: [PATCH] Completata review x trasmissione allarmi Torri --- IOB-WIN-NEXT/DATA/CONF/MAIN.ini | 5 +++-- IOB-WIN-NEXT/IobGeneric.cs | 8 +++++++- IOB-WIN-NEXT/IobSiemensTorri.cs | 6 +++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/IOB-WIN-NEXT/DATA/CONF/MAIN.ini b/IOB-WIN-NEXT/DATA/CONF/MAIN.ini index 72923f8f..5370415f 100644 --- a/IOB-WIN-NEXT/DATA/CONF/MAIN.ini +++ b/IOB-WIN-NEXT/DATA/CONF/MAIN.ini @@ -68,8 +68,9 @@ CLI_INST=SteamWareSim ;STARTLIST=PIZ08 ;STARTLIST=PIZ04 ;STARTLIST=PIZ05 -;STARTLIST=FOV062 -STARTLIST=SIM_PIZ03 ;STARTLIST=OPC_UA +;STARTLIST=SIM_PIZ03 +;STARTLIST=FOV062 +STARTLIST=3013 MAXCNC=10 \ No newline at end of file diff --git a/IOB-WIN-NEXT/IobGeneric.cs b/IOB-WIN-NEXT/IobGeneric.cs index bac431f8..782b7f78 100644 --- a/IOB-WIN-NEXT/IobGeneric.cs +++ b/IOB-WIN-NEXT/IobGeneric.cs @@ -4071,12 +4071,12 @@ namespace IOB_WIN_NEXT { try { + string sVal = ""; if (lastAlarm != currAlarms["CNC_ALARM"]) { // salvo! lastAlarm = currAlarms["CNC_ALARM"]; // per ogni valore del dizionario mostro ed accodo! - string sVal = ""; foreach (var item in currAlarms) { sVal = string.Format("[CNC_ALARM]{0}|{1}", item.Key, item.Value); @@ -4084,6 +4084,12 @@ namespace IOB_WIN_NEXT accodaFLog(sVal, qEncodeFLog(item.Key, item.Value)); } } + // accodo ALTRI allarmi NON CNC... + foreach (var item in currAlarms.Where(X => X.Key != "CNC_ALARM")) + { + sVal = $"{item.Key} | {item.Value}"; + accodaFLog(sVal, qEncodeFLog(item.Key, item.Value)); + } } catch (Exception exc) { diff --git a/IOB-WIN-NEXT/IobSiemensTorri.cs b/IOB-WIN-NEXT/IobSiemensTorri.cs index 7e9192bc..c0b8cc75 100644 --- a/IOB-WIN-NEXT/IobSiemensTorri.cs +++ b/IOB-WIN-NEXT/IobSiemensTorri.cs @@ -226,8 +226,8 @@ namespace IOB_WIN_NEXT uint valDW = 0; var MemBlockPZ = new byte[4]; bool fatto = S7ReadBB(ref MemBlockPZ, memAddrAlarms, 4); - if (fatto) - { + //if (fatto) + //{ valDW = S7.Net.Types.DWord.FromByteArray(MemBlockPZ.ToArray()); // se <> 0 --> log e accodo a dynData if (valDW != 0) @@ -244,7 +244,7 @@ namespace IOB_WIN_NEXT } trovato++; } - } + //} return trovato; }