Write to output file
This block allows user to save data in a file with the name defined with the Output File Name parameter, in text formatted mode or in binary mode.
The file is a sequence of records. Each record has a length Output Size + 1 and the structure shown below:
where the first field is the date of the event received on the activation input of the block during the simulation and other fields the regular input data. Each call to the bloc writes a record in the file.
The Output Format parameter gives the record format.
In this example the block is used to record the output and its inverse of the sine wave generator. A multiplexer form the input vector of the WFILE_f block which record the data in the file “TMPDIR/wfile_f.text”. Then you can read these data with the block RFILE_f. Open this example in Xcos.
After the simulation of this example, you can see the contents of the file with Scinotes with the following command:
`scinotes`_(TMPDIR + "/wfile_f.txt")