Bugs on ST generation fixed
authorlbessard
Tue, 10 Jul 2007 19:19:54 +0200
changeset 34 ad3fa2752106
parent 33 0dd4a876392f
child 35 d0ee8397dc4c
Bugs on ST generation fixed
PLCControler.py
--- a/PLCControler.py	Tue Jul 10 19:09:28 2007 +0200
+++ b/PLCControler.py	Tue Jul 10 19:19:54 2007 +0200
@@ -552,12 +552,14 @@
     
     # Extract varlists from a list of vars
     def ExtractVarLists(self, vars):
+        print "extract varlist"
         varlist_list = []
         current_varlist = None
         current_type = None
         for var in vars:
-            if current_type != (var["Class"], var["Retain"], var["Constant"], var["Location"] != ""):
-                current_type = (var["Class"], var["Retain"], var["Constant"], var["Location"] != "")
+            print var["Class"], var["Retain"], var["Constant"], var["Location"]
+            if current_type != (var["Class"], var["Retain"], var["Constant"], var["Location"] in ["", None]):
+                current_type = (var["Class"], var["Retain"], var["Constant"], var["Location"] in ["", None])
                 current_varlist = plcopen.varList()
                 varlist_list.append((var["Class"], current_varlist))
                 if var["Retain"] == "Yes":