Bug on ST code generating for variables with the same name than POU when POU isn't a function fixed
authorlaurent
Tue, 15 Sep 2009 15:02:23 +0200
changeset 408 0e389fa5b160
parent 407 0a324a874981
child 409 34c9f624c2fe
Bug on ST code generating for variables with the same name than POU when POU isn't a function fixed
PLCGenerator.py
--- a/PLCGenerator.py	Tue Sep 15 14:59:33 2009 +0200
+++ b/PLCGenerator.py	Tue Sep 15 15:02:23 2009 +0200
@@ -610,7 +610,7 @@
                 if isinstance(instance, (plcopen.fbdObjects_inVariable, plcopen.fbdObjects_outVariable, plcopen.fbdObjects_inOutVariable)):
                     expression = instance.getexpression()
                     var_type = self.GetVariableType(expression)
-                    if expression == pou.getname():
+                    if pou.getpouType() == "function" and expression == pou.getname():
                         returntype_content = pou.interface.getreturnType().getcontent()
                         if returntype_content["name"] == "derived":
                             var_type = returntype_content["value"].getname()