Method: GetFixedWidthBlock for File
- Updated2024-09-12
- 1 minute(s) read
DataPlugin > Methods > Method: GetFixedWidthBlock for File
Method: GetFixedWidthBlock for File
Reads a text file and returns the channel values contained in the file.
| Note The file pointer of the binary file does not move when a BinaryBlock is read. |
Set oFixedWidthBlock = Object.GetFixedWidthBlock
| Object | File Object with this method |
| oFixedWidthBlock | FixedWidthBlock Returned object |
The following example reads the values of a channel from a text file. Four characters of a text line correspond to one channel value. Each text line contains two channel values:
Dim oBlock: Set oBlock = File.GetFixedWidthBlock Dim oChannelGroup: Set oChannelGroup = Root.ChannelGroups.Add("Channelgroup") Dim oChn1 : Set oChn1 = oBlock.Channels.Add("Channel1", eI32) oChn1.Formatter.CharacterCount = 4 oChn1.Formatter.SampleWidth = 2 Call oChannelGroup.Channels.AddDirectAccessChannel(oChn1) oBlock.Position = File.Position