kernelv_ch_get_cs_shift_vector()

Prototype

KERNELV_RETURN

kernelv_ch_get_cs_shift_vector(unsigned long int chanIndex,
                                                    unsigned short csIndex,
                                                    double *vector,
                                                    unsigned long int bufferSize,
                                                    unsigned long int *retBytes);

Description

Returns the shift of the origin of the coordinate system specified by the parameter csIndex.

A vector with three elements is returned, specifying the shift of the coordinate system origin to the origin of the subordinate coordinate system.

The shift vector that is generated by the parameters v1, v2, v3 of the following NC command is returned:

#CS DEF [CS1] [ <v1>,<v2>,<v3>,<ϕ1>,<ϕ2>,<ϕ3> ]

If no coordinate system is defined at the specific index in the coordinate system stack, a zero vector is returned and the return value of the function is ERR_CNC_NO_DATA.

Parameter

Name

Type

Meaning

chanIndex

unsigned long

Channel index of the channel.

csIndex

unsigned short

Index of the coordinate system in the coordinate system stack.

vector

double*

Pointer to the memory location for the shift vector.

bufferSize

unsigned long

Length of the memory area for the rotation matrix must be at least 3 x sizeof(double).

returnLength

unsigned long*

Pointer to the value to which the actually returned number of bytes is to be written.

If the transferred memory is too small for the return value, the return value ERR_CNC_RET_MEMORY is returned and this parameter returns the required memory size.

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.

ERR_CNC_RET_MEMORY

-4

The return value(s) does/do not fit into the memory provided. In this case, the minimum size required for the return is returned in returnLength.

ERR_READ_ERR

-26

An error occurred on reading data from the kernelv DLL.

ERR_CNC_NO_DATA

-28

The requested data is not available. No coordinate system is defined in the coordinate system stack at the location specified by the call parameter csIndex. A zero vector is returned.

ERR_INVALID_PARAMETER

-30

An invalid parameter was transferred:

The coordinate system index transferred in the parameter csIndex is higher than the maximum possible index in the coordinate system stack.