06/22/2020
Hello,
I am new to OPC. I’m developing a client to connect to an OPC UA server.
I’m using VS2019 and OPCFoundation.NetStandard.Opc.Ua nuget packages version 1.4.361
I’m facing two different problems.
Problem 1
If I make a call to a method without InputArguments, the result is the expected. This is ok:Â outputArguments = session.Call(new NodeId(“ns=2;i=5022”), new NodeId(“ns=2;i=7002”), null);
But if I try to make a call to a method with InputArguments :
outputArguments = session.Call(new NodeId(“ns=2;i=5002”), new NodeId(“ns=2;i=7001”), byteArr);
I always get an error. I tried to send a byte[] array, wich replies with BadInvalidArgument. I also tried some different ways ( DataValue(byteArr), object[], etc ) but always and error, either BadInvalidArgument or BadTooManyArguments.
I should send to the server three bytes {40,128,1}
If I try to do the same in UA Expert client, I get good results. In UA Expert I fill in the three bytes in the array and make the call. I get the answer correctly.
Problem 2
Given that I can’t go along with one of the two function overloads of the Call Method, I tried the second one. And what I get here is a very weird error. Maybe there is a bug somewhere.
If I write this :
ResponseHeader responseHeader1 = session.Call(requestHeader, cmr, out callMethodResults, out diagnosticInfos1);
Visual Studio tells that requestHeader is not a NodeId, cmr is also not a NodeId and that I shuouldn’t use out to the InputArguments. In summary, Visual Studio is telling me that I’m using wrong arguments for the prototype
Ilist<object> Session.Call(NodeId objectId, NodeId methoId, params object[] args);
ignoring completely the second overload. I can’t even compile.
Any help will be wellcomed as I am completely lost.
1 Guest(s)