1
Flexible NC Programming 02.98
1.19 READ: Read lines in file
as from SW 5.2
1
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
ï›™
Siemens AG 2000. All rights reserved
1-86
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA)
−
04.00 Edition
Additional notes
•
Binary files cannot be read in. The error message
error=4:Wrong type of file is output. The following
types of file are not readable: _BIN, _EXE, _OBJ,
_LIB, _BOT, _TRC, _ACC, _CYC, _NCK.
•
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 error=13.
•
If the number of lines specified in the parameter
"number" is smaller than the array length of
"result", the other array elements are not altered.
•
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 target
variable "result". Read line are cut off, if the line is
longer than the string length of the target variable
"result". An error message is not output.
Programming example
N10 DEF INT ERROR
; Error variable
N20 STRING[255] RESULT[5]
; result variable
...
N30 READ(ERROR, "TESTFILE", 1, 5,
RESULT)
; file name without domain and file identifier
...
N30 READ (ERROR, "TESTFILE_MPF", 1, 5,
RESULT)
; file name without domain and with file
identifier
...
N30 READ(ERROR,"_N_TESTFILE_MPF",1,5,
RESULT)
; file name with domain and file identifier
...
N30 READ(ERROR,"/_N_CST_DIR/N_TESTFILE
_MPF", 1, 5 RESULT)
; file name with domain and file identifier and
path specification
^...
N40 IF ERROR <>0
; error evaluation
N50 MSG("ERROR"<<ERROR<<" WITH READ COMMAND")
N60 M0
N70 ENDIF
...