Siemens SINUMERIK 840D sl Programming Manual page 156

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

Advertisement

Flexible NC programming
1.20 Read lines in the file (READ)
<start line>:
<number of
lines>:
<result>:
Note
Binary files cannot be read in. The "incorrect data type" error is output (return value of the
error variable = 4). The following types of file are not readable: _BIN, _EXE, _OBJ, _LIB,
_BOT, _TRC, _ACC, _CYC, _NCK.
Example
Program code
N10 DEF INT ERROR
N20 DEF STRING[255] RESULT[5]
N30 READ(ERROR,"/_N_CST_DIR/_N_TESTFILE_MPF",1,5,RESULT)
N40 IF ERROR <>0
N50 MSG("ERROR"<<ERROR<<"ON READ COMMAND")
N60 M0
N70 ENDIF
...
156
Start line of the section of the file to be read (call-by-value
parameter)
Type:
INT
Value:
0
1 to n
Number of lines to be read (call-by-value parameter)
Type:
INT
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.
Reads the number of lines specified with the
<number of lines> parameter before the
end of the file.
Number of the first line to be read.
Comment
; Definition of error variables.
; Definition of result variables.
; Filename with domain, file
identifier and path
specification.
; Error evaluation.
Programming Manual, 06/2009, 6FC5398-2BP20-0BA0
Job Planning

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents