--- a/plcopen/plcopen.py Fri Aug 22 13:52:19 2008 +0200
+++ b/plcopen/plcopen.py Fri Aug 22 17:18:12 2008 +0200
@@ -313,7 +313,7 @@
if pou_type != "program":
block_infos = {"name" : pou_name, "type" : pou_type, "extensible" : False,
"inputs" : [], "outputs" : [], "comment" : "",
- "generate" : generate_block, "initialise" : initialise_block }
+ "generate" : generate_block, "initialise" : initialise_block}
if pou.getinterface():
for type, varlist in pou.getvars():
if type == "InOut":
@@ -494,8 +494,11 @@
# Return Block types checking for recursion
def GetCustomBlockTypes(self, exclude = ""):
- pou = self.getpou(exclude)
- type = pou.getpouType()
+ type = None
+ if exclude != "":
+ pou = self.getpou(exclude)
+ if pou is not None:
+ type = pou.getpouType()
customblocktypes = []
for customblocktype in self.CustomBlockTypes:
if customblocktype["name"] != exclude and not self.ElementIsUsedBy(exclude, customblocktype["name"]) and not (type == "function" and customblocktype["type"] != "function"):