Operation modes of kernelv
An NC program can be started in 2 different channel operation modes. Depending on the operation mode, the kernelv DLL has different functions available. The operation mode can be specified for specific channels and this must be specified at program start.
Currently, the following operation modes are available:
Name | E_KERNELV_PROG_START_MODE | Meaning |
Normal operation mode | KERNELV_START_MODE_NORMAL | Normal operation mode; axis motions are interpolated at the correct velocity and the movement of the physical axes is simulated. |
Command contour visualisation | KERNELV_START_MODE_CONTOUR_VISU | Command contour visualisation operation mode; interpolation vertices are only calculated depending on the visualisation grid set. |
Normal operation mode
In normal operation mode the NC program is interpolated at the cycle time specified at the start of the kernelv DLL. The interpolation data generated corresponds to the data of a controller running in real time. The dynamic limits set for the axes are maintained.
Command contour visualisation operation mode
Compared to normal operation mode, the command contour visualisation operation mode generates an approximate vertex sequence in order to visualise the programmed contour rapidly.
The output grid can be set for straight and curved contour elements with the functions
kernelv_ch_set_cont_visu_grid(),
kernelv_ch_set_cont_visu_rel_curvature_error() and
kernelv_ch_set_cont_visu_abs_curvature_error()
. The end points of a motion block are always output, irrespective of the output grid set.
The approximate output grid is obtained by calculating the velocity at which the contour element is interpolated in order to obtain the output grid set. For this reason the dynamic axis data is not maintained. In the same way, the interpolated command values are not transferred to the position controller with the result that the ACS coordinates do not change in this operation mode.
Select an operation mode
The operation mode must be specified when the kernelv_ch_program_start() function is called.
Programing Example
kernelv_ch_program_start (0,
prog_name,
KERNELV_START_MODE_NORMAL);
Contour visualisation output data
The vertices calculated in the contour visualisation operation mode are written to a FIFO memory and read by the function kernelv_ch_get_cont_visu_data().
To avoid losing visualisation data, the interpolation is stopped when the internal FIFO is full. To execute an NC program as fast as possible, the kernelv_ch_get_cont_visu_data() function must be called a sufficient number of times.
Output format of contour visualisation
The data output when contour visualisation is active can be set system global by the parameter contour_visu_ifc_version (P-STUP-00039) in the start-up list.
Depending on the interface version set, the format of the data returned by the function kernelv_ch_get_cont_visu_data() changes. See also the structure definition of CONTOUR_VISU.
Interpolated WCS coordinates can be read by the functions kernelv_get_wcs_.