diff --git a/MTC_Adapter/MTC_Adapter/AdapterESA.cs b/MTC_Adapter/MTC_Adapter/AdapterESA.cs index 16afb2a..b7a6c7f 100644 --- a/MTC_Adapter/MTC_Adapter/AdapterESA.cs +++ b/MTC_Adapter/MTC_Adapter/AdapterESA.cs @@ -640,12 +640,19 @@ namespace MTC_Adapter try { numero = Convert.ToInt32(mapIOT_DWord[i].varName.Replace("IOT_C_KU_AX_", "")); - vettAxis[numero - 1].mAxDistDone.Value = ncDevice.PLC_MemoryAreaIOT_DWord[byteNum]; + // salvo in vettore SE possibile... + if (numero <= vettAxis.Length) + { + vettAxis[numero - 1].mAxDistDone.Value = ncDevice.PLC_MemoryAreaIOT_DWord[byteNum]; + } + else + { + lg.Error("Errore in inserimento vettore " + mapIOT_DWord[i].varName); + } } - catch + catch (Exception exc) { - // se non trovo --> 1! - numero = 1; + lg.Error(exc, "Errore in decodifica " + mapIOT_DWord[i].varName); } } else if (mapIOT_DWord[i].varName.StartsWith("IOT_C_KINV_AX_")) @@ -654,12 +661,19 @@ namespace MTC_Adapter try { numero = Convert.ToInt32(mapIOT_DWord[i].varName.Replace("IOT_C_KINV_AX_", "")); - vettAxis[numero - 1].mAxInvDDone.Value = ncDevice.PLC_MemoryAreaIOT_DWord[byteNum]; + // salvo in vettore SE possibile... + if (numero <= vettAxis.Length) + { + vettAxis[numero - 1].mAxInvDDone.Value = ncDevice.PLC_MemoryAreaIOT_DWord[byteNum]; + } + else + { + lg.Error("Errore in inserimento vettore " + mapIOT_DWord[i].varName); + } } - catch + catch (Exception exc) { - // se non trovo --> 1! - numero = 1; + lg.Error(exc, "Errore in decodifica " + mapIOT_DWord[i].varName); } } else if (mapIOT_DWord[i].varName.StartsWith("IOT_POS_AX_")) @@ -670,13 +684,20 @@ namespace MTC_Adapter numero = Convert.ToInt32(mapIOT_DWord[i].varName.Replace("IOT_POS_AX_", "")); // recupero valore pos assi (in micron) valDouble = (double)BitConverter.ToInt32(BitConverter.GetBytes(ncDevice.PLC_MemoryAreaIOT_DWord[byteNum]), 0); - // riporto il dato in mm (divido x 1000) - vettAxis[numero - 1].mAxPosAct.Value = valDouble / utils.CRI("fattdecimale"); + // salvo in vettore SE possibile... + if (numero <= vettAxis.Length) + { + // riporto il dato in mm (divido x 1000) + vettAxis[numero - 1].mAxPosAct.Value = valDouble / utils.CRI("fattdecimale"); + } + else + { + lg.Error("Errore in inserimento vettore " + mapIOT_DWord[i].varName); + } } - catch + catch (Exception exc) { - // se non trovo --> 1! - numero = 1; + lg.Error(exc, "Errore in decodifica " + mapIOT_DWord[i].varName); } } else if (mapIOT_DWord[i].varName.StartsWith("IOT_C_KREV_MD_")) @@ -685,12 +706,19 @@ namespace MTC_Adapter try { numero = Convert.ToInt32(mapIOT_DWord[i].varName.Replace("IOT_C_KREV_MD_", "")); - vettUnOp[numero - 1].mUnOpKRev.Value = ncDevice.PLC_MemoryAreaIOT_DWord[byteNum]; + // salvo in vettore SE possibile... + if (numero <= vettUnOp.Length) + { + vettUnOp[numero - 1].mUnOpKRev.Value = ncDevice.PLC_MemoryAreaIOT_DWord[byteNum]; + } + else + { + lg.Error("Errore in inserimento vettore " + mapIOT_DWord[i].varName); + } } - catch + catch (Exception exc) { - // se non trovo --> 1! - numero = 1; + lg.Error(exc, "Errore in decodifica " + mapIOT_DWord[i].varName); } } else if (mapIOT_DWord[i].varName.StartsWith("IOT_PLC_MSG_")) @@ -702,10 +730,9 @@ namespace MTC_Adapter // copio allarmi in vettore generale AlarmFlags (dove lo gestisce) 4 byte alla volta Buffer.BlockCopy(BitConverter.GetBytes(ncDevice.PLC_MemoryAreaIOT_DWord[byteNum]), 0, AlarmFlags, numero * 4, 4); } - catch + catch (Exception exc) { - // se non trovo --> 1! - numero = 1; + lg.Error(exc, "Errore in decodifica " + mapIOT_DWord[i].varName); } } } diff --git a/MTC_Adapter/MTC_Adapter/DATA/CONF/AlarmList.map b/MTC_Adapter/MTC_Adapter/DATA/CONF/AlarmList.map index 27dfc39..22ee9b1 100644 --- a/MTC_Adapter/MTC_Adapter/DATA/CONF/AlarmList.map +++ b/MTC_Adapter/MTC_Adapter/DATA/CONF/AlarmList.map @@ -338,4 +338,84 @@ 0000337|PLC|FAULT|[337] MOVIMENTO ASSI X BLOCCATO DA PINZA APERTA E TESTE BASSE 0000338|PLC|FAULT|[338] MOVIMENTO ASSI U BLOCCATO DA PINZA APERTA E TESTE BASSE 0000339|PLC|FAULT|[339] MOVIMENTO ASSI YZ BLOCCATO DA PINZE APERTE -0000340|PLC|FAULT|[340] MOVIMENTO ASSI VW BLOCCATO DA PINZE APERTE \ No newline at end of file +0000340|PLC|FAULT|[340] MOVIMENTO ASSI VW BLOCCATO DA PINZE APERTE +0000341|PLC|FAULT|[341] +0000342|PLC|FAULT|[342] +0000343|PLC|FAULT|[343] +0000344|PLC|FAULT|[344] +0000345|PLC|FAULT|[345] +0000346|PLC|FAULT|[346] +0000347|PLC|FAULT|[347] +0000348|PLC|FAULT|[348] +0000349|PLC|FAULT|[349] +0000350|PLC|FAULT|[350] +0000351|PLC|FAULT|[351] +0000352|PLC|FAULT|[352] +0000353|PLC|FAULT|[353] +0000354|PLC|FAULT|[354] +0000355|PLC|FAULT|[355] +0000356|PLC|FAULT|[356] +0000357|PLC|FAULT|[357] +0000358|PLC|FAULT|[358] +0000359|PLC|FAULT|[359] +0000360|PLC|FAULT|[360] +0000361|PLC|FAULT|[361] +0000362|PLC|FAULT|[362] +0000363|PLC|FAULT|[363] +0000364|PLC|FAULT|[364] +0000365|PLC|FAULT|[365] +0000366|PLC|FAULT|[366] +0000367|PLC|FAULT|[367] +0000368|PLC|FAULT|[368] +0000369|PLC|FAULT|[369] +0000370|PLC|FAULT|[370] +0000371|PLC|FAULT|[371] +0000372|PLC|FAULT|[372] +0000373|PLC|FAULT|[373] +0000374|PLC|FAULT|[374] +0000375|PLC|FAULT|[375] +0000376|PLC|FAULT|[376] +0000377|PLC|FAULT|[377] +0000378|PLC|FAULT|[378] +0000379|PLC|FAULT|[379] +0000380|PLC|FAULT|[380] +0000381|PLC|FAULT|[381] +0000382|PLC|FAULT|[382] +0000383|PLC|FAULT|[383] +0000384|PLC|FAULT|[384] +0000385|PLC|FAULT|[385] +0000386|PLC|FAULT|[386] +0000387|PLC|FAULT|[387] +0000388|PLC|FAULT|[388] +0000389|PLC|FAULT|[389] +0000390|PLC|FAULT|[390] +0000391|PLC|FAULT|[391] +0000392|PLC|FAULT|[392] +0000393|PLC|FAULT|[393] +0000394|PLC|FAULT|[394] +0000395|PLC|FAULT|[395] +0000396|PLC|FAULT|[396] +0000397|PLC|FAULT|[397] +0000398|PLC|FAULT|[398] +0000399|PLC|FAULT|[399] +0000400|PLC|FAULT|[400] +0000401|PLC|FAULT|[401] +0000402|PLC|FAULT|[402] +0000403|PLC|FAULT|[403] +0000404|PLC|FAULT|[404] +0000405|PLC|FAULT|[405] +0000406|PLC|FAULT|[406] +0000407|PLC|FAULT|[407] +0000408|PLC|FAULT|[408] +0000409|PLC|FAULT|[409] +0000410|PLC|FAULT|[410] +0000411|PLC|FAULT|[411] +0000412|PLC|FAULT|[412] +0000413|PLC|FAULT|[413] +0000414|PLC|FAULT|[414] +0000415|PLC|FAULT|[415] +0000416|PLC|FAULT|[416] +0000417|PLC|FAULT|[417] +0000418|PLC|FAULT|[418] +0000419|PLC|FAULT|[419] +0000420|PLC|FAULT|[420] \ No newline at end of file diff --git a/MTC_Adapter/MTC_Adapter/Resources/SCM/AlarmListEsaGv.map b/MTC_Adapter/MTC_Adapter/Resources/SCM/AlarmListEsaGv.map index 6f5620f..22ee9b1 100644 --- a/MTC_Adapter/MTC_Adapter/Resources/SCM/AlarmListEsaGv.map +++ b/MTC_Adapter/MTC_Adapter/Resources/SCM/AlarmListEsaGv.map @@ -1,3 +1,4 @@ +# Commenti con "#", elenco tipo COD_NUM|GRUPPO|LEVEL|DESCRIZIONE completa 000001|PLC|FAULT|[1] MANDRINO 1 NON BLOCCATO 000002|PLC|FAULT|[2] MANDRINO 2 NON BLOCCATO 000003|PLC|FAULT|[3] MANDRINO SUPPLEMENTARE NON BLOCCATO @@ -338,3 +339,83 @@ 0000338|PLC|FAULT|[338] MOVIMENTO ASSI U BLOCCATO DA PINZA APERTA E TESTE BASSE 0000339|PLC|FAULT|[339] MOVIMENTO ASSI YZ BLOCCATO DA PINZE APERTE 0000340|PLC|FAULT|[340] MOVIMENTO ASSI VW BLOCCATO DA PINZE APERTE +0000341|PLC|FAULT|[341] +0000342|PLC|FAULT|[342] +0000343|PLC|FAULT|[343] +0000344|PLC|FAULT|[344] +0000345|PLC|FAULT|[345] +0000346|PLC|FAULT|[346] +0000347|PLC|FAULT|[347] +0000348|PLC|FAULT|[348] +0000349|PLC|FAULT|[349] +0000350|PLC|FAULT|[350] +0000351|PLC|FAULT|[351] +0000352|PLC|FAULT|[352] +0000353|PLC|FAULT|[353] +0000354|PLC|FAULT|[354] +0000355|PLC|FAULT|[355] +0000356|PLC|FAULT|[356] +0000357|PLC|FAULT|[357] +0000358|PLC|FAULT|[358] +0000359|PLC|FAULT|[359] +0000360|PLC|FAULT|[360] +0000361|PLC|FAULT|[361] +0000362|PLC|FAULT|[362] +0000363|PLC|FAULT|[363] +0000364|PLC|FAULT|[364] +0000365|PLC|FAULT|[365] +0000366|PLC|FAULT|[366] +0000367|PLC|FAULT|[367] +0000368|PLC|FAULT|[368] +0000369|PLC|FAULT|[369] +0000370|PLC|FAULT|[370] +0000371|PLC|FAULT|[371] +0000372|PLC|FAULT|[372] +0000373|PLC|FAULT|[373] +0000374|PLC|FAULT|[374] +0000375|PLC|FAULT|[375] +0000376|PLC|FAULT|[376] +0000377|PLC|FAULT|[377] +0000378|PLC|FAULT|[378] +0000379|PLC|FAULT|[379] +0000380|PLC|FAULT|[380] +0000381|PLC|FAULT|[381] +0000382|PLC|FAULT|[382] +0000383|PLC|FAULT|[383] +0000384|PLC|FAULT|[384] +0000385|PLC|FAULT|[385] +0000386|PLC|FAULT|[386] +0000387|PLC|FAULT|[387] +0000388|PLC|FAULT|[388] +0000389|PLC|FAULT|[389] +0000390|PLC|FAULT|[390] +0000391|PLC|FAULT|[391] +0000392|PLC|FAULT|[392] +0000393|PLC|FAULT|[393] +0000394|PLC|FAULT|[394] +0000395|PLC|FAULT|[395] +0000396|PLC|FAULT|[396] +0000397|PLC|FAULT|[397] +0000398|PLC|FAULT|[398] +0000399|PLC|FAULT|[399] +0000400|PLC|FAULT|[400] +0000401|PLC|FAULT|[401] +0000402|PLC|FAULT|[402] +0000403|PLC|FAULT|[403] +0000404|PLC|FAULT|[404] +0000405|PLC|FAULT|[405] +0000406|PLC|FAULT|[406] +0000407|PLC|FAULT|[407] +0000408|PLC|FAULT|[408] +0000409|PLC|FAULT|[409] +0000410|PLC|FAULT|[410] +0000411|PLC|FAULT|[411] +0000412|PLC|FAULT|[412] +0000413|PLC|FAULT|[413] +0000414|PLC|FAULT|[414] +0000415|PLC|FAULT|[415] +0000416|PLC|FAULT|[416] +0000417|PLC|FAULT|[417] +0000418|PLC|FAULT|[418] +0000419|PLC|FAULT|[419] +0000420|PLC|FAULT|[420] \ No newline at end of file