Reads int32
data from a file on the SD card.
An SD card is required to use this function.
In the function menu | On the diagram |
---|---|
![]() |
![]() |
Name | Value Type | Description |
---|---|---|
id |
int32 |
File identifier.The file identifier is used to generate the file name on the SD card. For more about the file name format, see the SD card article |
get |
bool |
Read trigger. The function starts on a rising edge and continues trying until successful execution, an error, or receiving False on the get input. |
index |
int32 |
Index of the array element from which to start reading. The first buffer element has index 0. |
Name | Value Type | Description |
---|---|---|
ended |
bool |
Function completion indicator: 1 – completed 0 – not completed |
status |
int32 |
Function status: 0 – idle 1 – opening 2 – closing 3 – closing (after error) 4 – seeking 5 – reading -1 – operation not supported -2 – operation unavailable -3 – file not accessible -4 – invalid element index -5 – error |
count |
int32 |
Number of elements read |
value0 |
int32 |
Value of the element at the specified index |
... | ... | ... |
valueN-1 |
int32 |
Value of the element at index (index + N - 1) *N – number of value outputs, set via the Number of Outputs setting |
0 -> 1 -> 5 -> 2 -> 0 // final status on success
| | |
| | * -> 3 -> [-1 .. -5] // error during execution
| |
| * -> 3 -> [-1 .. -5] // error after opening
|
* -> [-1 .. -5] // error before opening
Name | Description |
---|---|
Number of Outputs | Configures the number of value output lines. |
A file with id = 1 contains the int32
array [11, 22, 33, 44, 9505, -6]. When reading from the first element (index = 0), the outputs will be:
Now, reading from the second element (index = 1), the outputs will be: