always load existing PLC program from the working directory
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 07 Dec 2016 19:25:58 +0300
changeset 1597 0e4182e9cc09
parent 1596 f5868f866d2b
child 1598 1445457547f7
always load existing PLC program from the working directory
Beremiz_service.py
--- a/Beremiz_service.py	Wed Dec 07 19:24:16 2016 +0300
+++ b/Beremiz_service.py	Wed Dec 07 19:25:58 2016 +0300
@@ -441,9 +441,9 @@
             self.servicepublisher = ServicePublisher.ServicePublisher()
             self.servicepublisher.RegisterService(self.servicename, self.ip_addr, self.port)
 
-        if self.autostart :
-            self.plcobj.AutoLoad()
-            if self.plcobj.GetPLCstatus()[0] != "Empty":
+        self.plcobj.AutoLoad()
+        if self.plcobj.GetPLCstatus()[0] != "Empty":
+            if self.autostart :
                 self.plcobj.StartPLC()
 
         sys.stdout.flush()