diff --git a/IOB-WIN/IobFanuc.cs b/IOB-WIN/IobFanuc.cs index fd324520..5ebba171 100644 --- a/IOB-WIN/IobFanuc.cs +++ b/IOB-WIN/IobFanuc.cs @@ -481,9 +481,20 @@ namespace IOB_WIN try { currODL = utils.callUrl(urlGetCurrODL); - lgInfo(string.Format("Lettura ODL, {0} --> {1}", currIdxODL, currODL)); - // provo a salvare nuovo ODL - int.TryParse(currODL, out currIdxODL); + // solo SE HO un ODL... + if (currODL == "" || currODL == "0") + { + if (periodicLog) + { + lgInfo(string.Format("Fanuc | Lettura ODL andata a vuoto: currODL: {0}", currODL)); + } + } + else + { + lgInfo(string.Format("Fanuc | Lettura ODL, currODL{0} --> currIdxODL prec: {1}", currODL, currIdxODL)); + // provo a salvare nuovo ODL + int.TryParse(currODL, out currIdxODL); + } } catch (Exception exc) { diff --git a/IOB-WIN/IobKawasaki.cs b/IOB-WIN/IobKawasaki.cs index cf79d908..3c0d78dc 100644 --- a/IOB-WIN/IobKawasaki.cs +++ b/IOB-WIN/IobKawasaki.cs @@ -736,9 +736,20 @@ namespace IOB_WIN try { currODL = utils.callUrl(urlGetCurrODL); - lgInfo(string.Format("Lettura ODL, {0} --> {1}", currIdxODL, currODL)); - // provo a salvare nuovo ODL - int.TryParse(currODL, out currIdxODL); + // solo SE HO un ODL... + if (currODL == "" || currODL == "0") + { + if (periodicLog) + { + lgInfo(string.Format("Kawasaki | Lettura ODL andata a vuoto: currODL: {0}", currODL)); + } + } + else + { + lgInfo(string.Format("Kawasaki | Lettura ODL, currODL{0} --> currIdxODL prec: {1}", currODL, currIdxODL)); + // provo a salvare nuovo ODL + int.TryParse(currODL, out currIdxODL); + } } catch (Exception exc) { diff --git a/IOB-WIN/IobOSAI.cs b/IOB-WIN/IobOSAI.cs index 207a278f..079d1a80 100644 --- a/IOB-WIN/IobOSAI.cs +++ b/IOB-WIN/IobOSAI.cs @@ -341,12 +341,20 @@ namespace IOB_WIN try { currODL = utils.callUrl(urlGetCurrODL); - if (utils.CRB("verbose")) + // solo SE HO un ODL... + if (currODL == "" || currODL == "0") { - lgInfo(string.Format("Lettura ODL, {0} --> {1}", currIdxODL, currODL)); + if (periodicLog) + { + lgInfo(string.Format("Osai | Lettura ODL andata a vuoto: currODL: {0}", currODL)); + } + } + else + { + lgInfo(string.Format("Osai | Lettura ODL, currODL{0} --> currIdxODL prec: {1}", currODL, currIdxODL)); + // provo a salvare nuovo ODL + int.TryParse(currODL, out currIdxODL); } - // provo a salvare nuovo ODL - int.TryParse(currODL, out currIdxODL); } catch (Exception exc) { diff --git a/IOB-WIN/IobSiemens.cs b/IOB-WIN/IobSiemens.cs index 0d7fe31b..273c290f 100644 --- a/IOB-WIN/IobSiemens.cs +++ b/IOB-WIN/IobSiemens.cs @@ -645,9 +645,20 @@ namespace IOB_WIN try { currODL = utils.callUrl(urlGetCurrODL); - lgInfo(string.Format("Lettura ODL, {0} --> {1}", currIdxODL, currODL)); - // provo a salvare nuovo ODL - int.TryParse(currODL, out currIdxODL); + // solo SE HO un ODL... + if (currODL == "" || currODL == "0") + { + if (periodicLog) + { + lgInfo(string.Format("Siemens | Lettura ODL andata a vuoto: currODL: {0}", currODL)); + } + } + else + { + lgInfo(string.Format("Siemens | Lettura ODL, currODL{0} --> currIdxODL prec: {1}", currODL, currIdxODL)); + // provo a salvare nuovo ODL + int.TryParse(currODL, out currIdxODL); + } } catch (Exception exc) { diff --git a/IOB-WIN/IobSiemensFape.cs b/IOB-WIN/IobSiemensFape.cs index 12594f50..5e633394 100644 --- a/IOB-WIN/IobSiemensFape.cs +++ b/IOB-WIN/IobSiemensFape.cs @@ -53,7 +53,7 @@ namespace IOB_WIN /// Posizione sequenza ciclo standard punzonatrice /// public enum posizioneSequenza - { + { CICLO_AUTOMATICO_FERMO = 0, CONTROLLO_MODO_OPERATIVO = 5, MODO_ATTIVO_CON_ROBOT = 8, @@ -87,7 +87,7 @@ namespace IOB_WIN public IobSiemensFape(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf) { // dovebbe fare init della classe base, VERIFICARE... - lgInfo("NEW IOB SIEMENS versione FAPE"); + lgInfo("NEW IOB SIEMENS versione FAPE"); } #endregion @@ -142,28 +142,28 @@ namespace IOB_WIN B_input = currPLC.IsConnected ? 1 : 0; // controllo stato macchina x impostare altri bit... switch (_stMacch) - { + { case statoMacchina.EMERGENZA_INSERITA: B_input += (1 << 5); break; - case statoMacchina.AVARIA_ARIA: + case statoMacchina.AVARIA_ARIA: case statoMacchina.AVARIA_PRESSIONE_OLIO: case statoMacchina.AVARIA_LIVELLO_OLIO: case statoMacchina.AVARIA_TEMPERATURA_OLIO: B_input += (1 << 3); B_input += (1 << 6); break; - case statoMacchina.AVARIA_MOTORE_POMPA_IDRAULICA: - case statoMacchina.AVARIA_MOTORE_RAFFREDDO_IDRAULICA: + case statoMacchina.AVARIA_MOTORE_POMPA_IDRAULICA: + case statoMacchina.AVARIA_MOTORE_RAFFREDDO_IDRAULICA: case statoMacchina.COMUNICAZIONE_ASSENTE: - case statoMacchina.AVARIA_SINCRONISMO_PORTE: + case statoMacchina.AVARIA_SINCRONISMO_PORTE: case statoMacchina.AVARIA_LIBERA: case statoMacchina.ATTIVAZIONE_IN_CORSO: B_input += (1 << 3); break; case statoMacchina.MODO_MANUALE_ATTREZZAGGIO: B_input += (1 << 4); - break; + break; case statoMacchina.CICLO_IN_CORSO: B_input += (1 << 1); break; @@ -171,18 +171,29 @@ namespace IOB_WIN case statoMacchina.MODO_AUTOMATICO_ROBOT: B_input += (1 << 7); break; - case statoMacchina.LIBERO: + case statoMacchina.LIBERO: default: break; - } + } string currODL = ""; try { currODL = utils.callUrl(urlGetCurrODL); - lgInfo(string.Format("Lettura ODL, {0} --> {1}", currIdxODL, currODL)); - // provo a salvare nuovo ODL - int.TryParse(currODL, out currIdxODL); + // solo SE HO un ODL... + if (currODL == "" || currODL == "0") + { + if (periodicLog) + { + lgInfo(string.Format("SiemensFape | Lettura ODL andata a vuoto: currODL: {0}", currODL)); + } + } + else + { + lgInfo(string.Format("SiemensFape | Lettura ODL, currODL{0} --> currIdxODL prec: {1}", currODL, currIdxODL)); + // provo a salvare nuovo ODL + int.TryParse(currODL, out currIdxODL); + } } catch (Exception exc) { @@ -208,7 +219,7 @@ namespace IOB_WIN } // registro contapezzi lgInfo(string.Format("Contapezzi SIEMENS: {0} | Contapezzi interno {1}", lastCountCNC, contapezzi)); - + // invio a server contapezzi (aggiornato) string retVal = utils.callUrl(urlSetPzCount + contapezzi.ToString()); // verifica se tutto OK diff --git a/IOB-WIN/IobSiemensTorri.cs b/IOB-WIN/IobSiemensTorri.cs index 886876a9..fac07cb4 100644 --- a/IOB-WIN/IobSiemensTorri.cs +++ b/IOB-WIN/IobSiemensTorri.cs @@ -686,9 +686,20 @@ namespace IOB_WIN try { currODL = utils.callUrl(urlGetCurrODL); - lgInfo(string.Format("Lettura ODL, {0} --> {1}", currIdxODL, currODL)); - // provo a salvare nuovo ODL - int.TryParse(currODL, out currIdxODL); + // solo SE HO un ODL... + if (currODL == "" || currODL == "0") + { + if (periodicLog) + { + lgInfo(string.Format("SiemensTorri | Lettura ODL andata a vuoto: currODL: {0}", currODL)); + } + } + else + { + lgInfo(string.Format("SiemensTorri | Lettura ODL, currODL{0} --> currIdxODL prec: {1}", currODL, currIdxODL)); + // provo a salvare nuovo ODL + int.TryParse(currODL, out currIdxODL); + } } catch (Exception exc) {