mpiAxisActualPositionSet

Declaration

int32_t mpiAxisActualPositionSet(MPIAxis  axis,
                              double   actual) 

Required Header: axis.h

Description

mpiAxisActualPositionSet sets the value of the actual position of an Axis (axis) to actual. Setting the actual position while the ampEnable is enabled will cause the position error to change, potentially causing the motor to jump. To prevent the motor from jumping, disable the ampEnable before calling mpiAxisActualPositionSet.

Note: During a homing operation, use mpiAxisOriginGet and mpiAxisOriginSet to calibrate the axis' actual position after capture.

axis a handle to an Axis object.
actual a value to which the Axis actual position will be set.
Return Values
MPIMessageOK

Sample Code

Zero the command and actual postions.

returnValue =
mpiAxisCommandPositionSet(axis, 0.0);

if (returnValue == MPIMessageOK) {
	returnValue =
		mpiAxisActualPositionSet(axis, 0.0);
}

See Also

AxisCommandPositionSet | Using the Origin Variable | Controller Positions