But on getinstanceByName in pou class fixed
authorlbessard
Thu, 03 Apr 2008 18:30:02 +0200
changeset 193 e18e354a8006
parent 192 50926b8abac4
child 194 1b3f8b4f8e04
But on getinstanceByName in pou class fixed
plcopen/plcopen.py
--- a/plcopen/plcopen.py	Wed Mar 26 15:22:40 2008 +0100
+++ b/plcopen/plcopen.py	Thu Apr 03 18:30:02 2008 +0200
@@ -831,7 +831,7 @@
     def getcontentInstanceByName(self, name):
         if self.content["name"] in ["LD","FBD","SFC"]:
             for element in self.content["value"].getcontent():
-                if element["value"].getLocalId() == name:
+                if isinstance(element["value"], PLCOpenClasses.get("fbdObjects_block", None)) and element["value"].getinstanceName() == name:
                     return element["value"]
         else:
             raise TypeError, "%s body don't have instances!"%self.content["name"]