Main Content

disconnect

Disconnect client object from OPC server

Description

example

disconnect(Obj) disconnects the OPC client object Obj from the server. Obj can be an array of objects.

If the disconnection from the server was successful, the function sets the Obj property Status value to 'disconnected'. You can reconnect Obj to the server with the connect function.

If Obj is an array of objects and the function cannot disconnect some of the objects from the server, it disconnects the remaining objects in the array and issues a warning. If the function can disconnect none of the objects from their server, it generates an error.

Examples

collapse all

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

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

Check the status of the connection.

hdaObj.Status

Disconnect from the server and check the status again.

disconnect(hdaObj);
hdaObj.Status

Version History

Introduced before R2006a

See Also

Functions