Definition of file names (#FILE NAME)

The command #FILE NAME defines file names in NC program file. The file names are used by specific NC functions, e.g. to create a report file or to call a NC program.

Syntax:

#FILE NAME [ <file_ID>="<filename>" { <file_ID>="<filename>" } ]

<file_id>

MSG: Name of the report file for #MSG SAVE.

Default name is "message.txt".

M6: Name of the global subroutine for implicit program call via M6 in the NC program. The name is valid until M30. M6 is not treated as an M function any more.

The default name is set in P-CHAN-00118. M6 is always executed as the last action at block end.

D: Name of the global subroutine for implicit program call by a D word in the NC program. The name is valid until M30.

The default name is set in P-CHAN-00429. The subroutine call is always executed as the last action at block end.

G80 – G89: Name of the global subroutines for implicit program calls at G80 –G89 in the NC program. The names are valid until M30.

Default names are set in P-CHAN-00160 - P-CHAN-00169. G80-G89 is always executed as the last action at block end.

G800- G819 or G800- G839**: Names of the global subroutines in case of additional implicit program calls via G800 – G819 in the NC program. The names are valid until M30.

Default names are set in P-CHAN-00187. A G800-G819** is always executed as the last action at block end.

** Extended to 40 calls (G800 – G839) as of V3.1.3079.23

The equals sign (=) is optional.

The file names can be defined or changed in the NC program with #FILE NAME at any time.

Filenames are set to their default names at RESET and at NC program start.

Programing Example

prg_example

Definition of filenames

%example1

N10 #FILE NAME[ MSG="prog_flow.txt" ]

N20 $IF V.E.PLC_START_HOME == 1

N30 G74 X1 Y2 Z3

N40 #MSG SAVE["Homing executed"]   ;Output in prog_flow.txt

N50 $ENDIF

;…

N120 #MSG SAVE["Roughing OK"]

;…

N950 #MSG SAVE["Finishing OK"]

N985 V.E.WP_CNTR = V.E.WP_CNTR+1

N990 #MSG SAVE["Workpiece No. %d OK", V.E.WP_CNTR]

M1000 M30

%example2

N10 #FILE NAME[ M6="tool_change.nc" ]

N20 G00 X100 Y100 Z0

N30 M6                                   ;Call tool change program tool_change.nc

;…

M1000 M30

%example3

N10 #FILE NAME[ D="tool_data.nc" ]

N20 G00 X100 Y100 Z50

N30 D1          ;1:Request data of tool 1

                ;2:Implicit call of tool_data.nc

;…

M1000 M30

%example4

N10 #FILE NAME[ G80="g80_up_test.nc" ]

N20 G00 X100 Y100 Z50

N30 G80         ; Call subroutine g80_up_test.nc

;…

M1000 M30

%example5

N10 #FILE NAME[ G800="g800_up_test.nc" G815="g815_up_test.nc"]

N20 G00 X100 Y100 Z50

N30 G800         ; Call subroutine g800_up_test.nc

;…

N90 G815         ; Call subroutine g815_up_test.nc

;…

M1000 M30