OPC UA client¶
Applications
Used to import objects and variables in design time or at runtime from an OPC UA server to create the desired application logics at runtime.
If imported at design time, the nodes remain synchronized with the server nodes in reading and writing even at runtime, (if the client has adequate permissions). At any time in design time, using the Q Studio dedicated editor, the nodes of interest to be imported can be selected. During import, for each node desired by the server, a corresponding project node is created.
Important
for nodes imported at design time, including object/variable types, corresponding BaseObject or BaseVariable nodes are created.
To import the nodes at runtime for more advanced uses, it is possible to choose different synchronization modes. In this case, the nodes are imported when the OPC UA Client object is initialized, i.e. at the project start-up at runtime.
Configuring the object
Configure the import of nodes at runtime
Click the OPC UA client.
In the Property panel, in Runtime configurations click : a configuration of nodes to import is added.
In the configuration just created, set the Locale destination node property and Remote source node, then set the import/synchronization mode. .. Note:: for now, the import of graphical objects and LocalizationDictionary objects only functions in Import only mode.
Note
the selected source node automatically selects all its child nodes. To import only the child nodes, set Include remote source nodes to False.
To listen to the events generated by the selected nodes, do the following:
Set Enable event synchronization to True.
In Event type click and in the dynamic links window, inside the Types > EventTypes node, select the event type to listen to.
Repeat steps 2 to 4 for each configuration of nodes to be imported.
Safety configurations
Based on the values of the two Minimum message security mode and Minimum security policy* properties, the valid security configurations are the following, in order of increasing security:
Minimum security policy |
Minimum message security mode |
---|---|
None |
None |
Basic256Sha256 |
Signature |
Basic256Sha256 |
Signature and cryptography |
Aes128_Sha256_RsaOaep |
Signature |
Aes128_Sha256_RsaOaep |
Signature and cryptography |
Aes256_Sha256_RsaPss |
Signature |
Aes256_Sha256_RsaPss |
Signature and cryptography |
When the client connects to the server, they choose the endpoint with the most secure configuration and that meets the minimum requirements indicated in the minimum message security mode and minimum security policy.
Verify Server Identity
For security issues, it is recommended to always set the Verity Server identity property to True and to manually add the certificate to those trusted. In fact, the public key contained in the certificate is used to encrypt the user password in the authentication mode requiring credentials (User identity type = User/Password), even if communication with the server is not secure (Minimum message security mode = None).
If any certificate is accepted temporarily, the password could be sent to a malicious server. if the Verify Server Identity property is set to True and the server certificate is not one of those trusted, the client continues to attempt the connection without success.
Properties¶
Name |
BrowseName |
DataType |
Description |
---|---|---|---|
Server endpoint URL | ServerEndpointURL |
Communications protocol and network address of the endpoint on the server. |
|
Verify server identity | VerifyServerIdentity |
Validates the server’s public certificate. True = accept the certificate only if trusted False = temporarily accept the certificate even if it not trusted. |
|
Requested publishing interval | RequestedPublishingInterval |
||
Minimum message security mode | MinimumMessageSecurityMode |
Minimum security level for messages exchanged between client and server. None = the messages can be unsigned and unencrypted; Signature = the messages must be signed or signed and encrypted; Signature and encryption = the messages must be signed and encrypted. |
|
Minimum security policy | MinimumSecurityPolicy |
Minimum security level for messages exchanged between client and server. None = the client does not require any specific security policy; Basic256Sha256 = this policy or more secure; Aes128_Sha256_RsaOaep = this policy or more secure; Aes256_Sha256_RsaPss = this policy. |
|
Client certificate file | ClientCertificateFile |
Client public certificate file, according to standard X509v3 and with .der extension. It must be found in the QApplication/ProjectFiles/PKI/Own/Client/ folder. |
|
Client private key file | ClientPrivateKeyFile |
Client private key file, with ASCII Base64 encoding and .pem extension. It must be found in the QApplication/ProjectFiles/PKI/Own/Client/ folder. |
|
User identity type | UserIdentityType |
This is the method for identification of the user. Anonymous = no information on the user available; User/Password = user identified by username and password; Certificate = user identified by a certificate. |
|
Username | Username |
||
Password | Password |
||
User certificate file | UserCertificateFile |
The user’s public certification file, type X509v3 and with .der extension. It must be found in the QApplication/ProjectFiles/PKI/Own/User/ folder. |
|
User private key file | UserPrivateKeyFile |
User private key file, with ASCII Base64 encoding and .pem extension. It must be found in the QApplication/ProjectFiles/PKI/Own/User/ folder. |
|
Application URI | ApplicationURI |
URI that globally identifies the application instance |
|
Application name | ApplicationName |
A legible ID of the application instance, not necessarily unique |
|
Product URI | ProductURI |
URI that globally identifies the software |
|
Connection status | ConnectionStatus |
||
Server URI | ServerUri |
||
Enabled | Enabled |
Enables the object. |
|
Events | Events |
||
Synchronize the Node IDs on start | SynchronizeNodeIdsOnStart |
Synchronize the NodeIDs of the OPC UA nodes imported at design time with the NodeIDs of the same nodes on the server to which the client connects at runtime. If the situation on the server is not known, set it to True. |
|
Objects |
|||
Runtime configurations | RuntimeConfigurations |
Collection of RuntimeConfigurationEntry |
Methods¶
Subscribe to data change¶
BrowseName: SubscribeToDataChange
InputArguments
Name |
DataType |
Description |
---|---|---|
ReadValues |
ReadValue |
Read values |
Unsubscribe from data change¶
BrowseName: UnsubscribeFromDataChange
InputArguments
Name |
DataType |
Description |
---|---|---|
ReadValues |
ReadValue |
Translate browse paths to Node IDs (NodeIds)¶
BrowseName: TranslateBrowsePathsToNodeIds
InputArguments
Name |
DataType |
Description |
---|---|---|
BrowsePaths |
BaseDataType |
Browse paths list |
OutputArguments
Name |
DataType |
Description |
---|---|---|
NodeIds |
NodeId |
NodeIds list |
Read values¶
BrowseName: ReadValues
InputArguments
Name |
DataType |
Description |
---|---|---|
ReadValues |
ReadValue |
Read values |
OutputArguments
Name |
DataType |
Description |
---|---|---|
ReadValueResults |
ReadValueResult |
Read value results |
Asynchronous read values¶
BrowseName: ReadValuesAsync
InputArguments
Name |
DataType |
Description |
---|---|---|
OperationId |
Guid |
Operation ID |
ReadValues |
ReadValue |
Read values |
Write values¶
BrowseName: WriteValues
InputArguments
Name |
DataType |
Description |
---|---|---|
WriteValues |
WriteValue |
Values to write |
OutputArguments
Name |
DataType |
Description |
---|---|---|
WriteValueResults |
WriteValueResult |
Call method¶
BrowseName: CallMethod
InputArguments
Name |
DataType |
Description |
---|---|---|
TargetNode |
NodeId |
|
Method |
NodeId |
Method |
InputArguments |
BaseDataType |
Input arguments |
OutputArguments
Name |
DataType |
Description |
---|---|---|
ErrorCode |
UInt32 |
Error code |
OutputArguments |
BaseDataType |
Output arguments |
Browse¶
BrowseName: Browse
InputArguments
Name |
DataType |
Description |
---|---|---|
NodeId |
NodeId |
Node ID of the node to browse |
BrowseDirection |
BrowseDirectionEnum |
Reference browse direction |
ReferenceTypeId |
NodeId |
Node ID of the reference type to browse |
IncludeSubtypes |
Boolean |
Indicates whether subtypes of the reference type should be browsed |
OutputArguments
Name |
DataType |
Description |
---|---|---|
Result |
StatusCode |
OPC UA-defined result code |
References |
ReferenceDescription |
Reference descriptions |
Import nodes¶
BrowseName: ImportNodes
InputArguments
Name |
DataType |
Description |
---|---|---|
NodesToImport |
NodeId |
Nodes to import |
RecursiveImport |
Boolean |
Recursive import |
See also
Concetti correlati
Procedure correlate
How to use an OPC UA Client object
Esempi applicativi
Import translations from another project
Import the user interface from another project and monitor some variables