matlab copyobj 颜色,Make copy of OPC data access object

copyobj

Make copy of OPC data access object

Syntax

NewObj = copyobj(Obj)

NewObj = copyobj(Obj, ParentObj)

Description

NewObj = copyobj(Obj) makes a copy of all

the objects in Obj, and returns them in

NewObj. Obj can be a scalar OPC Toolbox™ object, or a vector of toolbox objects.

NewObj = copyobj(Obj, ParentObj) makes a

copy of the objects in Obj inside the parent object

ParentObj. ParentObj must be a valid

scalar parent object for Obj. If any objects in

Obj cannot be created in ParentObj, a

warning will be generated.

A copied toolbox object contains new versions of all children, their children, and

any parents that are required to construct that object. A copied object is different

from its parent object in the following ways:

The values of read-only properties will not be copied to the new object.

For example, if an object is saved with a Status property value of

'connected', the object will be recreated with a

Status property value of

'disconnected' (the default value). You can use

propinfo to determine if a

property is read-only. Specifically, a connected opcda

object is copied in the disconnected state, and a copy of a logging

dagroup object is not reset to the logging

state.

A copied dagroup object that has records in memory from

a logging session is copied without those records.

OPC HDA objects do not support copyobj.

Examples

Create a connected Data Access client with a group containing an item:

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

connect(da1);

grp1 = addgroup(da1, 'CopyobjEx');

itm1 = additem(grp1, 'Random.Real8');

Copy the client object. This also copies the group and item objects.

da2 = copyobj(da1);

grp2 = da2.Group

Change the first group name, and note that the second group name is

unchanged:

grp1.Name = 'NewGroupName';

grp2.Name

Introduced before R2006a

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值