Products & Services Solutions Academia Support User Community Company

Learn more about OPC Toolbox   

clonegroup - Clone group into new private group on same client

Syntax

NewGObj = clonegroup(GObj,'NewName')

Description

NewGObj = clonegroup(GObj,'NewName') clones the dagroup object specified by GObj, making a private group NewGObj with name NewName. NewName must be a unique group name. GObj can be a private group or a public group.

The new group NewGObj is independent of the original group, but with the same parent (opcda object) and the same items as that group. All the group and item properties are duplicated with the exception of the following:

Not all OPC data access servers support the cloning of groups. To use this functionality, your server must support public groups. If you try to clone a group on a server that does not support public groups, an error is generated. To verify that a server supports public groups, use the opcserverinfo function on the client connected to that server: Look for an entry 'IOPCPublicGroups' in the 'SupportedInterfaces' field.

You use clonegroup primarily when you want to create a private duplicate of a public group that you can then modify. If you want to create a copy of a group in another client, use the copyobj function.

Examples

Create a fictitious client and configure a group with two items. Do not connect to the server.

da = opcda('localhost', 'Dummy.Server');
grp1 = addgroup(da, 'OriginalGroup');
itm1 = additem(grp1, 'Device1.Item1');
itm2 = additem(grp1, 'Device1.Item2');

Clone the group:

grp2 = clonegroup(grp1, 'ClonedGroup');

See Also

copyobj | makepublic

  


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