Outputting text formatted with FN 16: F-PRINT

Application

With the function FN 16: F-PRINT, you can save Q parameter values and output formatted texts (e.g. in order to save measurement reports).

  • You can output the values as follows:
  • Save them to a file on the control
  • Display them on the screen in a pop-up window
  • Save them to an external file
  • Print them using a connected printer

Description of function

  1. To output Q-parameter values and texts:
  2. Create a text file that defines the output format and contents
  3. In the NC program, use the function FN 16: F-PRINT in order to output the log

If you output the values to a file, the maximum size of the output file will be 20 KB.

Within the FN 16 function, you specify the output file that contains the texts to be output.

  • The control displays the output file in the following cases:
  • End of program END PGM
  • Cancellation of program with the NC STOP key
  • M_CLOSE command
  • Keywords

Source file for output format

You define the output format and the contents of the file in a source file *.a.

Formatting

You can define the formatting using the following commands:

 
Tip

Pay attention to capitalization.

Special characters

Function

"..........."

Define output format for texts and variables between the quotation marks

%F

  • Format for Q parameters, QL, and QR:
  • Define %: format
  • F: Floating (decimal number), format for Q, QL, QR

9.3

  • Format for Q parameters, QL, and QR:
  • Total of 9 characters, including decimal separator
  • Of these, 3 are decimal places

%S

Format for text variable QS

%RS

Format for text variable QS

Assumes the subsequent without any changes or formatting

%D or %I

Format for integer

,

Separation character between output format and parameter

;

End of block character

*

Beginning of a comment line

Comments are not shown in the log

%"

Output quotation marks

%%

Output percent sign

\\

Output backslash

\n

Output line break

+

Q parameter value, right-aligned

-

Q parameter value, left-aligned

Keywords

You can include the following information in the file:

Keyword

Function

CALL_PATH

Gives the path for the NC program where you will find the FN 16 function. Example: "Measuring program: %S",CALL_PATH;

M_CLOSE

Closes the file to which you are writing with FN 16. Example: M_CLOSE;

M_APPEND

Upon renewed output, appends the log to the existing log. Example: M_APPEND;

M_APPEND_MAX

Upon renewed output, appends the log to the existing log until the maximum specified file size in kilobytes is exceeded. Example: M_APPEND_MAX20;

M_TRUNCATE

Overwrites the log upon renewed output. Example: M_TRUNCATE;

M_EMPTY_HIDE

Prevents empty lines from being inserted into the log if QS parameters are not defined or empty. Example: M_EMPTY_HIDE;

M_EMPTY_SHOW

Inserts empty lines into the log if QS parameters are not defined. Resets M_EMPTY_HIDE. Example: M_EMPTY_SHOW;

L_ENGLISH

Outputs the text only for English conversational language

L_GERMAN

Outputs the text only for German conversational language

L_CZECH

Outputs text only for Czech conversational language

L_FRENCH

Outputs text only for French conversational language

L_ITALIAN

Outputs text only for Italian conversational language

L_SPANISH

Outputs text only for Spanish conversational language

L_PORTUGUE

Outputs text only for Portuguese conversational language

L_SWEDISH

Outputs text only for Swedish conversational language

L_DANISH

Outputs text only for Danish conversational language

L_FINNISH

Outputs text only for Finnish conversational language

L_DUTCH

Outputs text only for Dutch conversational language

L_POLISH

Outputs text only for Polish conversational language

L_HUNGARIA

Outputs text only for Hungarian conversational language

L_CHINESE

Outputs text only for Chinese conversational language

L_CHINESE_TRAD

Outputs text only for Chinese (traditional) conversational language

L_SLOVENIAN

Outputs text only for Slovenian conversational language

L_NORWEGIAN

Outputs text only for Norwegian conversational language

L_ROMANIAN

Outputs text only for Romanian conversational language

L_SLOVAK

Outputs text only for Slovakian conversational language

L_TURKISH

Outputs text only for Turkish conversational language

L_ALL

Display text independently of the conversational language

HOUR

Number of hours from the real-time clock

MIN

Number of minutes from the real-time clock

SEC

Number of seconds from the real-time clock

DAY

Day from the real-time clock

MONTH

Month as a number from the real-time clock

STR_MONTH

Month as a string abbreviation from the real-time clock

YEAR2

Two-digit year from the real-time clock

YEAR4

Four-digit year from the real-time clock

Input

