How to get the node attribute handle for Writing values to t
Posted: 15 Jan 2019, 15:28
Upon creating the OPC Ua server, we firstly create objects like this:
cosSettings = new CreateObjectSettings()
{
ParentNodeId = onTunnelTypeNode.NodeId,
ReferenceTypeId = ReferenceTypeIds.Organizes,
RequestedNodeId = new NodeId(tSectionObject.szObject, InstanceNamespaceIndex),
BrowseName = new QualifiedName(tSectionObject.szObject, InstanceNamespaceIndex),
TypeDefinitionId = new NodeId(SVV.HBT.ObjectTypes.SectionType, TypeNamespaceIndex)
};
onSectionTypeNode = CreateObject(Server.DefaultRequestContext, cosSettings);
Then we have the nodes, but dont know how to get NodeAttributeHandle (nah) variable for the object:
sc = Write(Server.DefaultRequestContext, nah, null, dv);
I way to get this NodeAttributeHandle is to override the StartDataMonitoring procedure and subscribe the objects,
then the NodeAttributeHandle is received thru the second parameter MonitoredItemHandle.NodeHandle.
Do you have a way to retrive this NodeAttributeHandle thru the ObjectNode?
cosSettings = new CreateObjectSettings()
{
ParentNodeId = onTunnelTypeNode.NodeId,
ReferenceTypeId = ReferenceTypeIds.Organizes,
RequestedNodeId = new NodeId(tSectionObject.szObject, InstanceNamespaceIndex),
BrowseName = new QualifiedName(tSectionObject.szObject, InstanceNamespaceIndex),
TypeDefinitionId = new NodeId(SVV.HBT.ObjectTypes.SectionType, TypeNamespaceIndex)
};
onSectionTypeNode = CreateObject(Server.DefaultRequestContext, cosSettings);
Then we have the nodes, but dont know how to get NodeAttributeHandle (nah) variable for the object:
sc = Write(Server.DefaultRequestContext, nah, null, dv);
I way to get this NodeAttributeHandle is to override the StartDataMonitoring procedure and subscribe the objects,
then the NodeAttributeHandle is received thru the second parameter MonitoredItemHandle.NodeHandle.
Do you have a way to retrive this NodeAttributeHandle thru the ObjectNode?