Allow usage of FunctionBlock without output
authorgreg
Fri, 22 May 2009 09:27:22 +0200
changeset 354 20ccf1e5266e
parent 353 f2be2307d666
child 355 a9046671e0ce
Allow usage of FunctionBlock without output
plcopen/structures.py
--- a/plcopen/structures.py	Fri May 22 09:26:35 2009 +0200
+++ b/plcopen/structures.py	Fri May 22 09:27:22 2009 +0200
@@ -133,7 +133,8 @@
             if not connectionPoint or block.getx() + blockPointx == connectionPoint.getx() and block.gety() + blockPointy == connectionPoint.gety():
                 output_info = (generator.TagName, "block", block.getlocalId(), "output", i)
                 return generator.ExtractModifier(variable, [("%s.%s"%(name, variable.getformalParameter()), output_info)], output_info)
-    raise ValueError, "No output variable found"
+    if link is not None:
+        raise ValueError, "No output variable found"
 
 def initialise_block(type, name, block = None):
     return [(type, name, None, None)]