Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
createInstance(BaseObjectTypeNode.class, ...)
January 15, 2015
18:39, EET
Avatar
hbrackel
Member
Members
Forum Posts: 144
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

Hi,

I try to create new object instances using nodeManager.createInstance(BaseObjectTypeNode.class, …). It throws the exception:

Exception in thread “main” com.prosysopc.ua.server.UaInstantiationException: Could not read type definition node identifier (expecting Annotation TypeDefinitionId) from the class class com.prosysopc.ua.types.opcua.server.BaseObjectTypeNode

The same call using a FolderTypeNode.class instead of BaseObjectTypeNode.class works properly. Looking into the sources, the mentioned annotation is indeed missing (it is also missing in some other classes).

While creating an instance of a baseObjectType in the “old fashioned way” (new UaObjectNode(…)) I noticed that after adding an “Organizes” reference back to the “Objects” folder with inverse=true, UAExpert does not show the corresponding “organizedBy” reference on the object node. UAExpert shows the inverse hasComponent / componentOf reference for a manually added method though. (UAExpert is configured to show references in both directions). Organizes/OrganizedBy is properly display between Root and the ObjectsFolder.

The SDK version used is 2.0.3

Kind regards, Hans-Uwe

January 16, 2015
8:30, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1026
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Good find. The BaseObject/VariableTypeNode are not code-generated, therefore they miss the annotation. While BaseVariableType is abstract, the BaseObjectType is not, so it should be instantiable. Will be fixed to 2.1.0, which should be released next week. Quickfix for source editions could just add the annotation manually similar to other classes (NodeIds are found from Identifiers class).

I’ll check the other issue. Can you also mention the precise version number (i.e. 2.0.3-???)

– Bjarne

January 16, 2015
10:23, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1026
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

At least doing the following on development version:

NodeManagerUaNode nmu = new NodeManagerUaNode(server, “http://www.prosysopc.com/OPCUA/TestManualObjectTypeNode”);

UaObject obj = new UaObjectNode(nmu, new NodeId(nmu.getNamespaceIndex(), 42), “TestManualObjectTypeNode”, Locale.ENGLISH);

obj.addReference(Identifiers.ObjectsFolder, Identifiers.Organizes, true);

seems to display OrganizedBy reference correctly. So this should/will be corrected in 2.1.0.

January 16, 2015
11:33, EET
Avatar
hbrackel
Member
Members
Forum Posts: 144
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

Hi,

the full version number of the SDK I’m using is 2.0.3-307

interestingly, today I cannot reproduce the problem of the missing “OrganizedBy” reference with a manually created uaObject. Maybe a hickup in UAExpert yesterday (or a user error ;-) ). All references seem to be properly created.

– Hans-Uwe

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
24 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 738

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1524

Posts: 6451

Newest Members:

jonathonmcintyre, fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1