Skip to content

Commit

Permalink
#2119 Support for the OPC UA protocol using the PLC4X library:
Browse files Browse the repository at this point in the history
- Added error if server not found;
- Corrected String connection for type SecurityPolicy.NONE;
- Default value negotiationTimeout is 6000 ms
- Corrected translation for timeouts added unit [ms];
  • Loading branch information
Limraj committed Dec 6, 2024
1 parent ee1d591 commit c8d2585
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 60 deletions.
4 changes: 2 additions & 2 deletions src/br/org/scadabr/vo/dataSource/opcua/OpcUaDataSourceVO.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public Type getType() {
*/
@JsonRemoteProperty
private long negotiationTimeout = 60000;
private long negotiationTimeout = 6000;

/*
@ConfigurationParameter("request-timeout")
Expand Down Expand Up @@ -569,7 +569,7 @@ public String getConnectionString() {
/// Sec

if (getSecurityPolicy() != null) {
query += MessageFormat.format("&security-policy={0}", getSecurityPolicy().getDescription());
query += MessageFormat.format("&security-policy={0}", getSecurityPolicy().getCode());

if(getSecurityPolicy() != OpcUaSecurityPolicyType.NONE) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ public void setAttributes(String attributes) {

public String getNodeId() {
if (!StringUtils.isEmpty(getAttributes())) {
return MessageFormat.format("ns={0};{1}={2};{3};{4}", getNamespaceIndex(), getIdentifierType().getCode(), getIdentifier(), getAttributes(), getDataType());
return MessageFormat.format("ns={0};{1}={2};{3};{4}", getNamespaceIndex(), getIdentifierType().getCode(), getIdentifier(), getAttributes(), getDataType().getCode());
}
return MessageFormat.format("ns={0};{1}={2};{3}", getNamespaceIndex(), getIdentifierType().getCode(), getIdentifier(), getDataType());
return MessageFormat.format("ns={0};{1}={2};{3}", getNamespaceIndex(), getIdentifierType().getCode(), getIdentifier(), getDataType().getCode());
}

public OpcUaPointLocatorVO copy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public enum OpcUaSecurityPolicyType {
}

public String getCode() {
return this.name();
return this == NONE ? this.name() : this.description;
}

public String getDescription() {
Expand Down
1 change: 1 addition & 0 deletions src/com/serotonin/mango/web/dwr/DataSourceEditDwr.java
Original file line number Diff line number Diff line change
Expand Up @@ -2446,6 +2446,7 @@ public LinkedHashSet<String> searchServerOpcUa(OpcUaDataSourceVO<?> dataSourceVO
opcUaMaster.terminate();
} catch (Exception e) {
LOG.error(e.getMessage(), e);
serverList.add("Error: " + e.getMessage());
}
return serverList;
}
Expand Down
10 changes: 5 additions & 5 deletions webapp-resources/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3402,11 +3402,11 @@ dsEdit.opcua.keyStorePassword=Key Store Password
dsEdit.opcua.trustStoreType=Trust Store Type
dsEdit.opcua.trustStoreFile=Trust Store File
dsEdit.opcua.trustStorePassword=Trust Store Password
dsEdit.opcua.channelLifetime=Channel Lifetime
dsEdit.opcua.sessionTimeout=Session Timeout
dsEdit.opcua.negotiationTimeout=Negotiation Timeout
dsEdit.opcua.requestTimeout=Request Timeout
dsEdit.opcua.defaultTimeout=Default Timeout [TCP]
dsEdit.opcua.channelLifetime=Channel Lifetime [ms]
dsEdit.opcua.sessionTimeout=Session Timeout [ms]
dsEdit.opcua.negotiationTimeout=Negotiation Timeout [ms]
dsEdit.opcua.requestTimeout=Request Timeout [ms]
dsEdit.opcua.defaultTimeout=Default Timeout [ms][TCP]
dsEdit.opcua.receiveBufferSize=Receiver Buffer Size
dsEdit.opcua.sendBufferSize=Send Buffer Size
dsEdit.opcua.maxMessageSize=Max Message Size
Expand Down
10 changes: 5 additions & 5 deletions webapp-resources/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3405,11 +3405,11 @@ dsEdit.opcua.keyStorePassword=Key Store Password
dsEdit.opcua.trustStoreType=Trust Store Type
dsEdit.opcua.trustStoreFile=Trust Store File
dsEdit.opcua.trustStorePassword=Trust Store Password
dsEdit.opcua.channelLifetime=Channel Lifetime
dsEdit.opcua.sessionTimeout=Session Timeout
dsEdit.opcua.negotiationTimeout=Negotiation Timeout
dsEdit.opcua.requestTimeout=Request Timeout
dsEdit.opcua.defaultTimeout=Default Timeout [TCP]
dsEdit.opcua.channelLifetime=Channel Lifetime [ms]
dsEdit.opcua.sessionTimeout=Session Timeout [ms]
dsEdit.opcua.negotiationTimeout=Negotiation Timeout [ms]
dsEdit.opcua.requestTimeout=Request Timeout [ms]
dsEdit.opcua.defaultTimeout=Default Timeout [ms][TCP]
dsEdit.opcua.receiveBufferSize=Receiver Buffer Size
dsEdit.opcua.sendBufferSize=Send Buffer Size
dsEdit.opcua.maxMessageSize=Max Message Size
Expand Down
10 changes: 5 additions & 5 deletions webapp-resources/messages_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3445,11 +3445,11 @@ dsEdit.opcua.keyStorePassword=Key Store Password
dsEdit.opcua.trustStoreType=Trust Store Type
dsEdit.opcua.trustStoreFile=Trust Store File
dsEdit.opcua.trustStorePassword=Trust Store Password
dsEdit.opcua.channelLifetime=Channel Lifetime
dsEdit.opcua.sessionTimeout=Session Timeout
dsEdit.opcua.negotiationTimeout=Negotiation Timeout
dsEdit.opcua.requestTimeout=Request Timeout
dsEdit.opcua.defaultTimeout=Default Timeout [TCP]
dsEdit.opcua.channelLifetime=Channel Lifetime [ms]
dsEdit.opcua.sessionTimeout=Session Timeout [ms]
dsEdit.opcua.negotiationTimeout=Negotiation Timeout [ms]
dsEdit.opcua.requestTimeout=Request Timeout [ms]
dsEdit.opcua.defaultTimeout=Default Timeout [ms][TCP]
dsEdit.opcua.receiveBufferSize=Receiver Buffer Size
dsEdit.opcua.sendBufferSize=Send Buffer Size
dsEdit.opcua.maxMessageSize=Max Message Size
Expand Down
10 changes: 5 additions & 5 deletions webapp-resources/messages_fi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3530,11 +3530,11 @@ dsEdit.opcua.keyStorePassword=Key Store Password
dsEdit.opcua.trustStoreType=Trust Store Type
dsEdit.opcua.trustStoreFile=Trust Store File
dsEdit.opcua.trustStorePassword=Trust Store Password
dsEdit.opcua.channelLifetime=Channel Lifetime
dsEdit.opcua.sessionTimeout=Session Timeout
dsEdit.opcua.negotiationTimeout=Negotiation Timeout
dsEdit.opcua.requestTimeout=Request Timeout
dsEdit.opcua.defaultTimeout=Default Timeout [TCP]
dsEdit.opcua.channelLifetime=Channel Lifetime [ms]
dsEdit.opcua.sessionTimeout=Session Timeout [ms]
dsEdit.opcua.negotiationTimeout=Negotiation Timeout [ms]
dsEdit.opcua.requestTimeout=Request Timeout [ms]
dsEdit.opcua.defaultTimeout=Default Timeout [ms][TCP]
dsEdit.opcua.receiveBufferSize=Receiver Buffer Size
dsEdit.opcua.sendBufferSize=Send Buffer Size
dsEdit.opcua.maxMessageSize=Max Message Size
Expand Down
10 changes: 5 additions & 5 deletions webapp-resources/messages_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3399,11 +3399,11 @@ dsEdit.opcua.keyStorePassword=Key Store Password
dsEdit.opcua.trustStoreType=Trust Store Type
dsEdit.opcua.trustStoreFile=Trust Store File
dsEdit.opcua.trustStorePassword=Trust Store Password
dsEdit.opcua.channelLifetime=Channel Lifetime
dsEdit.opcua.sessionTimeout=Session Timeout
dsEdit.opcua.negotiationTimeout=Negotiation Timeout
dsEdit.opcua.requestTimeout=Request Timeout
dsEdit.opcua.defaultTimeout=Default Timeout [TCP]
dsEdit.opcua.channelLifetime=Channel Lifetime [ms]
dsEdit.opcua.sessionTimeout=Session Timeout [ms]
dsEdit.opcua.negotiationTimeout=Negotiation Timeout [ms]
dsEdit.opcua.requestTimeout=Request Timeout [ms]
dsEdit.opcua.defaultTimeout=Default Timeout [ms][TCP]
dsEdit.opcua.receiveBufferSize=Receiver Buffer Size
dsEdit.opcua.sendBufferSize=Send Buffer Size
dsEdit.opcua.maxMessageSize=Max Message Size
Expand Down
10 changes: 5 additions & 5 deletions webapp-resources/messages_lu.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3418,11 +3418,11 @@ dsEdit.opcua.keyStorePassword=Key Store Password
dsEdit.opcua.trustStoreType=Trust Store Type
dsEdit.opcua.trustStoreFile=Trust Store File
dsEdit.opcua.trustStorePassword=Trust Store Password
dsEdit.opcua.channelLifetime=Channel Lifetime
dsEdit.opcua.sessionTimeout=Session Timeout
dsEdit.opcua.negotiationTimeout=Negotiation Timeout
dsEdit.opcua.requestTimeout=Request Timeout
dsEdit.opcua.defaultTimeout=Default Timeout [TCP]
dsEdit.opcua.channelLifetime=Channel Lifetime [ms]
dsEdit.opcua.sessionTimeout=Session Timeout [ms]
dsEdit.opcua.negotiationTimeout=Negotiation Timeout [ms]
dsEdit.opcua.requestTimeout=Request Timeout [ms]
dsEdit.opcua.defaultTimeout=Default Timeout [ms][TCP]
dsEdit.opcua.receiveBufferSize=Receiver Buffer Size
dsEdit.opcua.sendBufferSize=Send Buffer Size
dsEdit.opcua.maxMessageSize=Max Message Size
Expand Down
10 changes: 5 additions & 5 deletions webapp-resources/messages_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3520,11 +3520,11 @@ dsEdit.opcua.keyStorePassword=Key Store Password
dsEdit.opcua.trustStoreType=Trust Store Type
dsEdit.opcua.trustStoreFile=Trust Store File
dsEdit.opcua.trustStorePassword=Trust Store Password
dsEdit.opcua.channelLifetime=Channel Lifetime
dsEdit.opcua.sessionTimeout=Session Timeout
dsEdit.opcua.negotiationTimeout=Negotiation Timeout
dsEdit.opcua.requestTimeout=Request Timeout
dsEdit.opcua.defaultTimeout=Default Timeout [TCP]
dsEdit.opcua.channelLifetime=Channel Lifetime [ms]
dsEdit.opcua.sessionTimeout=Session Timeout [ms]
dsEdit.opcua.negotiationTimeout=Negotiation Timeout [ms]
dsEdit.opcua.requestTimeout=Request Timeout [ms]
dsEdit.opcua.defaultTimeout=Default Timeout [ms][TCP]
dsEdit.opcua.receiveBufferSize=Receiver Buffer Size
dsEdit.opcua.sendBufferSize=Send Buffer Size
dsEdit.opcua.maxMessageSize=Max Message Size
Expand Down
10 changes: 5 additions & 5 deletions webapp-resources/messages_pl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3542,11 +3542,11 @@ dsEdit.opcua.keyStorePassword=Key Store Password
dsEdit.opcua.trustStoreType=Trust Store Type
dsEdit.opcua.trustStoreFile=Trust Store File
dsEdit.opcua.trustStorePassword=Trust Store Password
dsEdit.opcua.channelLifetime=Channel Lifetime
dsEdit.opcua.sessionTimeout=Session Timeout
dsEdit.opcua.negotiationTimeout=Negotiation Timeout
dsEdit.opcua.requestTimeout=Request Timeout
dsEdit.opcua.defaultTimeout=Default Timeout [TCP]
dsEdit.opcua.channelLifetime=Channel Lifetime [ms]
dsEdit.opcua.sessionTimeout=Session Timeout [ms]
dsEdit.opcua.negotiationTimeout=Negotiation Timeout [ms]
dsEdit.opcua.requestTimeout=Request Timeout [ms]
dsEdit.opcua.defaultTimeout=Default Timeout [ms][TCP]
dsEdit.opcua.receiveBufferSize=Receiver Buffer Size
dsEdit.opcua.sendBufferSize=Send Buffer Size
dsEdit.opcua.maxMessageSize=Max Message Size
Expand Down
10 changes: 5 additions & 5 deletions webapp-resources/messages_pt.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3557,11 +3557,11 @@ dsEdit.opcua.keyStorePassword=Key Store Password
dsEdit.opcua.trustStoreType=Trust Store Type
dsEdit.opcua.trustStoreFile=Trust Store File
dsEdit.opcua.trustStorePassword=Trust Store Password
dsEdit.opcua.channelLifetime=Channel Lifetime
dsEdit.opcua.sessionTimeout=Session Timeout
dsEdit.opcua.negotiationTimeout=Negotiation Timeout
dsEdit.opcua.requestTimeout=Request Timeout
dsEdit.opcua.defaultTimeout=Default Timeout [TCP]
dsEdit.opcua.channelLifetime=Channel Lifetime [ms]
dsEdit.opcua.sessionTimeout=Session Timeout [ms]
dsEdit.opcua.negotiationTimeout=Negotiation Timeout [ms]
dsEdit.opcua.requestTimeout=Request Timeout [ms]
dsEdit.opcua.defaultTimeout=Default Timeout [ms][TCP]
dsEdit.opcua.receiveBufferSize=Receiver Buffer Size
dsEdit.opcua.sendBufferSize=Send Buffer Size
dsEdit.opcua.maxMessageSize=Max Message Size
Expand Down
10 changes: 5 additions & 5 deletions webapp-resources/messages_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3553,11 +3553,11 @@ dsEdit.opcua.keyStorePassword=Key Store Password
dsEdit.opcua.trustStoreType=Trust Store Type
dsEdit.opcua.trustStoreFile=Trust Store File
dsEdit.opcua.trustStorePassword=Trust Store Password
dsEdit.opcua.channelLifetime=Channel Lifetime
dsEdit.opcua.sessionTimeout=Session Timeout
dsEdit.opcua.negotiationTimeout=Negotiation Timeout
dsEdit.opcua.requestTimeout=Request Timeout
dsEdit.opcua.defaultTimeout=Default Timeout [TCP]
dsEdit.opcua.channelLifetime=Channel Lifetime [ms]
dsEdit.opcua.sessionTimeout=Session Timeout [ms]
dsEdit.opcua.negotiationTimeout=Negotiation Timeout [ms]
dsEdit.opcua.requestTimeout=Request Timeout [ms]
dsEdit.opcua.defaultTimeout=Default Timeout [ms][TCP]
dsEdit.opcua.receiveBufferSize=Receiver Buffer Size
dsEdit.opcua.sendBufferSize=Send Buffer Size
dsEdit.opcua.maxMessageSize=Max Message Size
Expand Down
10 changes: 5 additions & 5 deletions webapp-resources/messages_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3505,11 +3505,11 @@ dsEdit.opcua.keyStorePassword=Key Store Password
dsEdit.opcua.trustStoreType=Trust Store Type
dsEdit.opcua.trustStoreFile=Trust Store File
dsEdit.opcua.trustStorePassword=Trust Store Password
dsEdit.opcua.channelLifetime=Channel Lifetime
dsEdit.opcua.sessionTimeout=Session Timeout
dsEdit.opcua.negotiationTimeout=Negotiation Timeout
dsEdit.opcua.requestTimeout=Request Timeout
dsEdit.opcua.defaultTimeout=Default Timeout [TCP]
dsEdit.opcua.channelLifetime=Channel Lifetime [ms]
dsEdit.opcua.sessionTimeout=Session Timeout [ms]
dsEdit.opcua.negotiationTimeout=Negotiation Timeout [ms]
dsEdit.opcua.requestTimeout=Request Timeout [ms]
dsEdit.opcua.defaultTimeout=Default Timeout [ms][TCP]
dsEdit.opcua.receiveBufferSize=Receiver Buffer Size
dsEdit.opcua.sendBufferSize=Send Buffer Size
dsEdit.opcua.maxMessageSize=Max Message Size
Expand Down

0 comments on commit c8d2585

Please sign in to comment.