plcopen/plcopen.py
changeset 246 9cf9694e8d66
parent 238 389f2046e495
child 251 cc5377a296ea
equal deleted inserted replaced
245:fdd05081c966 246:9cf9694e8d66
   506         return customblocktypes
   506         return customblocktypes
   507     setattr(cls, "GetCustomBlockTypes", GetCustomBlockTypes)
   507     setattr(cls, "GetCustomBlockTypes", GetCustomBlockTypes)
   508 
   508 
   509     # Return Function Block types checking for recursion
   509     # Return Function Block types checking for recursion
   510     def GetCustomFunctionBlockTypes(self, exclude = ""):
   510     def GetCustomFunctionBlockTypes(self, exclude = ""):
   511         pou = self.getpou(exclude)
   511         type = None
   512         type = pou.getpouType()
   512         if exclude != "":
       
   513             pou = self.getpou(exclude)
       
   514             type = pou.getpouType()
   513         customblocktypes = []
   515         customblocktypes = []
   514         for customblocktype in self.CustomBlockTypes:
   516         for customblocktype in self.CustomBlockTypes:
   515             if customblocktype["name"] != exclude and not self.ElementIsUsedBy(exclude, customblocktype["name"]) and not (type == "function" and customblocktype["type"] != "function"):
   517             if customblocktype["name"] != exclude and not self.ElementIsUsedBy(exclude, customblocktype["name"]) and not (type == "function" and customblocktype["type"] != "function"):
   516                 customblocktypes.appendcustom(customblocktype["name"])
   518                 customblocktypes.append(customblocktype["name"])
   517         return customblocktypes
   519         return customblocktypes
   518     setattr(cls, "GetCustomFunctionBlockTypes", GetCustomFunctionBlockTypes)
   520     setattr(cls, "GetCustomFunctionBlockTypes", GetCustomFunctionBlockTypes)
   519 
   521 
   520     # Return Block types checking for recursion
   522     # Return Block types checking for recursion
   521     def GetCustomBlockResource(self):
   523     def GetCustomBlockResource(self):