mpiAxisOriginGet
Declaration
long mpiAxisOriginGet(MPIAxis axis, double *origin)
Required Header: axis.h
Description
mpiAxisOriginGet gets the value of the origin of an Axis (axis) and writes it into the location pointed to by origin.
axis | a handle to the Axis object. |
---|---|
*origin | pointer to the Origin value returned by the method |
Return Values |
---|
MPIMessageOK |
Sample Code
/* Set axis actual position to be zero by changing origin */
void zeroPosition(MPIMotion motion, MPIAxis axis) { double actualPosition;
double commandPosition;
double originValue;
long returnValue;
returnValue =
mpiMotionPositionGet(motion,
&actualPosition,
&commandPosition);
msgCHECK(returnValue);
/* Always do a ConfigGet before a ConfigSet */
returnValue =
mpiAxisOriginGet(axis,
&originValue);
msgCHECK(returnValue);
returnValue =
mpiAxisOriginSet(axis,
originValue+actualPosition);
msgCHECK(returnValue);
/* Now actual position is 0 */
}
See Also
mpiAxisOriginSet | Using the Origin Variable | Controller Positions