public List <Model.PSData> GetPSList() { if (objPSDaoService == null) { objPSDaoService = new PSDaoImp(); } return(objPSDaoService.GetPSList()); }
public bool UpdateMachineValues() { objPSDaoService = new PSDaoImp(); List <Model.PSData> psList; bool result; int dataValue; bool dataValueInBool; try { psList = objPSDaoService.GetPSList(); using (OpcOperationsService opcd = new OpcOperationsImp(OpcConnection.GetOPCServerConnection())) { foreach (Model.PSData objPSData in psList) { if (opcd.IsMachineHealthy(objPSData.machineChannel + "." + objPSData.machineCode + "." + OpcTags.PS_Auto_Mode) == true) { dataValue = opcd.ReadTag <Int16>(objPSData.machineChannel, objPSData.machineCode, OpcTags.PS_Shuttle_Aisle_Position_for_L2); if (dataValue > 0) { UpdatePSIntData(objPSData.machineCode, OpcTags.PS_Shuttle_Aisle_Position_for_L2, dataValue); } dataValue = opcd.ReadTag <Int16>(objPSData.machineChannel, objPSData.machineCode, OpcTags.PS_L2_Max_Window_Limit); if (dataValue > 0) { UpdatePSIntData(objPSData.machineCode, OpcTags.PS_L2_Max_Window_Limit, dataValue); } dataValue = opcd.ReadTag <Int16>(objPSData.machineChannel, objPSData.machineCode, OpcTags.PS_L2_Min_Window_Limit); if (dataValue > 0) { UpdatePSIntData(objPSData.machineCode, OpcTags.PS_L2_Min_Window_Limit, dataValue); } } } } result = true; } catch (Exception errMsg) { result = false; Console.WriteLine(errMsg.Message); } return(result); }