methods require 2 nodeids to call?

Questions regarding the use of the C++ SDK for Server or Client development or integration into customer products ...

Moderator: uasdkcpp

Post Reply
scalfee
Hero Member
Hero Member
Posts: 73
Joined: 08 Mar 2014, 01:13

methods require 2 nodeids to call?

Post by scalfee »

Hi,

The docs on callin are sparse. the Header files:

Code: Select all

class UACLIENT_EXPORT CallIn
{
public:
    /** Constructor */
    CallIn()
    {
    };
    /** Destructor */
    ~CallIn(){};

    UaNodeId         objectId;
    UaNodeId         methodId;
    UaVariantArray   inputArguments;
};
and the sdk help:
The CallIn class contains the settings for a call request. More...

#include <uaclientsdk.h>
Public Member Functions
CallIn ()
Constructor.

~CallIn ()
Destructor.

Detailed Description

The CallIn class contains the settings for a call request.
Pretty sparse.

Why do methods require two nodeid's to be called? I have the methodid, from the server found via a browse. What is the appropriate objectid? I have tried just putting the methodid into the objectid and it worked. A little explanation here and maybe in the sdk would clear things up.

Thanks, Steve

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: methods require 2 nodeids to call?

Post by Support Team »

Hello Steve,

to call a method you need the NodeId of the method and the NodeId of the object the method belongs to.
You need both because you can have mutiple object instances of the same type:

Code: Select all

TypeDefinition:
ObjectTypeA
|-MethodA->NodeIdM


Instances:
ObjectA->NodeIdA
|-MethodA->NodeIdM

ObjectB->NodeIdB
|-MethodA->NodeIdM
So just having a methodId wouldn't be enough.
I have tried just putting the methodid into the objectid and it worked.
That's wrong and should return an error from the server. How did you try that?


Best Regards,

Unified Automation Support Team

portelajoao
Jr. Member
Jr. Member
Posts: 2
Joined: 28 Apr 2020, 12:38

Re: methods require 2 nodeids to call?

Post by portelajoao »

I am having exactly the same question.

The answer from the support team doesn't seem reasonable for me. It would be true in case the methodId of the methods from the instances would be the same, but that is not true. All the methods on the multiple instances will get different methodIds.

I have tried that using UaModeler 1.6.5., just look to the attached pictures.

In this case I don't understand the need/use of giving the "Parent" NodeID of an method.

Image

Regards,
Portela

Post Reply