From a7605d8aec1bc0134754fa030369c4ea474f0d43 Mon Sep 17 00:00:00 2001 From: "ext_luca.pansa@cms.it" Date: Wed, 23 Dec 2020 16:42:44 +0100 Subject: [PATCH] LP Modifiche a M156 (Fanuc) e Siemens aree di memoria errate per balluf. --- CMS_CORE_Library/Fanuc/Nc_Fanuc.cs | 4 +-- CMS_CORE_Library/Siemens/Nc_Siemens.cs | 30 +++++++++++++++---- .../Siemens/SiemensEdgesConfigurations.cs | 3 +- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs b/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs index 8d10466..7541212 100644 --- a/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs +++ b/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs @@ -1119,9 +1119,9 @@ namespace CMS_CORE_Library.Fanuc if (bits[processId - 1]) { double responseVal = 0; - // Read machine variable + // Read machine variable Geferson 23/12/2020 si legge sempre dalla M155 cmsError = - ReadMacroValue((int)processId, M156_RESPONSE_MEMORY, true, ref responseVal); + ReadMacroValue((int)processId, M155_RESPONSE_MEMORY, true, ref responseVal); if (cmsError.IsError()) return cmsError; diff --git a/CMS_CORE_Library/Siemens/Nc_Siemens.cs b/CMS_CORE_Library/Siemens/Nc_Siemens.cs index 63cb502..bcbc38a 100644 --- a/CMS_CORE_Library/Siemens/Nc_Siemens.cs +++ b/CMS_CORE_Library/Siemens/Nc_Siemens.cs @@ -4776,7 +4776,9 @@ namespace CMS_CORE_Library.Siemens bitArray.CopyTo(statusArray, 0); // Setup dimensions byte ( byte is formed by nibble => left_size right_size 0001 0001 ) - ushort dimensions = (ushort)((((tool.LeftSize << 4) + tool.RightSize) << 8) + 17); // 17 = 0001 0001 -> + //scambio left e right + //ushort dimensions = (ushort)((((tool.LeftSize << 4) + tool.RightSize) << 8) + 17); // 17 = 0001 0001 -> + ushort dimensions = (ushort)((((tool.RightSize << 4) + tool.LeftSize) << 8) + 17); // 17 = 0001 0001 -> var maxSpeed = GetSiemensFormattedDouble(tool.MaxSpeed); @@ -4796,6 +4798,8 @@ namespace CMS_CORE_Library.Siemens new Item(){ Path = string.Format("DB{0}.DBD54", BALLUF_EMPTY_TABLE.Address), Value = tool.MaxLoadPctAutoload }, new Item(){ Path = string.Format("DB{0}.DBD58", BALLUF_EMPTY_TABLE.Address), Value = tool.MinLoadPctAutoload }, new Item(){ Path = string.Format("DB{0}.DBD62", BALLUF_EMPTY_TABLE.Address), Value = tool.ToolTypeCode }, + //new Item(){ Path = string.Format("DB{0}.DBD58", BALLUF_EMPTY_TABLE.Address), Value = tool.Cooling1 }, + //new Item(){ Path = string.Format("DB{0}.DBD62", BALLUF_EMPTY_TABLE.Address), Value = tool.Cooling2 }, //new Item(){ Path = string.Format("DB{0}.DBB64:STRING", BALLUF_EMPTY_TABLE.Address), Value = tool.FamilyName }, new Item(){ Path = string.Format("DB{0}.DBW70", BALLUF_EMPTY_TABLE.Address), Value = 1 }, @@ -4805,6 +4809,7 @@ namespace CMS_CORE_Library.Siemens new Item(){ Path = string.Format("DB{0}.DBW88", BALLUF_EMPTY_TABLE.Address), Value = 9 }, }; + EdgeModel edge = tool.EdgesData[0]; SiemensEdgesConfiguration toolEdgesConfig = new SiemensEdgesConfiguration(); @@ -4815,12 +4820,25 @@ namespace CMS_CORE_Library.Siemens { if (edge.EdgeAdditionalParams.ContainsKey(conf.Name) && toolEdgesConfig.TDIEdgeFields.ContainsKey(conf.Path)) { - var formattedValue = GetSiemensFormattedDouble(edge.EdgeAdditionalParams[conf.Name]); - items.Add(new Item() + if(conf.Name == "teeth") { - Path = string.Format(toolEdgesConfig.TDIEdgeFields[conf.Path], BALLUF_EMPTY_TABLE.Address), - Value = formattedValue - }); + UInt16 formattedValue =Convert.ToUInt16(edge.EdgeAdditionalParams[conf.Name]); + items.Add(new Item() + { + Path = string.Format(toolEdgesConfig.TDIEdgeFields[conf.Path], BALLUF_EMPTY_TABLE.Address), + Value = formattedValue + }); + + } + else + { + var formattedValue = GetSiemensFormattedDouble(edge.EdgeAdditionalParams[conf.Name]); + items.Add(new Item() + { + Path = string.Format(toolEdgesConfig.TDIEdgeFields[conf.Path], BALLUF_EMPTY_TABLE.Address), + Value = formattedValue + }); + } } } diff --git a/CMS_CORE_Library/Siemens/SiemensEdgesConfigurations.cs b/CMS_CORE_Library/Siemens/SiemensEdgesConfigurations.cs index bdadfd9..b9cc350 100644 --- a/CMS_CORE_Library/Siemens/SiemensEdgesConfigurations.cs +++ b/CMS_CORE_Library/Siemens/SiemensEdgesConfigurations.cs @@ -473,7 +473,8 @@ namespace CMS_CORE_Library.Siemens { "$TC_DP22[", "DB{0}.DBD" + (ADDITIONAL_PARAMS_START_INDEX + 76)}, { "$TC_DP23[", "DB{0}.DBD" + (ADDITIONAL_PARAMS_START_INDEX + 80)}, { "$TC_DP24[", "DB{0}.DBD" + (ADDITIONAL_PARAMS_START_INDEX + 84)}, - { "$TC_DP25[", "DB{0}.DBD" + (ADDITIONAL_PARAMS_START_INDEX + 88)} + { "$TC_DP25[", "DB{0}.DBD" + (ADDITIONAL_PARAMS_START_INDEX + 88)}, + { "$TC_DPNT[", "DB{0}.DBW212"} }; } } \ No newline at end of file