Fixed problem with first PLC argument (argv)
authoretisserant
Mon, 25 Aug 2008 18:01:01 +0200
changeset 219 43d65f0179e2
parent 218 71fddab24be9
child 220 ad3292145fc2
Fixed problem with first PLC argument (argv)
runtime/PLCObject.py
--- a/runtime/PLCObject.py	Fri Aug 22 15:35:11 2008 +0200
+++ b/runtime/PLCObject.py	Mon Aug 25 18:01:01 2008 +0200
@@ -42,7 +42,7 @@
 class PLCObject(pyro.ObjBase):
     def __init__(self, workingdir, daemon, argv):
         pyro.ObjBase.__init__(self)
-        self.argv=argv
+        self.argv = [workingdir] + argv # force argv[0] to be "path" to exec...
         self.workingdir = workingdir
         self.PLCStatus = "Stopped"
         self.PLClibraryHandle = None
@@ -151,7 +151,7 @@
     def StartPLC(self):
         print "StartPLC"
         if self.CurrentPLCFilename is not None and self.PLCStatus == "Stopped":
-            c_argv = ctypes.c_char_p * len(sys.argv)
+            c_argv = ctypes.c_char_p * len(self.argv)
             if self._LoadNewPLC() and self._startPLC(len(self.argv),c_argv(*self.argv)) == 0:
                 self.PLCStatus = "Started"
                 return True