# HG changeset patch # User Edouard Tisserant # Date 1555590763 -7200 # Node ID 19dc6b830e7d48ec8360c04e98555d6d1f47626b # Parent 9c5b20dc2b2e75f60b86e800af6e362606efd47d If call to GetPLCstatus can't be executed in PLC, then obtained status is disconnected. Status on "None" is not relevant anymore, and is replaced by Disconnected. diff -r 9c5b20dc2b2e -r 19dc6b830e7d ProjectController.py --- a/ProjectController.py Thu Apr 18 14:29:55 2019 +0200 +++ b/ProjectController.py Thu Apr 18 14:32:43 2019 +0200 @@ -1446,13 +1446,13 @@ def UpdateMethodsFromPLCStatus(self): updated = False - status = None + status = PlcStatus.Disconnected if self._connector is not None: PLCstatus = self._connector.GetPLCstatus() if PLCstatus is not None: status, log_count = PLCstatus self.UpdatePLCLog(log_count) - if status is None: + if status == PlcStatus.Disconnected: self._SetConnector(None, False) status = PlcStatus.Disconnected if self.previous_plcstate != status: diff -r 9c5b20dc2b2e -r 19dc6b830e7d runtime/PLCObject.py --- a/runtime/PLCObject.py Thu Apr 18 14:29:55 2019 +0200 +++ b/runtime/PLCObject.py Thu Apr 18 14:32:43 2019 +0200 @@ -477,8 +477,14 @@ return True return False - @RunInMain def GetPLCstatus(self): + try: + return self._GetPLCstatus() + except EOFError: + return (PlcStatus.Disconnected, None) + + @RunInMain + def _GetPLCstatus(self): return self.PLCStatus, map(self.GetLogCount, xrange(LogLevelsCount)) @RunInMain