connect
Connect OPC UA client to server
Syntax
Description
connect(
connects the OPC UA client
uaClient
)uaClient
to its server using anonymous user authentication.
Industrial Communication Toolbox™ generates a user-specific application instance client certificate. (since R2025a)
To connect to an OPC UA server with the new client certificate, export the certificate
using the exportClientCertificate
function and then transfer the certificate to the
trust store of your OPC UA server.
connect(
connects the OPC UA client uaClient
,publicKeyFilename
,privateKeyFileName
,privateKeyPassword
)uaClient
to its server using the User
Certificate stored in the public and private key files referenced by
publicKeyFilename
and privateKeyFilename
.
privateKeyPassword
is the password used to protect the private key
file. Private key files for OPC must be password protected.
When the client successfully connects to the server, the client object
Status
property is set to 'Connected'
, the first
level of the server namespace is retrieved, and properties of the client are read from the
server.
If uaClient
is a vector of clients, and some but not all clients can
connect, a warning is issued. If no clients can connect, an error is generated. You can only
connect a vector of clients using the same username and password, or the same certificate
parameters. If you need to use different usernames and passwords for different servers, call
connect
on each of the clients individually.
Examples
Input Arguments
Version History
Introduced in R2015b