From a4d439d1c44288ee04fbe06c296bed6cda62a612 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 18 Mar 2025 17:16:00 +0100 Subject: [PATCH] FANUC: - Update gestione area MemG che per conseguenza genera FluxLog ND --- IOB-WIN-FANUC/DATA/CONF/3025.ini | 1 + IOB-WIN-FANUC/DATA/CONF/MAIN.ini | 3 +- IOB-WIN-FANUC/IOB-WIN-FANUC.csproj | 4 +- IOB-WIN-FORM/Iob/Generic.cs | 91 +++++++++++++++++++++++------- IOB-WIN-FORM/Iob/Simula.cs | 32 ++++++++--- 5 files changed, 103 insertions(+), 28 deletions(-) diff --git a/IOB-WIN-FANUC/DATA/CONF/3025.ini b/IOB-WIN-FANUC/DATA/CONF/3025.ini index 2ed9e106..0a4d3cdb 100644 --- a/IOB-WIN-FANUC/DATA/CONF/3025.ini +++ b/IOB-WIN-FANUC/DATA/CONF/3025.ini @@ -40,6 +40,7 @@ BIT6=currPrgName|%O5000/Y31.6 BIT7=X8.4 AREAD_START=0 AREAD_SIZE=0 +AREAG_START=0 AREAG_SIZE=48 AREAR_START=0 AREAR_SIZE=0 diff --git a/IOB-WIN-FANUC/DATA/CONF/MAIN.ini b/IOB-WIN-FANUC/DATA/CONF/MAIN.ini index 9e002478..925ef97a 100644 --- a/IOB-WIN-FANUC/DATA/CONF/MAIN.ini +++ b/IOB-WIN-FANUC/DATA/CONF/MAIN.ini @@ -25,7 +25,8 @@ CLI_INST=SteamWareSim ;STARTLIST=EV112 ;STARTLIST=3021 ;STARTLIST=3004 -STARTLIST=3002 +;STARTLIST=3002 +STARTLIST=3025 MAXCNC=10 \ No newline at end of file diff --git a/IOB-WIN-FANUC/IOB-WIN-FANUC.csproj b/IOB-WIN-FANUC/IOB-WIN-FANUC.csproj index a94c6dcd..4cc5b0a4 100644 --- a/IOB-WIN-FANUC/IOB-WIN-FANUC.csproj +++ b/IOB-WIN-FANUC/IOB-WIN-FANUC.csproj @@ -168,7 +168,9 @@ Always - + + Always + Always diff --git a/IOB-WIN-FORM/Iob/Generic.cs b/IOB-WIN-FORM/Iob/Generic.cs index 55c2bb3b..6ffece8f 100644 --- a/IOB-WIN-FORM/Iob/Generic.cs +++ b/IOB-WIN-FORM/Iob/Generic.cs @@ -2229,16 +2229,34 @@ namespace IOB_WIN_FORM.Iob // per ogni valore del dizionario mostro ed accodo! foreach (var item in currAlarms) { - sVal = string.Format("[CNC_ALARM]{0}|{1}", item.Key, item.Value); - // chiamo accodamento... - accodaFLog(sVal, qEncodeFLog(item.Key, item.Value)); + // verifico NON sia un ND... + if (item.Key == "ND") + { + // log anomalia... + lgTrace($"Errore in predisposizione FL Allarmi CNC: item.key risulta ND! | item.key: {item.Key} | item.Value: {item.Value}"); + } + else + { + sVal = string.Format("[CNC_ALARM]{0}|{1}", item.Key, item.Value); + // chiamo accodamento... + 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)); + // verifico NON sia un ND... + if (item.Key == "ND") + { + // log anomalia... + lgTrace($"Errore in predisposizione FL Allarmi NON CNC: item.key risulta ND! | item.key: {item.Key} | item.Value: {item.Value}"); + } + else + { + sVal = $"{item.Key} | {item.Value}"; + accodaFLog(sVal, qEncodeFLog(item.Key, item.Value)); + } } } catch (Exception exc) @@ -2345,9 +2363,18 @@ namespace IOB_WIN_FORM.Iob // controllo se vietato dynData if (sendDynDataRec || item.Key != "DYNDATA") { - sVal = string.Format("[DYNDATA]{0}|{1}", item.Key, item.Value); - // chiamo accodamento... - accodaFLog(sVal, qEncodeFLog(item.Key, item.Value)); + // verifico NON sia un ND... + if (item.Key == "ND") + { + // log anomalia... + lgTrace($"Errore in processDynData.01: item.key risulta ND! | item.key: {item.Key} | item.Value: {item.Value}"); + } + else + { + sVal = string.Format("[DYNDATA]{0}|{1}", item.Key, item.Value); + // chiamo accodamento... + accodaFLog(sVal, qEncodeFLog(item.Key, item.Value)); + } } } } @@ -2361,10 +2388,18 @@ namespace IOB_WIN_FORM.Iob { // controllo se vietato dynData if (sendDynDataRec || item.Key != "DYNDATA") - { - sVal = string.Format("[DYNDATA]{0}|{1}", item.Key, item.Value); - // chiamo accodamento... - accodaFLog(sVal, qEncodeFLog(item.Key, item.Value)); + { // verifico NON sia un ND... + if (item.Key == "ND") + { + // log anomalia... + lgTrace($"Errore in processDynData.02: item.key risulta ND! | item.key: {item.Key} | item.Value: {item.Value}"); + } + else + { + sVal = string.Format("[DYNDATA]{0}|{1}", item.Key, item.Value); + // chiamo accodamento... + accodaFLog(sVal, qEncodeFLog(item.Key, item.Value)); + } } } } @@ -2472,9 +2507,18 @@ namespace IOB_WIN_FORM.Iob string sVal = ""; foreach (var item in currOverride) { - sVal = string.Format("[OVERRIDES]{0}|{1}", item.Key, item.Value); - // chiamo accodamento... - accodaFLog(sVal, qEncodeFLog(item.Key, item.Value)); + // verifico NON sia un ND... + if (item.Key == "ND") + { + // log anomalia... + lgTrace($"Errore in processOverride: item.key risulta ND! | item.key: {item.Key} | item.Value: {item.Value}"); + } + else + { + sVal = string.Format("[OVERRIDES]{0}|{1}", item.Key, item.Value); + // chiamo accodamento... + accodaFLog(sVal, qEncodeFLog(item.Key, item.Value)); + } } } } @@ -8181,10 +8225,19 @@ namespace IOB_WIN_FORM.Iob // per ogni valore del dizionario mostro ed accodo! string sVal = ""; foreach (var item in currSysInfo) - { - sVal = string.Format("[SYSINFO]{0}|{1}", item.Key, item.Value); - // chiamo accodamento... - accodaFLog(sVal, qEncodeFLog(item.Key, item.Value)); + { + // verifico NON sia un ND... + if (item.Key == "ND") + { + // log anomalia... + lgTrace($"Errore in processSysInfo: item.key risulta ND! | item.key: {item.Key} | item.Value: {item.Value}"); + } + else + { + sVal = string.Format("[SYSINFO]{0}|{1}", item.Key, item.Value); + // chiamo accodamento... + accodaFLog(sVal, qEncodeFLog(item.Key, item.Value)); + } } } } diff --git a/IOB-WIN-FORM/Iob/Simula.cs b/IOB-WIN-FORM/Iob/Simula.cs index 8565c1f0..134561a1 100644 --- a/IOB-WIN-FORM/Iob/Simula.cs +++ b/IOB-WIN-FORM/Iob/Simula.cs @@ -1698,9 +1698,18 @@ namespace IOB_WIN_FORM.Iob var kvpFlux = fLog2send.valString.Split(';'); if (kvpFlux.Count() > 1) { - sVal = $"[DYNDATA] |{fLog2send.dtRif:yyyy-MM-dd HH:mm:ss}|{kvpFlux[0]}|{kvpFlux[1]}"; - // chiamo accodamento con dataora corretta... - accodaFLog(sVal, qEncodeFLog(fLog2send.dtRif, kvpFlux[0], kvpFlux[1])); + // verifico NON sia un ND... + if (kvpFlux[0] == "ND") + { + // log anomalia... + lgTrace($"Errore in processFluxLogTable: kvpFlux[0] risulta ND! | item.key: {kvpFlux[0]} | item.Value: {kvpFlux[1]}"); + } + else + { + sVal = $"[DYNDATA] |{fLog2send.dtRif:yyyy-MM-dd HH:mm:ss}|{kvpFlux[0]}|{kvpFlux[1]}"; + // chiamo accodamento con dataora corretta... + accodaFLog(sVal, qEncodeFLog(fLog2send.dtRif, kvpFlux[0], kvpFlux[1])); + } } } // svuoto coda invio fluxlog... @@ -1829,10 +1838,19 @@ namespace IOB_WIN_FORM.Iob { if (sendFluxOnRead) { - // per prima cosa fluxLog a prescindere... - sVal = $"[LOGFILE]{currData[0]}|{currData[1]}"; - // ...e chiamo accodamento - accodaFLog(sVal, qEncodeFLog(fLog2send.dtRif, currData[0], currData[1])); + // verifico NON sia un ND... + if (currData[0] == "ND") + { + // log anomalia... + lgTrace($"Errore in processSignLogTable: kvpFlux[0] risulta ND! | item.key: {currData[0]} | item.Value: {currData[1]}"); + } + else + { + // per prima cosa fluxLog a prescindere... + sVal = $"[LOGFILE]{currData[0]}|{currData[1]}"; + // ...e chiamo accodamento + accodaFLog(sVal, qEncodeFLog(fLog2send.dtRif, currData[0], currData[1])); + } } switch (currData[0])