Main Content

isConnected

Determine if OPC UA client object is connected to server

Description

connected = isConnected(uaClient) returns true (logical 1) if the client UaClient is connected to the server, or false (logical 0) otherwise. If uaClient is a vector of client objects, tf is a vector representing the connected state of each client.

example

Examples

collapse all

Connect an OPC UA client and view its connection status.

uaClient = opcua("opc.tcp://localhost:53530/OPCUA/SimulationServer");
connect(uaClient);
isClientConnected = isConnected(uaClient)
isClientConnected =

  logical

   1

Disconnect the client and review its connection status.

disconnect(uaClient);
isClientConnected = isConnected(uaClient)
isClientConnected =

  logical

   0

Input Arguments

collapse all

OPC UA client, specified as an OPC UA client object or array of objects.

Example: isConnected(uaClient)

Output Arguments

collapse all

Connection status, returned as a logical value or array of logical values. A value of true (1) indicates that the client is connected to an OPC UA server.

Version History

Introduced in R2015b

See Also

Functions