Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Error: 6401 after opcServer restore

More
10 Sep 2025 12:54 #14360 by support
Hello.

the error (OpcLabs.UAEngine=6401) can occur when reconnecting to the OPC UA server, e.g. where there is a high load on the system. The system goes through various states after the disconnection and during reconnection, and this can be one of them. When any error happens, however, QuickOPC should retry, and if everything is OK (the server is reachable), the error should go away by itself.

For this reason, I am concerned about the fact that you explicitly unsubscribe after any error. This goes directly *against* the prescribed usage of QuickOPC (see  opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Late...0OPC%20failure%20recovery.html ). Doing so can easily make matters worse.

Are you saying that without the Unsubscribe, the reconnection would not happen? 
If that is the case, you still need to remove the Unsubscribe, and only then we can start troubleshooting why the reconnection has not worked.

Regards
 

Please Log in or Create an account to join the conversation.

More
10 Sep 2025 03:01 #14359 by xpycy001
Dear support:

I have a question that has been bothering me. I would like to ask for help again. The result of the problem is: Error number 6401

After the abnormal machine was restored, it failed to function normally, and the message "OPC-UA client session is not available when connecting the client subscription" was displayed. ErrorId: OpcLabs.UAEngine=6401

but, UaExpert can instantly connect normally!!!

client.exe appsettng.json parameter of Ua 

"OpcUASetting": {
    "RetryConnectDelay": 300,  
    "EndpointSelectionTimeout": 30000,  
    "SessionConnectTimeout": 20000,  
    "SessionParametersRetrialDelay": 60000, 
    "OperationTimeout": 20000,  
    "CloseTimeout": 5000, 
    "ServerShutdownRetrialDelay": 60000
}

 

I used the Unsubscrible function of EasyUaClient to unsubscribe from the abnormal point in Opcserver. 
 After a delay of 5 minutes, I used the API interface to let Client.exe re-initiate the subscription to the target machine point,
 but still could not restore normal communication.
  
 

I'd like to receive official confirmation:
    1) The use of customized communication session and reconnection interval parameters takes into account factors such as the scenario of a single Client.exe connecting to over 300 OpcServers simultaneously and the number of abnormal machines, and is also to ensure that normal machine operation is not affected. However, I'm still unsure whether these customized parameters I'm using locally achieve my desired results, or whether my understanding is correct.

    2) Regarding errors such as "OPC-UA client session is not available when connecting the client subscription."
    ErrorId: OpcLabs.UAEngine=6401," is there a way to manually clear these invalid sessions? I haven't thoroughly read the underlying EasyUaClient source code, so I don't know.


Are there better ways to resolve and clear sessions, allowing these seemingly abnormal machines to reconnect, subscribe, and function?



detail Log info:
I've implemented a client.exe control application using C# and NetCore 8.0, connecting to the IP addresses of over 300 remote Opc Servers. The current problem is: 1) Some OpcServers (remote devices, machines) experience IP communication errors, which are detected as shutdown or network anomalies. This period can be quite long, and the anomalies are clear: some machines on-site are undergoing maintenance, downtime, or power outages. 2) When these few abnormal machines (opc Server IP) have returned to normal, third-party tools can be used to communicate with them normally, but my own Client.exe cannot connect. The following is one of the log snippets
EndpointDescriptor : opc.tcp://10.116.30.162:4840
NodeDescriptor : ns=3;s="Mixed Fluid Data"."DosingManual"[0]."DISet"
StatusInfo : Unknown
StatusCode :
Succeeded : False
DiagnosticsCount : 0
DiagnosticsSummary :
ErrorId : OpcLabs.UAEngine=6401
Exception :
Exception.Message
OPC-UA client session is not available when connecting the client subscription.
+ The client method called (or event/callback invoked) was 'DataChangeNotification'.
EndpointDescriptor:opc.tcp://10.116.30.162:4840,NodeDescriptor:NodeId="ns=3;s="Dosing Data"."DosingManual"[0]."DISet""

Because Client.exe cannot be restarted at will, 
an internal interface is opened to cancel the subscription of the device with the specified IP, 
re-subscribe it again, and try to restore it. However, it still cannot work normally. 
When re-subscribing, the subscribledId is also received, and the error is displayed as 6401.



Looking forward to your reply

Simon.Yu

20250910 11:00


 

Please Log in or Create an account to join the conversation.

Moderators: supportvaclav.zaloudek
Time to create page: 0.133 seconds