kernelv_get_axis_names()

Prototype

[ret, axis_names]

get_axis_names(vnck: ctypes.CDLL);

Description

Returns the axis names of an axis used in the respective channels. The axis name is the name with which the axis is addressed in an NC program. Only axes that are in a channel have an axis name.

An array of strings with a fixed length is returned. The length of one single string (including terminating zeroes) can be determined as follows:

Length of name = returnSize / number of configured axes

The number of configured axes can be determined with the kernelv_get_axis_count() function.

The indexes of the returned axis names correspond to the configuration sequence. See also section Identification of axes and channels.

If the axis name is shorter than the name length –1 character, the string is filled with the value \0.

The indexes of the returned axis names correspond to the configuration sequence. See also section Identification of axes and channels.

If the memory provided by the calling application is too small for the values to be returned, the value ERR_CNC_RET_MEMORY is returned.

Parameter

Name

Type

Meaning

vnck

ctypes.CDLL

Instance of the loaded KernelV DLL.

Return values

Name

Type

Meaning

ret

KERNELV_RETURN (int)

Return value of the native integrated C function.

axis_names

List[str]

List of axis names.

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. The number of bytes required is returned in the returnSize parameter.

Example

Parameter

Value

Comment

returnSize

80

Number of configured axes* name length.

nAxis

2

Number of axes that are currently assigned to a channel

axisNames

 

See the table below.

The length (nameLength) of a single string is thus:

namelength = returnSize / number of configured axes = 80 / 4 = 20

axisNames as the following structure:

Offset

Value

0

‘X’, ‘2’; \0, \0, \0 ….

20 (1* nameLength)

\0, \0, \0, …..

40 (2* nameLength)

‘C’; \0, \0, \0 ….

60 (3* nameLength)

\0, \0, \0, …..