Beremiz_service.py
branchsvghmi
changeset 3282 725d3e9ac913
parent 3248 ea93c14342d1
child 3307 eeec6e0ea269
child 3420 da8cceaa247d
--- a/Beremiz_service.py	Thu Jul 15 11:48:02 2021 +0200
+++ b/Beremiz_service.py	Thu Jul 15 11:50:44 2021 +0200
@@ -31,6 +31,7 @@
 import getopt
 import threading
 import shlex
+import traceback
 from threading import Thread, Semaphore, Lock, currentThread
 from builtins import str as text
 from past.builtins import execfile
@@ -614,8 +615,11 @@
 pyro_thread.join()
 
 plcobj = runtime.GetPLCObjectSingleton()
-plcobj.StopPLC()
-plcobj.UnLoadPLC()
+try:
+    plcobj.StopPLC()
+    plcobj.UnLoadPLC()
+except:
+    print(traceback.format_exc())
 
 if havetwisted:
     reactor.stop()