diff --git a/IOB-WIN-NEXT/DATA/CONF/1032.json b/IOB-WIN-NEXT/DATA/CONF/1032.json index 0aed3c23..674a4cff 100644 --- a/IOB-WIN-NEXT/DATA/CONF/1032.json +++ b/IOB-WIN-NEXT/DATA/CONF/1032.json @@ -56,12 +56,23 @@ "period": 60, "factor": 10 }, + "Contatore01": { + "name": "Contatore01", + "description": "Contapezzi 01", + "memAddr": "DB6.DBB200", + "tipoMem": "DInt", + "index": 200, + "size": 4, + "func": "MAX", + "period": 60, + "factor": 1 + }, "ContatoreParziale": { "name": "ContatoreParziale", - "description": "Contapezzi Parziale", + "description": "Contapezzi Parziale2", "memAddr": "DB6.DBB208", "tipoMem": "DInt", - "index": 4, + "index": 208, "size": 4, "func": "MAX", "period": 60, diff --git a/IOB-WIN-NEXT/IobSiemens.cs b/IOB-WIN-NEXT/IobSiemens.cs index 13be7d90..a1dadc94 100644 --- a/IOB-WIN-NEXT/IobSiemens.cs +++ b/IOB-WIN-NEXT/IobSiemens.cs @@ -521,6 +521,8 @@ namespace IOB_WIN_NEXT /// protected override void setParamPlc() { + // carico conf vettore memoria... + loadMemConf(); // Creo oggetto connessione NC parentForm.commPlcActive = true; lgInfo("Start init Adapter SIEMENS all'IP {0} | CPU: {1} | R/S: {2}/{3} | --> IOB {4}", cIobConf.cncIpAddr, cIobConf.cpuType, cIobConf.rack, cIobConf.slot, cIobConf.codIOB); @@ -590,8 +592,10 @@ namespace IOB_WIN_NEXT lgError($"Errore in ping: esito {esitoPing}"); } parentForm.commPlcActive = false; +#if false // carico conf vettore memoria... loadMemConf(); +#endif bool enableByApp = utils.CRB("enableContapezzi"); bool enableByIob = (getOptPar("ENABLE_PZCOUNT") == "TRUE"); diff --git a/IOB-WIN-NEXT/IobSiemensComeca.cs b/IOB-WIN-NEXT/IobSiemensComeca.cs index 41667abd..1e97cb6c 100644 --- a/IOB-WIN-NEXT/IobSiemensComeca.cs +++ b/IOB-WIN-NEXT/IobSiemensComeca.cs @@ -147,6 +147,7 @@ namespace IOB_WIN_NEXT /// public override Dictionary executeTasks(Dictionary task2exe) { + lgInfo($"Chiamata executeTasks specifica IobSiemensComeca: {task2exe.Count} task ricevuti"); // Verificare il protocollo: dovrebeb togliere SOLO i task eseguiti... Dictionary taskDone = new Dictionary(); bool taskOk = false; diff --git a/IOB-WIN-NEXT/IobSiemensCosmap.cs b/IOB-WIN-NEXT/IobSiemensCosmap.cs index a16dd9a5..a48ad958 100644 --- a/IOB-WIN-NEXT/IobSiemensCosmap.cs +++ b/IOB-WIN-NEXT/IobSiemensCosmap.cs @@ -139,6 +139,7 @@ namespace IOB_WIN_NEXT /// public override Dictionary executeTasks(Dictionary task2exe) { + lgInfo($"Chiamata executeTasks specifica IobSiemensComeca: {task2exe.Count} task ricevuti"); // Verificare il protocollo: dovrebeb togliere SOLO i task eseguiti... Dictionary taskDone = new Dictionary(); bool taskOk = false; @@ -196,27 +197,31 @@ namespace IOB_WIN_NEXT MemBlock = S7.Net.Types.Int.ToByteArray(valInt); } } + else + { + lgError($"Errore: non trovata chiave write in memMap.mMapWrite per {item.Key}"); + } taskVal = item.Value; break; case taskType.forceResetPzCount: // processo scrittura BIT su DB6.DBDW216 - MemBlock = new byte[1]; - MemBlock[0] = (byte)1; + MemBlock = new byte[4]; + MemBlock = S7.Net.Types.DInt.ToByteArray(1); memAddrWrite = "DB6.DBDW216"; break; case taskType.startSetup: // processo scrittura BIT su DB6.DBDW216 - MemBlock = new byte[1]; - MemBlock[0] = (byte)1; + MemBlock = new byte[4]; + MemBlock = S7.Net.Types.DInt.ToByteArray(1); memAddrWrite = "DB6.DBDW216"; break; case taskType.stopSetup: // processo scrittura BIT su DB6.DBDW216 - MemBlock = new byte[1]; - MemBlock[0] = (byte)0; + MemBlock = new byte[4]; + MemBlock = S7.Net.Types.DInt.ToByteArray(0); memAddrWrite = "DB6.DBDW216"; break;