Connect OPC Toolbox client to server
connect( connects the
Obj to the
OPC server that specified by the object
ServerID properties. When you connect
Status property takes the value
'connected'. You can
Obj from the server with the
disconnect function, which sets the
Status property value
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.
It is possible to create
opcda 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,
automatically deletes groups or items that the server cannot support, and issues a warning
Create a Data Access client and connect to the server.
da = opcda('localhost','Matrikon.OPC.Simulation'); connect(da);
Create an HDA client for the Matrikon™ Simulation Server and connect to the server.
hdaObj = opchda('localhost','Matrikon.OPC.Simulation'); connect(hdaObj);
Obj— OPC client object
OPC client object, specified as an opcda object, opchda object, or an array of objects.