Products & Services Solutions Academia Support User Community Company

Learn more about OPC Toolbox   

connect - Connect opcda object to server

Syntax

connect(DAObj)

Description

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

If DAObj is an array of objects and the function cannot connect some of these objects, it generates a warning message. If the function can connect none of the objects, it generates an error message.

It is possible to create groups and items before connecting to the server. However, servers impose restrictions on client group and item names. Therefore, if you create a group hierarchy and then connect to the server, connect automatically deletes groups or items that the server cannot support, and issues a warning message.

Examples

Create a Data Access client and connect to the server:

da = opcda('localhost', 'Matrikon.OPC.Simulation');
connect(da);

See Also

disconnect

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS