Clone group into new private group on same client
NewGObj = clonegroup(GObj,'NewName')
NewGObj = clonegroup(GObj,'NewName') clones
dagroup object specified by
GObj, making a
NewGObj with name
NewName must be a unique group name.
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
Active property is configured to
GroupType property is configured to
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
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
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');