Fix bug when compiling pou including user-defined blocks with unconnected input
authorlaurent
Thu, 21 Apr 2011 17:52:46 +0200
changeset 539 8dbb1de154c1
parent 538 8c7605bbf673
child 540 82fa901a2160
Fix bug when compiling pou including user-defined blocks with unconnected input
plcopen/plcopen.py
--- a/plcopen/plcopen.py	Thu Apr 21 16:37:43 2011 +0200
+++ b/plcopen/plcopen.py	Thu Apr 21 17:52:46 2011 +0200
@@ -606,7 +606,7 @@
     # Function that returns the block definition associated to the block type given
     def GetCustomBlockType(self, type, inputs = None):
         for customblocktype in self.CustomBlockTypes:
-            if inputs:
+            if inputs is not None and inputs != "undefined":
                 customblock_inputs = tuple([var_type for name, var_type, modifier in customblocktype["inputs"]])
                 same_inputs = inputs == customblock_inputs
             else: