PLCGenerator.py
changeset 408 0e389fa5b160
parent 391 07447ee3538e
child 483 779a519f78f2
equal deleted inserted replaced
407:0a324a874981 408:0e389fa5b160
   608         if body_type in ["FBD", "LD", "SFC"]:
   608         if body_type in ["FBD", "LD", "SFC"]:
   609             for instance in body.getcontentInstances():
   609             for instance in body.getcontentInstances():
   610                 if isinstance(instance, (plcopen.fbdObjects_inVariable, plcopen.fbdObjects_outVariable, plcopen.fbdObjects_inOutVariable)):
   610                 if isinstance(instance, (plcopen.fbdObjects_inVariable, plcopen.fbdObjects_outVariable, plcopen.fbdObjects_inOutVariable)):
   611                     expression = instance.getexpression()
   611                     expression = instance.getexpression()
   612                     var_type = self.GetVariableType(expression)
   612                     var_type = self.GetVariableType(expression)
   613                     if expression == pou.getname():
   613                     if pou.getpouType() == "function" and expression == pou.getname():
   614                         returntype_content = pou.interface.getreturnType().getcontent()
   614                         returntype_content = pou.interface.getreturnType().getcontent()
   615                         if returntype_content["name"] == "derived":
   615                         if returntype_content["name"] == "derived":
   616                             var_type = returntype_content["value"].getname()
   616                             var_type = returntype_content["value"].getname()
   617                         elif returntype_content["name"] in ["string", "wstring"]:
   617                         elif returntype_content["name"] in ["string", "wstring"]:
   618                             var_type = returntype_content["name"].upper()
   618                             var_type = returntype_content["name"].upper()