kernelv_program_error_get_program_name

Prototype

KERNELV_RETURN

 

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

Description

Returns the program name of the active NC program.

The program name is specified at the start of the main program by a "%” character; for more information see [PROG]. If no program name was specified for the NC program, an empty string is returned.

A zero terminated string is returned. The number of returned bytes is returned in return_length, i.e. the terminating zero is included.

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 name. 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.