Main Content

connect

Connect client object to OPC server

Description

connect(Obj) connects the opchda object Obj to the OPC server that specified by the object Host and ServerID properties. When you connect Obj, its Status property takes the value 'connected'. You can disconnect Obj from the server with the disconnect function, which sets the Status property value to 'disconnected'.

If Obj is an array of objects and the function cannot connect some of these objects, it generates a warning. If the function cannot connect any of the objects, it generates an error.

example

Examples

collapse all

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

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

Input Arguments

collapse all

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

Example: opchda()

Version History

Introduced before R2006a

See Also

Functions