PLCControler.py
changeset 101 3f06a178b960
parent 100 4e3f5b320bc3
child 107 255eada20688
--- a/PLCControler.py	Thu Sep 20 17:38:27 2007 +0200
+++ b/PLCControler.py	Tue Oct 02 18:00:13 2007 +0200
@@ -1455,7 +1455,7 @@
                 for var in varlist.getVariable():
                     if var.getName() == varname:
                         return var.getType().getValue()
-        return ""
+        return None
     
     def SetConnectionWires(self, connection, connector):
         wires = connector.GetWires()
@@ -1975,14 +1975,12 @@
         instance = element.getInstance(id)
         if isinstance(instance, plcopen.block):
             blocktype = instance.getTypeName()
-            blocktype_infos = GetBlockType(blocktype)
-            if blocktype_infos["type"] != "function":
-                if self.CurrentElementEditing != None:
-                    name = self.ElementsOpened[self.CurrentElementEditing]
-                    words = name.split("::")
-                    if words[0] in ["P","T","A"]:
-                        pou = self.Project.getPou(words[1])
-                        pou.removePouVar(blocktype, instance.getInstanceName())    
+            if self.CurrentElementEditing != None:
+                name = self.ElementsOpened[self.CurrentElementEditing]
+                words = name.split("::")
+                if words[0] in ["P","T","A"]:
+                    pou = self.Project.getPou(words[1])
+                    pou.removePouVar(blocktype, instance.getInstanceName())    
         element.removeInstance(id)
         self.RefreshPouUsingTree()