Read: Read Lines In The File - Siemens SINUMERIK 840D sl Programming Manual

Job planning
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

Flexible NC programming

1.20 READ: Read lines in the file

1.20
READ: Read lines in the file
1.20
Function
The READ command reads one or several lines in the file specified and stores the
information read in an array of type STRING. In this array, each read line occupies an array
element.
The currently set protection level must be equal to or greater than the READ right of the file.
If this is not the case, access is denied with an error message (error=13).
Programming
READ(VAR INT error, STRING[160] file, INT line, INT number, VAR
STRING[255] result[])
Parameter
READ
error
file
line
number
1-64
Read one or more lines in the specified file and store in an
array element of an array.
The information is available as STRING.
Error variable for return (call-by-reference parameter, type
INT)
0: No error
1: Path not allowed
2: Path not found
3: File not found
4: Incorrect file type
13: Insufficient access rights
21: Line not present ("line" or "number" parameter
larger than the number of lines in the file)
22: Array length of result variable "result" is too small
23: Line range too large ("number" parameter
selected so large that the read would go beyond the end of
the file)
Name/path of the file to be read (call-by-value parameter of
type STRING with a max. length of 160 bytes). The file must be
stored in the user memory of the NCK (passive file system).
The file name can be preceded by the domain identifier _N_. If
the domain identifier is missing, it is added correspondingly.
The file identifier ("_" plus 3 characters), e.g., _SPF) is
optional.
If there is no identifier, the file name is automatically
added _MPF.
If there is no path specified in "file", the file is searched
for in the current directory (=directory of selected program).
If a path is specified in "file", it must start with a slash
"/" (absolute path indication).
Position indication of the line range to be read
(call-by-value parameter of type INT).
0:
The number of lines specified with the "number"
parameter before the file end are read.
1 to n:
Number of the first line to be read.
Number of lines to be read (call-by-value parameter of type
INT).
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
Job planning

Advertisement

Table of Contents
loading

Table of Contents