NC programs contained in this User's Manual are suggestions for solutions. The NC programs or individual NC blocks must be adapted before being used on a machine.

  • Change the following contents as needed:
  • Tools
  • Cutting parameters
  • Feed rates
  • Clearance height or safe position
  • Machine-specific positions, e.g. with M91
  • Paths of program calls

Some NC programs depend on the machine kinematics. Adapt these NC programs to your machine kinematics before the first test run.

In addition, test the NC programs using the simulation before the actual program run.

 
Tip

With a program test you determine whether the NC program can be used with the available software options, the active machine kinematics and the current machine configuration.

11 FN 16: F-PRINT TNC:\mask.a / TNC:\Prot1.txt

; Output file Prot1.txt with the source from Mask.a

The NC function includes the following syntax elements:

Syntax element

Meaning

FN 16: F-PRINT

Syntax initiator for outputting formatted texts

*.a

Path of the source file for the output format

/

Separator between the two paths

TNC:\Prot1.txt

Path under which the control saves the output file

The file name extension of the log file determines the file type of the output (e.g., TXT, A, XLS, HTML).

You can enter the source file and the output file as Q parameters or as QS parameters. For this purpose you previously define the desired parameter in the NC program.

Enter Q parameters in the FN 16 function with the following syntax so that the control can detect the Q parameters:

Input

Function

:'QS1'

Set QS parameters with preceding colon and between single quotation marks

:'QL3'.txt

Specify additional file name extension for the target file if required

Output options

Screen output

You can use the FN 16: F-PRINT function to display messages in a pop-up window on the control screen. This makes it easy to display explanatory texts in such a way that the user cannot continue without reacting to them. The length and position of these texts can be defined freely in the NC program. It is also possible to display the contents of variables by defining the text file accordingly.

In order to display the message on the control screen, enter SCREEN: as the output path.

Example

11 FN 16: F-PRINT TNC:­\MASKE­\MASKE1.A / SCREEN:

 
Tip

If you want to replace the content of the pop-up window for multiple screen outputs in the NC program, define the M_CLOSE or M_TRUNCATE keywords.

  • You can close the pop-up window in the following ways:
  • By pressing the CE key
  • By defining the SCLR: output path

Save output externally of the control

With the FN 16 function you can also store log files externally.

To do so you must enter the target path in the FN 16 function.

Example

96 FN 16: F-PRINT TNC:­\MSK­\MSK1.A / PC325:­\LOG­\PRO1.TXT

If you output the same file more than once in the NC program, the control appends the current output to the end of the contents already output within the target file.

Print output file

You can also use the function FN 16: F-PRINT to print the output files on a connected printer.

Printers

The control will only print the log file if the source file for the output format ends with the M_CLOSE keyword.

To ensure that the messages will be sent to the default printer, you must enter Printer:\ and a file name as the target (output path).

If you do not use the default printer, enter the path to the respective printer, e.g., Printer:\PR0739\ and a file name.

The control will save the file using the defined file name and the defined path. The file name will not be printed.

The control saves the file only until printing is complete.

Example

11 FN 16: F-PRINT TNC:­\MASKE­\MASKE1.A / PRINTER:­\PRINT1

Notes

  • Use the optional machine parameters fn16DefaultPath (no. 102202) and fn16DefaultPathSim (no. 102203) to define a path under which the control saves the output files.
  • If you only define the file name as the destination path of the output file, the control saves the output file in the folder of the NC program.
  • If you define a path both in the machine parameters and in the FN 16 function, the path in the FN 16 function has priority.
  • If the called file is located in the same directory as the file you are calling it from, you can also enter just the file name without the path. If you select the file using the selection menu, the control automatically proceeds in this manner.
  • With the %RS function in the source file, the control accepts the following content unformatted. This allows you to output a path specification with QS parameters, for example.
  • For text output, you can use the UTF-8 character set.

Example

Example of a text file that outputs a log file of variable length:

"MEASURING LOG";

“%S“,QS1;

M_EMPTY_HIDE;

“%S“,QS2;

“%S“,QS3;

M_EMPTY_SHOW;

“%S“,QS4;

M_CLOSE;

Example of an NC program that defines only QS3:

95 Q1 = 100

96 QS3 = "Pos 1: " || TOCHAR( DAT+Q1 )

97 FN 16: F-PRINT TNC:\fn16.a / SCREEN:

Example of a screen output with two empty lines resulting from QS1 and QS4:

FN16_EMPTY_HIDE