Method: Add for BinaryDirectAccessChannels
- Updated2024-09-12
- 2 minute(s) read
DataPlugin > Methods > Method: Add for BinaryDirectAccessChannels
Method: Add for BinaryDirectAccessChannels
Adds an object to the Channels collection of a BinaryBlock and returns a DirectAccessChannel object.
Set oDirectAccessChannel = Object.Add(Name, DataType, [ContiguousValues])
Object | BinaryDirectAccessChannels Object with this method | ||||||||||||||||||||||||||||||||||||||||||
Name | String Specifies the name of the channel. | ||||||||||||||||||||||||||||||||||||||||||
DataType | Specifies the data type of the channel. Enumeration with the following selection terms:
| ||||||||||||||||||||||||||||||||||||||||||
[ContiguousValues] | LongInteger Specifies how many values of a block belong to a channel. The value -1 means that the number of values based on the number of channels are calculated automatically. | ||||||||||||||||||||||||||||||||||||||||||
oDirectAccessChannel | DirectAccessChannel Returned object |
The following example reads a binary file that contains three channels with 32-bit integer values. The channel data is in blocks. A block is structured in such a way that the first three values belong to the first channel, the fourth value belongs to the second channel, and the fifth and sixth values belong to the third channel:
Dim oBlock : Set oBlock = File.GetBinaryBlock() Dim oChn1 : Set oChn1 = oBlock.Channels.Add("Channel1", eI32, 3) Dim oChn2 : Set oChn2 = oBlock.Channels.Add("Channel2", eI32, 1) Dim oChn3 : Set oChn3 = oBlock.Channels.Add("Channel3", eI32, 2)