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: 9
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: 836
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: 9
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: 836
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: 836
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: 267

Currently Online:
5 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 122

pramanj: 86

ibrahim: 74

rocket science: 65

kapsl: 57

gjevremovic: 49

Sabari: 46

Xavier: 42

TimK: 41

fred: 41

Member Stats:

Guest Posters: 0

Members: 3344

Moderators: 17

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1300

Posts: 5561

Newest Members:

UPtato42, fblvicky6629601, elliebloomer44, Manuelagibe, justinafavenc54, sarlaman9, nancymcneal1, elztaim591797, JeffreyAidet, sameisenhower7

Moderators: Jouni Aro: 946, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 836, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 25, Teppo Uimonen: 21, Markus Johansson: 41, Niklas Nurminen: 0, Matti Siponen: 221, Lusetti: 0

Administrators: admin: 1