The InputRecordStream and OutputRecordStream Interfaces
- Updated2025-07-21
- 2 minute(s) read
The InputRecordStream and OutputRecordStream Interfaces
At the core of the Data Streams API are two interfaces: InputRecordStream and OutputRecordStream. These interfaces expose methods related to reading and writing data that can logically be thought to consist of an ordered set of records with each record made up of an ordered set of fields. TestStand provides one implementation of each:
- CsvFileInputRecordStream — An InputRecordStream for reading CSV files
- CsvFileOutputRecordStream — An OutputRecordStream for writing to CSV files
For CSV file record streams, each row corresponds to a record, and each column corresponds to a field, but there is no requirement that alternative record stream implementations be based on CSV files. Alternatives include text files with other (non-CSV) formats, binary files that store data in some form of table, and relational databases.
The InputRecordStream interface consists of five methods and properties: ReadRecord(), ReadRecordTo(), FieldMapping, SkipRecords(), and Close(). The OutputRecordStream interface consists of five methods: WriteRecord(), WriteRecordFrom(), Flush(), Close(), and GetStreamInfo(). None of these methods make reference to a file, underlying path, or a separator character. Any COM server that can satisfy requests to read records, skip records, etc. can be an InputRecordStream. Similarly, any COM server that can satisfy requests to write records, etc. can be an OutputRecordStream. Not only does the underlying data store not need to be a file, there need not be any underlying data store at all. For example, an InputRecordStream could implement ReadRecord() by generating data as needed based on an algorithm.
The For Each and Write Record step types use the base InputRecordStream and OutputRecordStream interfaces. Sequences written using these step types and/or the base InputRecordStream and OutputRecordStream interfaces will be forward compatible with other record streams you, National Instruments, or TestStand value added resellers create in the future.