Read out error message in the form of a string kernelv_get_error()

Prototype

KERNELV_RETURN

 

GetError(

out uint errorId,

out string messageString,

out uint returnLength,

uint maxLength

);

 

Description

Reads out error messages of the simulation CNC: Error messages are read out for all channels. As several error messages can occur during one CNC cycle, the function must be called cyclically until it returns the error ID 0.

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.

In any case, a value is assigned to the "errorId” parameter.

If this function is used at the same time as kernelv_read_error(), please note that the function also calls kernelv_read_error() internally. The function kernelv_get_error_message_string() should be used to read an error string when the function kernelv_read_error() is used.

Parameter

Name

Type

Meaning

errorId

out uint

Pointer to error message ID.

messageString

out string

Pointer to string for error message string. The calling application must provide the memory.

returnLength

out uint

Size of the memory expected.

maxLength

uint

Size of memory for the error message string. No string is returned if the error message string generated by the simulation CNC is longer than the memory provided.

Return values

Symbol

Value

Meaning

RET_FINISHED

0

The function was executed without error.

ERR_CNC_NOT_INIT

-3

The simulation CNC kernel was not yet initialised.

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 returnSize parameter.