diff --git a/CMS_CORE_Application/Form1.cs b/CMS_CORE_Application/Form1.cs index 964c137..744dcf9 100644 --- a/CMS_CORE_Application/Form1.cs +++ b/CMS_CORE_Application/Form1.cs @@ -82,7 +82,7 @@ namespace CMS_CORE_Application N.NC_RProcessesNum(ref procnum); N.NC_RMachineNumber(ref MachNumber); bool error = false; - + string serial = ""; while (true) { cmsError = N.PROC_RMode(1, ref mode); @@ -121,29 +121,16 @@ namespace CMS_CORE_Application error = true; SetError(Lines, cmsError); } - sw.Stop(); cmsError = N.NC_RDateTime(ref NcTime); if (cmsError.IsError()) { error = true; SetError(Lines, cmsError); } - List a = null; - cmsError = N.PLC_RFunctionAccess(ref a); - - PreAndPostPowerOnModel preAndPostPowerOnModel = new PreAndPostPowerOnModel(); - - N.PLC_RAxesResetData(ref axisResetDataModel); - - cmsError = N.PLC_RPowerOnData(ref preAndPostPowerOnModel); - if (cmsError.IsError()) - { - error = true; - SetError(Lines, cmsError); - } - - cmsError = N.PLC_RMachineCounters(ref counters); + cmsError = N.NC_RSerialNumber(ref serial); + sw.Stop(); + if (!this.IsDisposed && this.InvokeRequired) { this.Invoke((ThreadStart)delegate () @@ -301,6 +288,7 @@ namespace CMS_CORE_Application }); } } + private Nc SetNcByType() { if (NCType == "Siemens") diff --git a/CMS_CORE_Library/DataStructures.cs b/CMS_CORE_Library/DataStructures.cs index f05a67e..3ec4f91 100644 --- a/CMS_CORE_Library/DataStructures.cs +++ b/CMS_CORE_Library/DataStructures.cs @@ -92,7 +92,6 @@ namespace CMS_CORE_Library { AxisReset = new PowerOnDataModel(); WaterjetPump = new PowerOnDataModel(); - } public override bool Equals(object obj) diff --git a/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs b/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs index 6fbbb86..e4605a1 100644 --- a/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs +++ b/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs @@ -141,7 +141,7 @@ namespace CMS_CORE.Fanuc return cmsError; SN = Cnc_SeriesNum; - + return NO_ERROR; } @@ -1713,6 +1713,7 @@ namespace CMS_CORE.Fanuc short nReturn1, nReturn2; Focas1.ODBSYS node = new Focas1.ODBSYS(); + Focas1.ODBSYS tmpNode = new Focas1.ODBSYS(); Focas1.ODBSYSEX nodeex = new Focas1.ODBSYSEX(); ulong SerialNumber = 0; @@ -1725,7 +1726,8 @@ namespace CMS_CORE.Fanuc return cmsError; //Execute the method - nReturn1 = Focas1.cnc_sysinfo(nLibHandle[0], node); + nReturn1 = Focas1.cnc_sysinfo(nLibHandle[0], tmpNode); + node = tmpNode; nReturn2 = Focas1.cnc_rdcncid(nLibHandle[0], out SerialNumber); //Throw Exception if there's an error