Object: StringBlock
- Updated2024-09-12
- 1 minute(s) read
(File | StringChannelFormatter) > Object: StringBlock
Object: StringBlock
The StringBlock object facilitates access to text, single values, and channel data in a text file.
If DirectAccess channels are associated with a StringBlock, the order of the values in a line determine which value belongs to which channel. The first value in the line belongs to the first channel, the second value in the line belongs to the second channel, and so on. The Delimiters property in the text file specifies the value limits. LineFeeds specifies the end of the line.
![]() | Note The file pointer of the text file does not move when a StringBlock is read. |
The following example reads a text file that consists of one time channel and one real channel. The example then generates a channel group and inserts the two channels:
Dim oBlock : Set oBlock = File.GetStringBlock() Dim oChn1 : Set oChn1 = oBlock.Channels.Add("Time", eTime) Dim oChn2 : Set oChn2 = oBlock.Channels.Add("YShift", eR64) Dim oMyGrp : Set oMyGrp = Root.ChannelGroups.Add("MyChannelGroup") Call oMyGrp.Channels.AddDirectAccessChannel(oChn1) Call oMyGrp.Channels.AddDirectAccessChannel(oChn2)