Method: GetValuesBlock for Channel <Data>
- Updated2024-09-12
- 2 minute(s) read
Internal Data > Methods > Method: GetValuesBlock for Channel <Data>
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])
| Object | Channel <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:
| ||||||||||||
| vGetValuesBlock | Variant 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.
| VBScript | Python |
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)
