I created an ObjectType "Infomodell" with UA Modeler. It has a method "createVar1" as component which shall create an instance of a variable "Var1". I created the object instance and implemented the method as described in the tutorials.
When I try to create the instance in the method "createVar1" I get an not-found-error because the Infomodell-class isn't derived from the BaseNodeManager. The namespace, the nodeId and the method "CreateVariable" can't be found. This is syntax from the UA Modeler.
Code: Select all
public partial class Infomodell : BaseObjectModel, IInfomodellMethods
{
public StatusCode createVar1(
RequestContext context,
Infomodell model,
string in1,
)
{
CreateVariableSettings variableSettings;
variableSettings = new CreateVariableSettings()
{
BrowseName = new QualifiedName("Var1", TypeNamespaceIndex),
DisplayName = new LocalizedText("Var1"),
ParentNodeId = node.NodeId,
ParentAsOwner = false,
Value = "ValueofVar1",
ReferenceTypeId = UnifiedAutomation.UaBase.ReferenceTypeIds.HasComponent,
TypeDefinitionId = UnifiedAutomation.UaBase.VariableTypeIds.DataItemType,
DataType = UnifiedAutomation.UaBase.DataTypeIds.String,
ModellingRuleId = UnifiedAutomation.UaBase.ObjectIds.ModellingRule_Mandatory,
RequestedNodeId = new NodeId(1234, TypeNamespaceIndex)
};
CreateVariable(Server.DefaultRequestContext, variableSettings);
...
}