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
Wrong type defintion for CurrentState node in FileTransferStateMachineType
September 12, 2022
16:43, EEST
Avatar
Manfred Hausmann
Member
Members
Forum Posts: 17
Member Since:
September 21, 2018
sp_UserOfflineSmall Offline

Hi

When creating a node of Type FileTransferStateMachineType (see OPC UA Part 5: Information model) the method getCurrentStateNode() returns a FiniteStateVariableTypeNode, but
getCurrentStateNode().getReference(ReferenceTypeIdentifiers.HasTypeDefinition, false).getTargetNode() returns “NodeId=i=2755, NodeClass=VariableType, BrowseName=StateVariableType, IsAbstract=false, DataType=i=21, ValueRank=-1, ArrayDimensions=null, Value=(null)” where i=2755 is StateVariableType.

Is this a bug or a feature? đŸ˜‰

Is there a workaround for this problem?

September 13, 2022
11:35, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

I would label it as an interesting bug… hmmm..

A workaround could be to delete that HasTypeDefinition reference and add the correct one manually (since the UaNode itself was of the proper type, just the reference is wrong, i.e. the java type doesn’t define the HasTypeDefinition, skipping some details of why). But other than that it needs fixing in the SDK.

Basically the “more subtype” one should override the Reference (this logic is somewhat complicated i.e. we do the createInstances node-based not java-based as it wont work like that since instancedeclarations are allowed to override stuff), but maybe that doesn’t happen properly (though we did get that one for the node’s type… which is a bit odd). Also we can reproduce this here.

September 13, 2022
12:02, EEST
Avatar
Manfred Hausmann
Member
Members
Forum Posts: 17
Member Since:
September 21, 2018
sp_UserOfflineSmall Offline

Hi Bjarne,

thanks for the prompt reply.
I will try out the workaround.

Best regards,
Manfred

September 14, 2022
11:34, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

So, seems some of the very old internal logic relies on HashSet iteration order, which is bad (thus this can happen randomly and also might depend on java version, as the iteration order is java internal implementation). Basically the HasTypeDefinitions were added in the wrong order so the super-type-ones did override the correct one. We’ll try to fix this in the next release.

Also for the workaround, there is no need to delete the reference, just add the new one and it will replace the wrong one.

P.S.
Probably the logic could use some more updates as we did pick up the correct UaNode type. But in general the HasTypeDefinition cannot be java-class based, as the generated classes can also represent subtypes, if those models are not generated, i.e. for a given TypeDefinition node the “most-subtype-generated-one” will be picked for the UaNode implementation.

September 16, 2022
14:20, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

This is now fixed in our latest beta and will be part of 4.9.2. We have a beta-build and I did sent a link via email.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
18 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

TimK: 41

Member Stats:

Guest Posters: 0

Members: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1