--- a/plcopen/plcopen.py Fri Jan 04 17:47:00 2008 +0100
+++ b/plcopen/plcopen.py Fri Jan 04 17:47:58 2008 +0100
@@ -453,7 +453,7 @@
var_type = PLCOpenClasses["dataType"]()
derived_type = PLCOpenClasses["derived"]()
derived_type.setName(type)
- var_type.setValue(derived_type)
+ var_type.setContent("derived", derived_type)
var.setType(var_type)
content[-1]["value"].appendVariable(var)
setattr(cls, "addPouVar", addPouVar)
@@ -477,8 +477,8 @@
variables = varlist["value"].getVariable()
for var in variables:
if var.getName() == name:
- var_type = var.getType().getValue()
- if isinstance(var_type, PLCOpenClasses["derived"]) and var_type.getName() == type:
+ vartype_content = var.getType().getContent()
+ if vartype_content["name"] == "derived" and vartype_content["value"].getName() == type:
variables.remove(var)
break
if len(varlist["value"].getVariable()) == 0: