Gestione sincronismo siemens

This commit is contained in:
ext_luca.pansa@cms.it
2021-02-19 16:36:52 +01:00
parent 6ea23a2619
commit e611f6b9e8
+44
View File
@@ -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)