diff --git a/CMS_CORE_Library/Siemens/Nc_Siemens.cs b/CMS_CORE_Library/Siemens/Nc_Siemens.cs index 1f915e9..e62729f 100644 --- a/CMS_CORE_Library/Siemens/Nc_Siemens.cs +++ b/CMS_CORE_Library/Siemens/Nc_Siemens.cs @@ -4627,6 +4627,28 @@ namespace CMS_CORE_Library.Siemens return ManageException(ex); } + Thread.Sleep(100); + int response = -1; + + try + { + //Devo verificare che funzioni correttamente + DataSvc dataSvc = new DataSvc(); + //Read Machine status + Item itemToRead = new Item("/Channel/State/aTcStatus[u1, 1]"); + dataSvc.Read(itemToRead); + response = Convert.ToInt32(itemToRead.Value); + } + catch (Exception ex) + { + return ManageException(ex); + } + // 1 OK 3 ABORTED + if (response != 1 && response != 0) + { + return MAGAZINE_BUSY_ERROR; + } + // Mount temporarily till the Siemens notification arrives MoveToolInMagazineList(newMagazineTool.ToolId, magazineId, newMagazineTool.PositionId); @@ -4679,6 +4701,28 @@ namespace CMS_CORE_Library.Siemens return ManageException(ex); } + Thread.Sleep(100); + int response = -1; + + try + { + //Devo verificare che funzioni correttamente + DataSvc dataSvc = new DataSvc(); + //Read Machine status + Item itemToRead = new Item("/Channel/State/aTcStatus[u1, 1]"); + dataSvc.Read(itemToRead); + response = Convert.ToInt32(itemToRead.Value); + } + catch(Exception ex) + { + return ManageException(ex); + } + // 1 OK 3 ABORTED + if(response != 1 && response != 0) + { + return MAGAZINE_BUSY_ERROR; + } + //// Smount temporarily till the Siemens notification arrives int magPosIndex = MagazineMountedTools.FindIndex(x => x.MagazineId == magazineId && x.PositionId == positionId); if (magPosIndex >= 0)