Fixed new code-generation code, that was making exception with simple variable-to-variable assignments.
authorEdouard Tisserant
Thu, 16 Aug 2018 11:22:40 +0200
changeset 2269 2e38b5ec4753
parent 2268 e6c9a52d3877
child 2270 d9175daf6522
Fixed new code-generation code, that was making exception with simple variable-to-variable assignments.
PLCGenerator.py
--- a/PLCGenerator.py	Tue Aug 14 13:10:15 2018 +0200
+++ b/PLCGenerator.py	Thu Aug 16 11:22:40 2018 +0200
@@ -926,14 +926,15 @@
         if blk is None:
             return None
 
-        for invar in blk.inputVariables.getvariable():
-            if invar.getformalParameter() == "EN":
-                if len(invar.getconnectionPointIn().getconnections()) > 0:
-                    if blk.getinstanceName() is None:
-                        var_name = "%s%d_ENO" % (blk.gettypeName(), blk.getlocalId())
-                    else:
-                        var_name = "%s.ENO" % blk.getinstanceName()
-                    return var_name
+        if not isinstance(blk, (InVariableClass, InOutVariableClass)):
+            for invar in blk.inputVariables.getvariable():
+                if invar.getformalParameter() == "EN":
+                    if len(invar.getconnectionPointIn().getconnections()) > 0:
+                        if blk.getinstanceName() is None:
+                            var_name = "%s%d_ENO" % (blk.gettypeName(), blk.getlocalId())
+                        else:
+                            var_name = "%s.ENO" % blk.getinstanceName()
+                        return var_name
         return None
 
     def ComputeProgram(self, pou):