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: 18
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: 1026
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: 18
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: 1026
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: 1026
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: 1919

Currently Online:
20 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: 735

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1523

Posts: 6449

Newest Members:

rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16

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

Administrators: admin: 1