Read From File

<< Click to Display Table of Contents >>

Navigation:  Waijung Blockset > Block References > Misc > File Stream >

Read From File

Previous pageReturn to chapter overviewNext page

User Interface

How this block appears in a Simulink model?

filestream_readfromfile_block

What can be configured?

filestream_readfromfile_mask

Configuration item

Selectable option/ Value

Description

Data type

double | single | int8 | uint8 | int16 | uint16 | int32 | uint32

Specific data type to read from file.

Data count

(Number of data to read)


Sample time (sec)

(Sample time)

Specify block sample time

Input port

1. File Path

This input port specify file name to open for Read. It can be:

1.1 String pointer, which from "Volatile Data Storage Read" block of variable type "String".

1.2 Vector data of uint8. Note: the data vector must contain 0 to indicate NULL terminate string, example: uint8(['file1.txt' 0])

2. Seek Pos

Specify data read position of file.

4. Close

0 : Do not close file after read.

non-zero : Close file after read.

Output port

1. Status

0: Success, otherwise fail.

2. TotalSize

File size in bytes.

3. CurrentPos

Current file position after read data.

4. Data (Datatype)

The output data from file.

Demos

Device Boot Loader (SD Card)