Fixing bug in PLCGenerator when generating global variables
authorlaurent
Fri, 09 Dec 2011 10:13:06 +0100
changeset 597 7b17e3c8dbed
parent 596 ce33d72f6df7
child 598 510647310137
Fixing bug in PLCGenerator when generating global variables
PLCGenerator.py
--- a/PLCGenerator.py	Fri Dec 09 10:11:42 2011 +0100
+++ b/PLCGenerator.py	Fri Dec 09 10:13:06 2011 +0100
@@ -269,6 +269,8 @@
                 if vartype_content["name"] == "derived":
                     var_type = vartype_content["value"].getname()
                     self.GenerateDataType(var_type)
+                else:
+                    var_type = var.gettypeAsText()
                 
                 config += [("    ", ()),
                            (var.getname(), (tagname, variable_type, var_number, "name")),
@@ -320,6 +322,8 @@
                 if vartype_content["name"] == "derived":
                     var_type = vartype_content["value"].getname()
                     self.GenerateDataType(var_type)
+                else:
+                    var_type = var.gettypeAsText()
                 
                 resrce += [("      ", ()),
                            (var.getname(), (tagname, variable_type, var_number, "name")),