MPI 04.00 Reference >> mpiMotion

mpiMotionStatus

Declaration

MPI_RESULT mpiMotionStatus(MPIMotion motion,
                           MPIMotionStatus *status);

 

Required Header: motion.h
Change History: Changed in 04.00.

Description

mpiMotionStatus reads a Motion’s status from the controller and writes it into the structure pointed to by status.

motion a handle to a Motion object
*status a pointer to MPIMotionStatus structure
Return Values
MPIMessageOK
MPIMessageARG_INVALID

Sample Code

Read the motion status and if the MS is in an error state, clear the fault conditions.

/* Check motion status for any error conditions */
returnValue =
mpiMotionStatus(motion, &status);
msgCHECK(returnValue);

if (status.state == MPIStateERROR) {
returnValue =
         mpiMotionAction(motion, MPIActionRESET);
         msgCHECK(returnValue);

         printf("Error state cleared.\n");
}

See Also

MPIMotionStatus | MPIAxisStatus | mpiMotorStatus