OPC UA Client inside OPC UA Server

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

Moderator: uasdknet

Post Reply
Arumugam
Sr. Member
Sr. Member
Posts: 13
Joined: 21 Jun 2016, 19:48

OPC UA Client inside OPC UA Server

Post by Arumugam »

Hello Team,

Greetings, I am working on a project where i have to have the OPC UA Client inside OPC UA Server.

OPC UA Server shall use its own OPC UA Client (discovery) to get the Endpoints and establish the session with respective server via OPC UA Client.

My OPC UA Server is Console Application - no issues working fine.

OPC UA Client - created as a Class library and i have create a unique ApplicationInstance with its own Application configuration settings.
- ApplicationInstance is created and loaded
- Able to start the Application Instance.

I have used the application instance to create the Discovery Server. Then used the discovery to get the Endpoints for the requested server.I have used Unified Automation UA Demo Server for testing.

When I query the Endpoints using the Discovery Server, i am not getting response instead below exception has been thrown. But the same server endpoints I am able to query via UAExpert also in other OPC UA Clients.
[AggregateException] One or more errors occurred.
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at UnifiedAutomation.UaBase.DefaultTransportChannel.EndSendRequest(IAsyncResult result)
at UnifiedAutomation.UaBase.DiscoveryClient.EndGetEndpoints(IAsyncResult result, EndpointDescriptionCollection& endpoints)
at UnifiedAutomation.UaClient.Discovery.OnGetEndpointsComplete(IAsyncResult result)

[SocketException] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond [fe80::5cb0:a98:5520:9552%14]:48030
at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UnifiedAutomation.UaBase.TapTcpListener.<ConnectAsync>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UnifiedAutomation.UaBase.DefaultTransportChannel.<OpenChannelAsync>d__55.MoveNext()

--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UnifiedAutomation.UaBase.DefaultTransportChannel.<SendRequestAsync>d__56.MoveNext()
Can you help me what went wrong with program flow?

Query: is it not possible to create the OPC UA Client as a Class Library?

Arumugam
Sr. Member
Sr. Member
Posts: 13
Joined: 21 Jun 2016, 19:48

GetPoints not working for the serverUrl with host name

Post by Arumugam »

Hello,

I have explored a lot and found that the GetPoints working fine with serverUrl = "opc.tcp://localhost:48030 | opc.tcp://127.0.0.1:48030 | opc.tcp://192.168.0.10:48030" with all these combinations but when we query endpoints with hostname like "opc.tcp://ltp-294:48030" with this i am facing the above exception and issue where it is not reponding.

The same ServerUrl works fine with UAExpert and other OPC UA Client too and surprisingly we have other built on Unified Automation .Net SDK v2.5.0 it is also working properly there, where i could get endpoints from the server using the hostname URL.

I am using the Unified Automation SDK v3.0.2 where actually we are facing the problem. I could able to recreate this problem with Full Client demo App which delivered as part of the SDK bundle.

OPC UA LDS Version used = 1.4.402. Kindly suggest me where the problem occurs.

Thanks in advance.

Post Reply