FILE_READ Function Block
The FILE_READ function block is used to read data from a file on the SD memory card. A FileID is used to identify which file to read data from. FILE_SEEK may need to be used to move the file pointer to a position that has data.
| Element Name | Element Type | Description |
|---|---|---|
| REQ | Input | Edge detected request to execute the function block. |
| FileID | Input | File identification number for the file to read from. |
| ReadAddr | Input | Address of the data to read. |
| Size | Input | Size of the data to read. If read data is an array, the number of elements equal to Size input will be read. |
| DONE | Output | Function block status for reading the file. |
| BUSY | Output | Function block is busy reading the file. |
| ReadSize | Output | The amount of data that has successfully been read. |
| STAT | Output | Outputs an error number if a problem occurs. |
| STAT Number | Error Status |
|---|---|
| 0 | Normal |
| 1 | Failed to access SD memory card |
| 2 | The file with FileID is not open |
| 3 | Size is 0 for an Array type or there is no data to read |
LM312-3