Read from input file
This block allows user to read data in a file with the name defined with the Input File Name parameter, in text formatted mode or in binary mode.
The file is a sequence of records. Each record has the length Record Size + 1 and the structure shown below:
The Time Record Selection parameter allows to user the selection of one field in the record which represents time events. When this parameter is set, an activation output is added to the block to return these events to the user. With a feedback of the activation output to the event input of the block, the records are read in sequence until file end as in the example below.
The Outputs Record Selection is used to select the record’s fields which will be included in the regular output.
The Output Format parameter gives the record format.
Each event on the activation input of the block advances one record in the file.
This example reads the file: “SCI/modules/xcos/examples/sources_pal/en_US/rfile_f.txt” which contains a set of data generated by the example of the WFILE_f block help page.
It use its activation output as event input of CSCOPE. In the file, the first field of the record is the time, the two others are regular data. The feedback of the activation output on event input ensures the file sequential read. Open this example in Xcos .