With this function block, saved data can be read from a file and loaded into a connected matrix (vector, single value).
The matrix (vector, single value) VX will be filled with the elements loaded from the file FName. If the dimension of an object at VX does not correspond to the dimension of the data in the file, fitting elements will be transferred, nonetheless (see example below).
Data will only be read, if a positive going edge occurs on the Trigger input. Before loading any date, the data type of the elements in the file are checked. Only if the data is compatible to VX the file will be read.
The output Num gives the number of read elements. A negative value indicates an error or shows that the function block is not operating:
|Function block does not operate
|No file name given
|Could not open file
|Unknown/invalid file format
|Date type incompatible
|Error in the file header
|Target function not available
Trigger -> change to HIGH = Read data
|Data type independent
|Trigger to read data
|Number of read elements or status information
The selected data type will be displayed by the assorted color.
The file name must follow the principles of the target system. This covers the conventions for the name itself (e.q. accepted characters) and the use of relative or absolute path information.