DIAdem Help

Method: GetFixedWidthBlock for File

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

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
ObjectFile
Object with this method
oFixedWidthBlockFixedWidthBlock
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

Log in to get a better experience