Fix error for connection via Host&Port
@@ -251,16 +251,26 @@ public class OpcUaAdapter extends SpecificDataStreamAdapter {
String selectedAlternativeConnection = extractor.selectedAlternativeInternalId(OPC_HOST_OR_URL);
String selectedAlternativeAuthentication = extractor.selectedAlternativeInternalId(ACCESS_MODE);
+
+
+ if (selectedAlternativeConnection.equals(OPC_URL)) {
+
String serverAddress = extractor.singleValueParameter(OPC_SERVER_URL, String.class);
+
if (!serverAddress.startsWith("opc.tcp://")) {
serverAddress = "opc.tcp://" + serverAddress;
- };
-
- if (selectedAlternativeConnection.equals(OPC_URL)) {
+ }
this.opcUaServer = serverAddress;
this.selectedURL = true;
} else {
+
+ String serverAddress = extractor.singleValueParameter(OPC_SERVER_HOST, String.class);
+
+ if (!serverAddress.startsWith("opc.tcp://")) {
+ serverAddress = "opc.tcp://" + serverAddress;
+ }
+
this.opcUaServer = serverAddress;
this.port = extractor.singleValueParameter(OPC_SERVER_PORT, String.class);
this.selectedURL = false;
