Noobie OPCUA user here. I built a custom object type using UA Modeler, which as far as I understand creates a class of x custom object with y properties. My issue is with creating a node instance of that in my server. I'm looking for something that would allow me to do: Node test = new object node of type x custom object. I know that I could recreate my custom object in code, but that wouldn't be very smart... I think this is a very simple issue, but I can't find how to fix it in documentation or in the servers. Unless this is the way?
CreateObjectSettings settings = new CreateObjectSettings()
{
// All the settings
TypeDefinitionId = ObjectTypeIds.MyCustomObject,
};
CreateObject(Server.DefaultRequestContext, settings);
Thanks for the help :)
You are on the right track.
Here is a function I wrote to create custom objects based on the type passed-in. Notice that you have to lock the nodes and make sure that the node does not already exist.
Notice that you can to do this instead of just assigning the type to the
TypeDefinitionId:You call this by doing something like this: