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
Moderator
Members

Moderators
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
Moderator
Members

Moderators
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
Moderator
Members

Moderators
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: 518

Currently Online:
21 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: 680

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com

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