DIAdem Help

Method: GetValuesBlock for Channel <Data>

  • Updated2024-09-12
  • 2 minute(s) read

Method: GetValuesBlock for Channel <Data>

Reads out a block of values from a channel in the Data Portal and writes these values into an array.

vGetValuesBlock = Object.GetValuesBlock([Index], [Count], [BlockArrayMode])
ObjectChannel <Data>
Object with this method
[Index]LongInteger
Specifies the first value of the array to be read out. The index starts at the value 1 (default value).
[Count]LongInteger
Specifies the number of values to read out. The default value is the channel length minus the index plus 1.
[BlockArrayMode]Enumeration with the following selection terms:
 0
eValueBlockVbArray 
VBS Array (Default)
 1
eValueBlockSafeArray 
Type-safe array. You cannot access this array from VBS scripts. However, you can exchange the data with other applications that expect type-safe arrays.
2eValueBlockDValueVbArrayVBS array with double values.
3 eValueBlockDValueSafeArrayType-safe array with double values.
vGetValuesBlockVariant
Receives an array with the read out values. The array elements are the same element type as the read out elements.

Note  If the sum of the parameters Index and Count is greater than the value of Channel.Size, DIAdem outputs an error.

Note  If the channel to be read our is a date/time channel and you assign the values eValueBlockVbArray or eValueBlockSafeArray to the BlockArrayMode parameter, the values of the result array are a vbDate type.

The following example reads out the first two values of the first channel of the default group and overwrites the first two values of the second channel in the default group with these values.

VBScriptPython

 

Dim oMyChannel1, oMyChannel2, MyArray
Set oMyChannel1 = Data.Root.ActiveChannelGroup.Channels(1)
MyArray = oMyChannel1.GetValuesBlock(1,2)
Set oMyChannel2 = Data.Root.ActiveChannelGroup.Channels(2)
Call oMyChannel2.SetValuesBlock(MyArray, 1, eValueBlockValueOverwrite)

Log in to get a better experience