Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Is the NodeSet compiler able to generate constants/defines for ObjectTypes?

18 views
Skip to first unread message

Frank Oltmanns

unread,
Sep 7, 2024, 7:16:17 AM9/7/24
to open...@googlegroups.com
Dear all,

I have a server that uses some self defined data types (EnumTypes and ObjectTypes).

I've created a Model.xml file and converted it using the OPC Foundation's UA Model Compiler, so I have a NodeSet2.xml and a bsd file. (It also creates a bunch of C# files that I don't need. :D)

At first glance, it seems that the NodeSet compiler generates DataTypes, but not ObjectTypes.

Looking at the following example code from the open62541 tutorial for the NodeSet compiler, section "Creating Object Instances" [1], only increases my suspicion that the NodeSet compiler does not generate defines or constants for object types:
```
UA_Server_addObjectNode(server, UA_NODEID_NUMERIC(1, 0),
UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER),
UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES),
UA_QUALIFIEDNAME(1, "Pump1"),
UA_NODEID_NUMERIC(2, 1002),
object_attr, NULL, &createdNodeId);
```

Here, the value 1002 (which refers to the ObjectType "Pump") is hard-coded.

For now, I'm resorting to generating the defines for my ObjectTypes by hand, but I keep wondering if somebody here is aware of a better way (other than writing my own script that performs the task).

Thanks,
Frank

[1] https://www.open62541.org/doc/1.1/nodeset_compiler.html#creating-object-instances
Reply all
Reply to author
Forward
0 new messages