Check For Presence Of File (Isfile) - Siemens SINUMERIK 840D sl Programming Manual

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

Advertisement

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_TEST-
FILE_MPF",1,5,RESULT)
N40 IF ERROR <>0
N50 MSG("ERROR"<<ERROR<<"ON READ COMMAND")
N60 M0
N70 ENDIF
...
3.5.4

Check for presence of file (ISFILE)

The ISFILEcommand checks whether a file exists in the program memory.
Syntax
<Result>=ISFILE("<File name>")
Meaning
ISFILE:
<file name>:
<result>:
NC programming
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0
Command to check the availability of a file
Name of the file whose availability is to be checked.
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)".
Result variable to which the result of the check is assigned.
Type.
BOOL
Value:
TRUE
FALSE
Comment
; Definition of error variables.
; Definition of result variables.
;File name with domain and file iden-
tifier
and path name.
;Error evaluation.
File exists
File does not exist
Work preparation
3.5 File handling
571

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de sl

Table of Contents