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

Nc programming
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

<file name>:
Example
Program code
N10 DEF INT ERROR
N15 STOPRE
N20 DELETE(ERROR,"/_N_SPF_DIR/_N_TEST1_SPF")
N30 IF ERROR
N40 MSG("error for DELETE command:" <<ERROR)
N50 M0
N60 ENDIF
3.5.3

Read lines in the file (READ)

The READ command reads one or several lines in the specified file and stores the information
read in a STRING type array. In this array, each read line occupies an array element.
Requirement
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 (return value of error variable = 13).
Syntax
DEF INT <error>
DEF STRING[<string length>] <result>[<n>,<m>]
READ(<error>,"<file name>",<start line>,<number of lines>,<result>)
NC programming
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0
Name of the file to be deleted
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 selected
program).
Rules regarding path data, see "Addressing program memory files (Page 554)".
Work preparation
3.5 File handling
Comment
; Definition of error variables.
; Preprocessing stop.
; Deletes file TEST1 in the sub-
program directory.
; Error evaluation.
569

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de sl

Table of Contents