Call Method InputArguments from client side strange error|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Call Method InputArguments from client side strange error
Avatar
Enrique CR
New Member
Members
Forum Posts: 1
Member Since:
06/22/2020
sp_UserOfflineSmall Offline
1
06/23/2020 - 00:16
sp_Permalink sp_Print

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.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 41
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1445
Posts: 4889