
The Function Block FS_READLINE reads data line by line from a file.
Warning: When reading very large files, the PLC or the entire system may crash and not start again.
Note: The maximum readable size of a line is 1024'000 bytes for safety reasons.
The file system must have been initialized beforehand using FS_INIT. All operations are performed asynchronously per storage medium created.
A positive edge reads the data from the storage medium.
Defines the device from which files should be accessed. The device is used per project and can be managed in the context menu under Project External Storage.
Specifies the path to the file on the storage medium. The path corresponds to a Unix file path in UTF-8 format, if this is supported. The path is represented as follows:
Folder/Subfolder/File.txt
Defines the line that should be read. The first line starts with the number 0.
Defines the line break. This is specified with escapes: "\r\n". If the input is not defined, "\n" is assumed.
The following characters respect the escape:
Note: To also define binary characters, such as '\xEF', they must be defined in single quotes.
The output returns a pulse on success to perform the next operation. The pulse occurs when the process ends, even if an error has occurred.
Returns the read line, including the line end. The state is stored for later use.
If the end of the file has been reached, the input is true.
If the UTF-8 Byte Order Mark was found, the output is true. The BOM is determined with each read operation.
In case of an error, returns a text with an error message. This is FALSE if no error has occurred. The state is stored for later use.
Possible causes: