Meaning
READ: Command for reading lines from the specified file and storing these lines in a
variable array.
<error>: Variable for returning the error value (call-by-reference parameter)
Type. INT
Value: 0 No error
1 Path not allowed
2 Path not found
3 File not found
4 Incorrect file type
11 The file is in use
13 Insufficient access rights
21 Line does not exist (<start line> or <number of
lines> parameter exceeds the number of lines in the
specified file).
22 Field length of the result variable (<result>) is too
small.
23 Line range too large (<number of lines> parameter
selected so large that the read would go beyond the end
of the file).
<file name>: Name of the file to be read (call-by-value parameter)
Type: STRING
The absolute path can be specified before the actual file name. If a path is not
specified, the file is searched for in the current directory (= directory of selec‐
ted program).
Rules regarding path data, see "Addressing program memory files
(Page 554)".
<start line>: Start line of the file section to be read (call-by-value parameter)
Type: INT
Value: 0 Reads the number of lines specified with
the <number of lines> parameter before the
end of the file.
1 to n Number of the first line to be read.
<number of
lines>:
Number of lines to be read (call-by-value parameter)
Type: INT
<result>: Result variable (call-by-reference parameter)
Variable array in which the read text is stored.
Type: STRING (max. length: 255)
If fewer lines are specified in the <number of lines> parameter than the
array size [<n>,<m>] of the result variable, the remaining array elements will
not be modified.
Termination of a line by means of the control characters "LF" (Line Feed) or
"CR LF" (Carriage Return Line Feed) is not stored in the result variable.
Read lines are cropped if the line is longer than the defined string length. An
error message is not output.
Work preparation
3.5 File handling
NC programming
570 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0