kernelv_get_axis_names()
Prototype
KERNELV_RETURN | kernelv_get_axis_names(char* axisNames,
|
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 1.2.3.1.
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 1.2.3.1.
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 and, in this case, the memory in bytes minimally required for returning is entered in the returnSize variable.
Parameter
Name | Type | Meaning |
axisNames | char* | Pointer to the memory area for the axis names to be returned. |
maxByteSize | unsigned long | Size of the memory area for the axis names. |
returnSize | unsigned long* | Number of bytes returned in axisNames. |
nAxis | unsigned long* | Number of axis names returned in axisNames. |
Return values
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
Four axes are configured, and only the axes with the indexes 0 (axis name 'X2') and 2 (axis name 'C') are assigned to a channel:
A call of kernelv_get_axis_names() returns the following values:
Parameter | Value | Comment |
returnSize | 80 | 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, ….. |