PLCControler.py
changeset 1127 5315f26642e0
parent 1122 84de51ab40d2
child 1171 a506e4de8f84
--- a/PLCControler.py	Mon May 13 16:38:53 2013 +0200
+++ b/PLCControler.py	Mon May 13 23:07:24 2013 +0200
@@ -2105,13 +2105,15 @@
         if tagname is not None:
             names.update(dict([(varname.upper(), True) 
                                for varname in self.GetEditedElementVariables(tagname, debug)]))
-            element = self.GetEditedElement(tagname, debug)
-            if element is not None and element.getbodyType() not in ["ST", "IL"]:
-                for instance in element.getinstances():
-                    if isinstance(instance, (plcopen.sfcObjects_step, 
-                                             plcopen.commonObjects_connector, 
-                                             plcopen.commonObjects_continuation)):
-                        names[instance.getname().upper()] = True
+            words = tagname.split("::")
+            if words[0] in ["P","T","A"]:
+                element = self.GetEditedElement(tagname, debug)
+                if element is not None and element.getbodyType() not in ["ST", "IL"]:
+                    for instance in element.getinstances():
+                        if isinstance(instance, (plcopen.sfcObjects_step, 
+                                                 plcopen.commonObjects_connector, 
+                                                 plcopen.commonObjects_continuation)):
+                            names[instance.getname().upper()] = True
         else:
             project = self.GetProject(debug)
             if project is not None: