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
Member
Members
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
Member
Members
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: 1919

Currently Online:
26 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: 730

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

PromotionToold, HypromeImpupe, toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus

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

Administrators: admin: 1