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
Method Calling
September 24, 2018
12:20, EEST
Avatar
joey
New Member
Members
Forum Posts: 2
Member Since:
September 24, 2018
sp_UserOfflineSmall Offline

Hi,

I am writing an Android App with the Java SDK.
I am on the point where I want to invoke Composed Skills. For example, the Skill ‘start’ has the NodeId ns=1; i=145,…..
And when I want to view the References, I get informations about a SourceId and a TargetId.
Now my question: Which Id is required to use the method call(objectId, methodId, inputs)?
Currently I am using the ID of the Node I want to invoke and no SourceId or TargetId.

September 24, 2018
12:34, EEST
Avatar
Heikki Tahvanainen
Member
Members
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hello,

In OPC UA, methods are called in the context of an object node. For this reason, you’ll need to supply both the node id of the object node and the node id of the method node.

From the Javadoc documentation you can find the following description:
objectId: The NodeId of the Object or ObjectType that is the source of a HasComponent Reference (or subtype of HasComponent Reference) to the Method.
methodId: NodeId of the Method to invoke in the object.

Let us know if you have any further questions or comments.

September 24, 2018
12:51, EEST
Avatar
joey
New Member
Members
Forum Posts: 2
Member Since:
September 24, 2018
sp_UserOfflineSmall Offline

Thanks for the quick response.

Am I right, that the node id of the method node is the 145 for the start example? That’s also the Id, the Prosys App show me in the information popup.
And the objectId is not the Id of the parent node, but the Source Id in the References?

September 24, 2018
13:11, EEST
Avatar
Heikki Tahvanainen
Member
Members
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hi,

The objectId is the node id of the “parent” node. Or more exactly; the Object or ObjectType that is the source of a HasComponent Reference to the Method.

Perhaps it’s best to illustrate this Object and Method relationship with an example. In Prosys OPC UA Simulation Server, there’s an example method named “MyMethod”. Please see the following screenshots about how to find out the node id of the Object node and the node id of the Method node:

https://share.prosysopc.com/MyDevice.png
https://share.prosysopc.com/MyMethod.png

September 25, 2018
14:01, EEST
Avatar
Heikki Tahvanainen
Member
Members
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

And to continue a little bit, there may be situations where the object does not directly have a HasComponent reference to a method node, but the method can still be called in the context of this object.

As an example, consider that there’s an ObjectType “MyType” which has a method “MyMethod” defined. Then there’s an Object (instance of the ObjectType) called MyObject. In this case the references would be:
MyObject ->HasTypeDefinition->MyType
MyType->HasComponent->MyMethod

In this context it would be allowed to call the method with MyObject and MyMethod node ids:
Call(MyObjectId, MyMethodId)

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
22 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:

rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala

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

Administrators: admin: 1