equal
deleted
inserted
replaced
137 return os.path.join(self.workingdir, "lasttransferedPLC.md5") |
137 return os.path.join(self.workingdir, "lasttransferedPLC.md5") |
138 |
138 |
139 def _GetLibFileName(self): |
139 def _GetLibFileName(self): |
140 return os.path.join(self.workingdir, self.CurrentPLCFilename) |
140 return os.path.join(self.workingdir, self.CurrentPLCFilename) |
141 |
141 |
142 |
|
143 def LoadPLC(self): |
142 def LoadPLC(self): |
144 """ |
143 """ |
145 Load PLC library |
144 Load PLC library |
146 Declare all functions, arguments and return values |
145 Declare all functions, arguments and return values |
147 """ |
146 """ |
179 |
178 |
180 def __StopPLC(): |
179 def __StopPLC(): |
181 self._stopPLC_real() |
180 self._stopPLC_real() |
182 self.PlcStopping.set() |
181 self.PlcStopping.set() |
183 self._stopPLC = __StopPLC |
182 self._stopPLC = __StopPLC |
184 |
|
185 |
183 |
186 self._ResetDebugVariables = self.PLClibraryHandle.ResetDebugVariables |
184 self._ResetDebugVariables = self.PLClibraryHandle.ResetDebugVariables |
187 self._ResetDebugVariables.restype = None |
185 self._ResetDebugVariables.restype = None |
188 |
186 |
189 self._RegisterDebugVariable = self.PLClibraryHandle.RegisterDebugVariable |
187 self._RegisterDebugVariable = self.PLClibraryHandle.RegisterDebugVariable |
319 except: |
317 except: |
320 self.LogMessage(0, traceback.format_exc()) |
318 self.LogMessage(0, traceback.format_exc()) |
321 raise |
319 raise |
322 |
320 |
323 self.PythonRuntimeCall("init") |
321 self.PythonRuntimeCall("init") |
324 |
|
325 |
|
326 |
322 |
327 def PythonRuntimeCleanup(self): |
323 def PythonRuntimeCleanup(self): |
328 if self.python_runtime_vars is not None: |
324 if self.python_runtime_vars is not None: |
329 self.PythonRuntimeCall("cleanup") |
325 self.PythonRuntimeCall("cleanup") |
330 |
326 |
552 if TraceBuffer is not None: |
548 if TraceBuffer is not None: |
553 self._TracesPush((tick.value, TraceBuffer)) |
549 self._TracesPush((tick.value, TraceBuffer)) |
554 self._TracesAutoSuspend() |
550 self._TracesAutoSuspend() |
555 self._TracesFlush() |
551 self._TracesFlush() |
556 |
552 |
557 |
|
558 def RemoteExec(self, script, *kwargs): |
553 def RemoteExec(self, script, *kwargs): |
559 try: |
554 try: |
560 exec script in kwargs |
555 exec script in kwargs |
561 except: |
556 except: |
562 e_type, e_value, e_traceback = sys.exc_info() |
557 e_type, e_value, e_traceback = sys.exc_info() |