Finally, we are creating instances in Lesson1NodeManager::Startup() as shown in the following code snippet.
CreateObjectSettings settings = new CreateObjectSettings()
{
ParentNodeId = ObjectIds.ObjectsFolder,
RequestedNodeId =
new NodeId(
"Controllers", InstanceNamespaceIndex),
TypeDefinitionId = ObjectTypeIds.FolderType
};
ObjectNode controllersNode = CreateObject(
Server.DefaultRequestContext, settings);
settings = new CreateObjectSettings()
{
ParentNodeId = controllersNode.NodeId,
RequestedNodeId =
new NodeId(
"AirConditioner1", InstanceNamespaceIndex),
TypeDefinitionId =
new NodeId(yourorganisation.BA.ObjectTypes.AirConditionerControllerType, TypeNamespaceIndex)
};
CreateObject(
Server.DefaultRequestContext, settings);
settings = new CreateObjectSettings()
{
ParentNodeId = controllersNode.NodeId,
RequestedNodeId =
new NodeId(
"Furnace1", InstanceNamespaceIndex),
TypeDefinitionId =
new NodeId(yourorganisation.BA.ObjectTypes.FurnaceControllerType, TypeNamespaceIndex)
};
CreateObject(
Server.DefaultRequestContext, settings);
The following figure shows the result in the server’s address space.