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
create MethodNode throrgh createInstance() method not working
July 30, 2016
12:41, EEST
Avatar
khalid_shah
Member
Members
Forum Posts: 6
Member Since:
April 12, 2016
sp_UserOfflineSmall Offline

I want to create a method Node On server side through createInstace() method which is the function of NodeManagerUANode. but when i create methodNode through this function it throws a Exception ?
uaNode= this.createInstance(Identifiers.MethodNode,new NodeId(2,”myMethod”),new QualifiedName(“myMethod”),new LocalizedText(“myMethod”));

com.prosysopc.ua.server.UaInstantiationException: Could not get type node.
at com.prosysopc.ua.server.NodeManagerUaNode.createNodeBuilder(Unknown Source)
at com.prosysopc.ua.server.NodeManagerUaNode.createNodeBuilder(Unknown Source)
at com.prosysopc.ua.server.NodeManagerUaNode.createInstance(Unknown Source)

what should I do ??
tell me if i am doing anything wrong .
thanks Smile

August 1, 2016
12:29, EEST
Avatar
Heikki Tahvanainen
Moderator
Members

Moderators
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hi,

The NodeManagerUaNode.createInstance method is designed to create object and variable nodes. This method cannot be used to create method nodes as OPC UA methods do not have type definitions.

Please look at MyNodeManager.createMethodNode for an example of how to create a sample method node. This example uses

NodeManagerUaNode.addNodeAndReference

method. You can also add the node and reference separately, keeping in mind that OPC UA methods must belong to an object (or object type) and therefore be referenced from one of those with at least one HasComponent reference. This is because OPC UA methods can only be invoked on objects (or object types) referencing the method with a HasComponent reference.

August 1, 2016
13:35, EEST
Avatar
khalid_shah
Member
Members
Forum Posts: 6
Member Since:
April 12, 2016
sp_UserOfflineSmall Offline

Thank you Sir,
One more question if we extend our nodeManager with NodeManager instead of extending it with NodeManagerUaNode ,
now if we want to createInstance of any typeDefinition node which is already defined in types then how can we create a proper instance of any containing all of its references , the problem is that CreateInstance() is the method of NodeManagerUaNode and it is not available in NodeManager, so how can we create instances by extending our nodeManager with NodeManage

August 1, 2016
16:11, EEST
Avatar
Heikki Tahvanainen
Moderator
Members

Moderators
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hello,

If I understood the question correctly, it’s about how to create instances based on the type information. The createInstance method uses NodeBuilder internally, so you can recreate the functionality pretty easily using NodeBuilder class.

But then again: if you are creating instances of UaNodes why don’t you just use the NodeManagerUaNode implementation?

Did this answer your question or did I misinterpret something?

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

fred: 41

Member Stats:

Guest Posters: 0

Members: 683

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma

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