OpcUaServer
Description
The OpcUaServer object provides an OPC UA server to which OpcUaServerNamespace objects with corresponding child nodes can be added.
This object was introduced in InCore 2.3.
- › Inherits:
Overview
Properties
Methods
Signals
Properties
applicationName
This property holds the name of the application which to report as part of the server status.
This property was introduced in InCore 2.8.
- › Type:
String
- › Default:
SIINEOS- › Signal:
applicationNameChanged()
- › Attributes:
Writable
applicationUri
This property holds the URI of the application which to report as part of the server status.
This property was introduced in InCore 2.8.
- › Type:
String
- › Default:
https://www.inhub.de/siineos- › Signal:
applicationUriChanged()
- › Attributes:
Writable
enabled
This property holds whether the OPC UA server should listen for incoming connections.
- › Type:
Boolean
- › Default:
true- › Signal:
enabledChanged()
- › Attributes:
Writable
manufacturerName
This property holds the name of the manufacturer which to report as part of the server status.
This property was introduced in InCore 2.8.
- › Type:
String
- › Default:
in.hub GmbH- › Signal:
manufacturerNameChanged()
- › Attributes:
Writable
namespaces
- › Type:
- › Signal:
namespacesChanged()
- › Attributes:
Readonly
nodeSets
This property holds a list of OPC UA NodeSet files which to load at start.
This property was introduced in InCore 2.4.
- › Type:
StringList
- › Signal:
nodeSetsChanged()
- › Attributes:
Writable
port
This property holds the network port number which to listen at for incoming connections.
- › Type:
SignedInteger
- › Default:
4840- › Signal:
portChanged()
- › Attributes:
Writable
productName
This property holds the name of the product which to report as part of the server status.
This property was introduced in InCore 2.8.
- › Type:
String
- › Default:
SIINEOS- › Signal:
productNameChanged()
- › Attributes:
Writable
productUri
This property holds the URI of the product which to report as part of the server status.
This property was introduced in InCore 2.8.
- › Type:
String
- › Default:
https://www.inhub.de/siineos- › Signal:
productUriChanged()
- › Attributes:
Writable
security
This property holds the security settings for the server.
- › Type:
- › Attributes:
Readonly
softwareVersion
This property holds the version of the software which to report as part of the server status.
This property was introduced in InCore 2.8.
- › Type:
String
- › Default:
2.8.0- › Signal:
softwareVersionChanged()
- › Attributes:
Writable
users
- › Type:
- › Signal:
usersChanged()
- › Attributes:
Readonly
Methods
syncAllNodes()
This method synchronizes all nodes (which may have changed dynamically) with the underlying OPC UA server instance.
This method was introduced in InCore 2.6.
syncNode(OpcUaServerNode startNode)
This method recursively synchronizes the given nodes with the underlying OPC UA server instance.
This method was introduced in InCore 2.6.
Signals
namespacesDataChanged(SignedInteger index)
This signal is emitted whenever the List.dataChanged() signal is emitted, i.e. the item at index in the namespaces list itself emitted the dataChanged() signal.
usersDataChanged(SignedInteger index)
This signal is emitted whenever the List.dataChanged() signal is emitted, i.e. the item at index in the users list itself emitted the dataChanged() signal.
Example
import InCore.Foundation 2.8
import InCore.OpcUa 2.8
Application {
OpcUaServer {
security {
securityPolicies: OpcUaServerSecurity.SecurityPolicyNone | OpcUaServerSecurity.SecurityPolicyBasic256Sha256 | OpcUaServerSecurity.SecurityPolicyAes128Sha256RsaOaep | OpcUaServerSecurity.SecurityPolicyAes256Sha256RsaPss
userTokenPolicies: OpcUaServerSecurity.UserTokenPolicyAnonymous | OpcUaServerSecurity.UserTokenPolicyUsername | OpcUaServerSecurity.UserTokenPolicyCertificate
privateKeyFile: "certs/pki/private/ua-test-server.key"
certificateFile: "certs/pki/issued/ua-test-server.crt"
sessionTrustListFiles: ["certs/pki/issued/ua-test-client.crt"]
sessionIssuerListFiles: ["certs/pki/ca.crt"]
sessionRevocationListFiles: ["certs/pki/crl.pem"]
verifyApplicationUri: false
}
applicationUri: "urn:open62541.server.application"
users: [ OpcUaServerUser { name: "user"; password: "secret" } ]
OpcUaServerNamespace {
uri: "http://inhub.de/opcuaserverexample"
OpcUaServerObjectNode {
identifier: "s=Machine"
browseName: "Machine"
displayName.text: "My Machine"
description.text: "This is my awesome machine"
OpcUaServerValueNode {
identifier: "s=Machine.ExampleValue"
browseName: "ExampleValue"
displayName.text: "Example Value"
description.text: "This is an example value"
valueType: OpcUaType.Double
value: 123
property var t : Timer { onTriggered: parent.value = Math.random() }
readOnly: true
}
OpcUaServerMethodNode {
identifier: "s=Machine.RunMe"
browseName: "ExampleMethod"
displayName.text: "Example method"
method: (foo, bar) => {
console.log("hello world:", foo, bar)
return [ foo > 0, "thank you for calling" ]
}
inputArguments: [
OpcUaServerMethodArgument { name: "foo"; type: OpcUaType.Double },
OpcUaServerMethodArgument { name: "bar"; type: OpcUaType.String }
]
outputArguments: [
OpcUaServerMethodArgument { name: "out1"; type: OpcUaType.Boolean; description.text: "Foo is positive" },
OpcUaServerMethodArgument { name: "out2"; type: OpcUaType.String }
]
}
}
}
}
}