Main Content

isConnected

Determine if HDA client is connected to server

Description

isConnected(hdaObj) returns true if the OPC HDA client object specified in hdaObj is connected to an OPC HDA server, and false otherwise.

If hdaObj is an array, isConnected returns an array of true or false values that is of the same size as hdaObj.

example

Examples

collapse all

Create an HDA client for Matrikon™ Simulation Server and connect to the server.

hdaObj = opchda('localhost', 'Matrikon.OPC.Simulation');
connect(hdaObj);

Check the status of the connection.

isClientConnected = isConnected(hdaObj)
isClientConnected =

  logical

   1

Input Arguments

collapse all

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

Example: Obj = opchda(_)

Version History

Introduced in R2011a

See Also

Functions