kernelv_ax_set_position()

Prototype

KERNELV_RETURN (int)

ax_set_position(vnck: ctypes.CDLL, axis_index: int, position: int);

Description

Sets the actual position of the axis to the position specified in the position parameter. This function can only be executed if no NC program is active in the channel to which the axis currently belongs. If an attempt is made to set the axis position while the NC program is active, adoption of the position is refused and the return value ERR_INVALID_STATE is returned.

Parameter

Name

Type

Meaning

vnck

ctypes.CDLL

Instance of the loaded KernelV DLL.

axis_index

int (unsigned)

Axis index.

position

int (signed)

Position to be set.

Return values

Symbol

Value

Meaning

RET_FINISHED

0

The function was executed without error.

RET_BUSY

1

The function is currently being executed, but has not yet been completed.

The API function must continue to be called.

 

ERR_CNC_NOT_INIT

-3

The simulation CNC kernel has not yet been initialised.

 

ERR_INVALID_STATE

-5

The CNC channel of the axis is in the wrong state for executing a function.

 

ERR_INVALID_AX

-9

The transferred axis index is higher than the number of configured axes –1 or 0.

 

ERR_INVALID_AX

-9

The transferred axis index is higher than the number of configured axes -1

 

ERR_AXIS_ERROR

-10

The CNC axis indicates an error. The CNC additionally issues an error message.