Hi,
I am using .NET based OPC UA SDK. I created one function as Addition and registered it on server side. I can successfully call and provide the input arguments for Addition function from client side. But I am not able to send the result of addition through output argument from server to client. It is always null. I don't understand how to send return value of addition function to client.
Thanks!
How to send return value of function from server to clien?.
Moderator: uasdknet
-
- Jr. Member
- Posts: 3
- Joined: 03 Nov 2017, 13:33
- Support Team
- Hero Member
- Posts: 3072
- Joined: 18 Mar 2011, 15:09
Re: How to send return value of function from server to clie
Hello,
Please see the code of the DemoServer. There are Methods defined and implemented.
Please see the code of the DemoServer. There are Methods defined and implemented.
Code: Select all
private StatusCode DoMultiply(
RequestContext context,
MethodHandle methodHandle,
IList<Variant> inputArguments,
List<StatusCode> inputArgumentResults,
List<Variant> outputArguments)
{
double x = inputArguments[0].ToDouble();
double y = inputArguments[1].ToDouble();
outputArguments[0] = x * y;
return StatusCodes.Good;
}
Best regards
Unified Automation Support Team
Unified Automation Support Team
-
- Jr. Member
- Posts: 3
- Joined: 03 Nov 2017, 13:33
Re: How to send return value of function from server to clie
Hi,
Thanks for the reply. Yes I am using the same method definition. If we look at the function parameters while debugging, outputArguments is always null. So thats why I am not able to put return value into outputArguments. So It will throw the exception. Even if I initialise outputArguments inside the function and assign the return value, on the client side outputArgument result is always null. So I am not getting how to assign the return value to the outputArguments . I am using examples/ServerGettingStarted/Lesson04.
Thnaks!
Thanks for the reply. Yes I am using the same method definition. If we look at the function parameters while debugging, outputArguments is always null. So thats why I am not able to put return value into outputArguments. So It will throw the exception. Even if I initialise outputArguments inside the function and assign the return value, on the client side outputArgument result is always null. So I am not getting how to assign the return value to the outputArguments . I am using examples/ServerGettingStarted/Lesson04.
Thnaks!
-
- Jr. Member
- Posts: 3
- Joined: 03 Nov 2017, 13:33
Re: How to send return value of function from server to clie
Hi,
I am able to solve the problem. Just need to add OutputArguments UAVariable in XML file.
Thanks.!
I am able to solve the problem. Just need to add OutputArguments UAVariable in XML file.
Thanks.!