CopyFrom Method

Measurement Studio User Interface

CopyFrom Method

Syntax

CWData.CopyFrom Source

Purpose

Copies the value and attributes from another CWData object.

Remarks

If the destination CWData is associated with a CWDataSocket connection, copying to it triggers the CWDataSocket.Update method if it is connected with the AccessMode set to cwdsWriteAutoUpdate.

Parameters

Source As CWData

The CWData object to copy data from.

Example

'Copy the current value and attributes from a CWDataSocket's data

dim CWData1 as new CWData
CWData1.CopyFrom CWDataSocket1.Data

'Make some changes to the copy
CWData1.Value = 1
CWData1.SetAttribute("SampleRate", 10000)

'Copy data back to a DataSocket's data
CWDataSocket1.Data.CopyFrom CWData1