Troubleshooting BadSecureChannelClosed
If BadSecureChannelClosed
error occurs, check that the OPC UA server is running and the OPC UA client adapter certificate is available in the server trusted list, because one of the possible causes might be that the OPC UA server is not running or it rejected the connection for security reasons.
If the problem persists, this might depend on the expiration of the timeout of the communication between OPC UA server and OPC UA client adapter.
To solve this issue you must modify the following timeout parameters, included in the OpcUaAdapter.Settings.xml file located at C:\Program Files (x86)\Siemens\SORIS OPC UA Adapter:
<?xml version="1.0" encoding="utf-8"?>
<OpcUaAdapterSettings>
<Options>
<SessionTimeout>60000</SessionTimeout>
<StatusCheckInterval>1000</StatusCheckInterval>
<ReconnectPeriod>10000</ReconnectPeriod>
</Options>
</OpcUaAdapterSettings>
- SessionTimeout - maximum interval in milliseconds that the communication session must be open but inactive. If the OPC client does not respond within this interval, the OPC UA server will automatically end the client session. Default is 60000 ms. The specific OPC UA sever might try to honor the OPC UA client request, but the session timeout value might be negotiated to meet the server constraints.
- StatusCheckInterval – interval in milliseconds after which the OPC UA client adapter requests the connection status to the OPC UA server to check whether the communication is still active. Default is 1000 ms; 0 means that this feature is disabled.
- ReconnectPeriod – in case of errors, interval in milliseconds after which a reconnection to the server is attempted. Default is 1000 ms; 0 means that this feature is disabled.
To modify the above parameters, proceed as follows:
- Stop the OpcUaAdapter service.
- Do one of the following:
- If the OpcUaAdapter.Settings.xml file is already available in the installation folder, open this file, modify the timeout parameters appropriately, and save the changes.
NOTE: In particular it is suggested to increase the StatusCheckInterval value. For example, 5000.
- If the OpcUaAdapter.Settings.xml file is not available in the installation folder, create an XML file with the same name and content (see above). Then modify the timeout parameters appropriately, and save the changes.
- Restart the OpcUaAdapter service.