0
votes

I'm trying to call this method using OPCFoundation library. To select a program

Methods:

NodeId node = new NodeId("ns=2;s=/Methods/Filehandling");
NodeId method = new NodeId("ns=2;s=/Methods/Filehandling/Select");
object[] argument = new object[2];

argument[0] = new NodeId("ns=2;s=Sinumerik/FileSystem/Part Program/EXAMPLE.MPF");
argument[1] = channel;

var result = _session.Call(node, method, argument);

But it's throwing the excepcion:

 BadNodeIdUnknown

And I checked that node exists.

I don't know what nodeId i have to use as objectId argument of Call method.

Yeah, this is not always so clear. It should refer to the object that is the target of the method call. Probably something above Methods in your structure. - Jouni Aro
@JouniAro I already called other methods like CopyFileToServer and I can use the nodeId "/Method" as objectId and "/Method/CopyFileToServer" as methodId. And it worked without any problem. - Marc Carbonell
OK, then you will have to check it from the server manufacturer, what they are expecting in this case. - Jouni Aro