--- a/plcopen/structures.py Mon Jul 09 11:10:14 2007 +0200
+++ b/plcopen/structures.py Tue Jul 10 09:52:53 2007 +0200
@@ -128,10 +128,15 @@
Function that returns the block definition associated to the block type given
"""
-def GetBlockType(type):
+def GetBlockType(type, inputs = None):
for category in BlockTypes:
for blocktype in category["list"]:
- if blocktype["name"] == type:
+ if inputs:
+ block_inputs = tuple([var_type for name, var_type, modifier in blocktype["inputs"]])
+ same_inputs = inputs == block_inputs
+ else:
+ same_inputs = True
+ if blocktype["name"] == type and same_inputs:
return blocktype
return None