kernelv_get_prg_target_positions()
Prototype
[ret, positions, return_size] | get_prg_target_positions(vnck: ctypes.CDLL); |
Description
The target positions of all axes existing in the CNC that are programmed in the NC program are returned in an array.
The returned positions are the positions programmed in the currently executed NC block.
If motion blocks are inserted by the CNC or programmed motion blocks are split (e.g. for contouring), the target position of the source block is output for all generated NC blocks.
Position values have a resolution of 0.1 µm for translatory axes or 1*10-4° for spindles or rotary axes.
The error code ERR_CNC_RET_MEMORY is returned if the memory provided by the calling application is not sufficient for returning all values.
The calling application must provide at least number of axes * sizeof(signed long int) bytes for returning of all position values.
The order of the axis positions in the returned array is equal to the configuration order of the axes.
If an axis is currently not assigned to an NC channel, the value zero is returned for that axis.
Parameter
Name | Type | Meaning |
vnck | ctypes.CDLL | Instance of the loaded KernelV DLL. |
Return values
Name | Type | Meaning |
ret | KERNELV_RETURN | Return value of the native integrated C function. |
positions | NDArray | List of axis positions returned. |
return_size | int (unsigned) | Number of bytes returned in positions. |
KERNELV_RETURN
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. In this case, the required memory is returned in the returnSize parameter. |