# kernelv_ch_get_prog_start_mode()

## Prototype

KERNELV_RETURN | kernelv_ch_get_prog_start_mode (unsigned long int chanIndex, E_KERNELV_PROG_START_MODE* mode);

## Description

Reads the execution mode of the current program running.

## Parameter

Name | Type | Meaning
chanIndex | unsigned long | Channel index of the channel from which the variable is to be read.
mode | E_KERNELV_PROG _START_MODE* | Points to Enum for the returned execution mode.

## Return values

Symbol | Value | Meaning
RET_FINISHED | 0 | The function was executed without error.
ERR_INVALID_CHAN | -1 | The transferred channel index is higher than the number of configured channels -1
ERR_CNC_NOT_INIT | -3 | The simulation CNC kernel was not yet initialised.