我的类型模型中有一个HomeBaseObjectType和HomeRegionType:
这是我使用Freeopcua库的python代码:
# create a new node type we can instantiate in our address space
dev = await server.nodes.base_object_type.add_object_type(idx, "HomedBaseObjectType")
await (await dev.add_variable(idx, "BadScanCounter", 1, ua.VariantType.Int64)).set_modelling_rule(True)
await (await dev.add_variable(idx, "DetectorTemp", 0.0, ua.VariantType.Double)).set_modelling_rule(True)
await (await dev.add_variable(idx, "Flow", 0.0, ua.VariantType.Double)).set_modelling_rule(True)
await (await dev.add_variable(idx, "LaserDC", 0.0, ua.VariantType.Double)).set_modelling_rule(True)
await (await dev.add_variable(idx, "LaserPP", 0.0, ua.VariantType.Double)).set_modelling_rule(True)
await (await dev.add_variable(idx, "Pressure", 0.0, ua.VariantType.Double)).set_modelling_rule(True)
await (await dev.add_variable(idx, "SingleBeamAt2500", 0.0, ua.VariantType.Double)).set_modelling_rule(True)
await (await dev.add_variable(idx, "SingleBeamAt900", 0.0, ua.VariantType.Double)).set_modelling_rule(True)
await (await dev.add_variable(idx, "TempOptics", 0.0, ua.VariantType.Double)).set_modelling_rule(True)
dev1 = await server.nodes.base_object_type.add_object_type(idx, "HomedRegionType")
await (await dev1.add_object(idx, "HomeBaseObjectType")).set_modelling_rule(True)
我应该如何使HomedBaseObjectType下的变量出现在HomedRegionType下?
await (await dev1.add_object(idx, "HomedBaseObjectType", objecttype=dev)).set_modelling_rule(True)