805 |
805 |
806 def GetInstanceInfos(self, instance_path, debug = False): |
806 def GetInstanceInfos(self, instance_path, debug = False): |
807 tagname = self.GetPouInstanceTagName(instance_path) |
807 tagname = self.GetPouInstanceTagName(instance_path) |
808 if tagname is not None: |
808 if tagname is not None: |
809 infos = self.GetPouVariables(tagname, debug) |
809 infos = self.GetPouVariables(tagname, debug) |
810 infos["type"] = tagname |
810 infos.type = tagname |
811 return infos |
811 return infos |
812 else: |
812 else: |
813 pou_path, var_name = instance_path.rsplit(".", 1) |
813 pou_path, var_name = instance_path.rsplit(".", 1) |
814 tagname = self.GetPouInstanceTagName(pou_path) |
814 tagname = self.GetPouInstanceTagName(pou_path) |
815 if tagname is not None: |
815 if tagname is not None: |
816 pou_infos = self.GetPouVariables(tagname, debug) |
816 pou_infos = self.GetPouVariables(tagname, debug) |
817 for var_infos in pou_infos["variables"]: |
817 for var_infos in pou_infos.variables: |
818 if var_infos["name"] == var_name: |
818 if var_infos.name == var_name: |
819 return var_infos |
819 return var_infos |
820 return None |
820 return None |
821 |
821 |
822 # Return if data type given by name is used by another data type or pou |
822 # Return if data type given by name is used by another data type or pou |
823 def DataTypeIsUsed(self, name, debug = False): |
823 def DataTypeIsUsed(self, name, debug = False): |