mpiAxisOriginSet
Declaration
int32_t mpiAxisOriginSet(MPIAxis axis, double origin)
Required Header: axis.h
Description
mpiAxisOriginSet sets the value of the origin of an Axis (axis) to origin.
axis | a handle to the Axis object. |
---|---|
origin | value to which the Axis Origin will be set |
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;
int32_t 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
mpiAxisOriginGet | Using the Origin Variable | Controller Positions