Object: FixedWidthBlock
- Updated2024-09-12
- 1 minute(s) read
(File | FixedWidthChannelFormatter) > Object: FixedWidthBlock
Object: FixedWidthBlock
Use the FixedWidthBlock object to access channel data in a text file.
The data in this text file is not separated by a specific separator. The data is separated at a specific number of characters, which you specify in the CharacterCount property.
| Note The file pointer of the text file does not move when a FixedWidthBlock is read out. |
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