kernelv_program_error_get_file_name

Prototype

KERNELV_RETURN

 

kernelv_program_error_get_file_name(char *return_string,
                                                              unsigned long * returnLength);

Description

Returns the file name of the active NC program.

If the program was started by specifying an absolute program name, the compete program name is returned.

If the CNC controller opened the NC program by using a search path, this function returns the file name specified at program start. The search path used can be requested by the function kernelv_program_error_get_path().

The function returns the number of returned bytes in returnLength, i.e. including the zero terminating the string.

If the memory provided by the calling application is too small for the string to be returned, the return value ERR_CNC_RET_MEMORY is returned In this case, the returnLength parameter contains the size in bytes required for returning the string.

Parameter

Name

Type

Meaning

return_string

char*

Pointer to string for the program path. The calling application must provide the memory.

return_length

unsigned long*

Size of memory for the return value. If the return string is longer than the memory provided, nothing is returned.

Either the length of the returned string is returned or the size of the memory area required for the return.

Return values

Symbol

Value

Meaning

RET_FINISHED

0

The function was executed without error.

ERR_CNC_RET_MEMORY

-4

The return value(s) does/do not fit into the memory provided. The number of bytes required is returned in the ‘length’ parameter.

ERR_CNC_NO_DATA

-28

The requested data is not available. There is no available NC program specific data relating to an CNC error.