.

MPIStatus

Definition

 
typedef struct MPIStatus {
    MPIState        state;
    MPIAction       action;
    MPIEventMask    eventMask;

    MPI_BOOL        settled;
    MPI_BOOL        atTarget;

    MPIActionSource actionSource;

    MPIStatusMask   statusMask;
} MPIStatus;
  Change History: Modified in the 03.04.00. Modified in the 03.03.00.

Description

MPIStatus is an MPI enum that is used to describe the current state of the controller's motion state machine. MPIState resides in the MPIStatus structure. Currently MPIState is only used with motion module.

 
state Value that indicates the state of an xmp controller's motion supervisor.
action Value that indicates the action to perform for a motion supervisor.
eventMask A bit mask that holds the current events that are active or latched for a particular object.  This is often used to help determine the source of an error.
settled

Value that indicates if an axis associated with a motion supervisor has settled (is in fine position).

atTarget Value that indicates if an axis associated with a motion supervisor has completed its command trajectory (i.e. the command position has reached the targeted end point of the move).
actionSource

Value that indicates whether the state in the state parameter was caused by a user action or by an action created by a controller event.

statusMask A bit mask that hold the current extended status flags for a particular object. This is often used to help determine the source of an error.

Sample Code

 

long printAxisErrorSources(MPIAxis axis)

{
    MPIEventType  eventType;
    MPIStatus     status;
    MPIStatusFlag flag;
    long          axisNumber;
    long          returnValue;

    /* Read the axis number */
    returnValue = mpiAxisNumber(axis, &axisNumber);
    if (returnValue != MPIMessageOK) return returnValue;

    /* Read the axis status */
    returnValue = mpiAxisStatus(axis, &status, NULL);

    if (returnValue != MPIMessageOK) return returnValue;

    /* Print the events currently active on the axis */

    for (eventType=MPIEventTypeFIRST; eventType<MEIEventTypeLAST; ++eventType)
    {
         if (mpiEventMaskBitGET(status.eventMask, eventType) != FALSE)
         {
            printf("Event \"%s\" is active on axis %d\n", mpiEventTypeName(eventType), axisNumber);
         }
    }

    /* mpiStatusMaskBIT() */
    for (flag=MPIStatusFlagFIRST ; flag<MEIStatusFlagLAST; ++flag)
    {
         if (status.statusMask & mpiStatusMaskBIT(flag) != FALSE)
        {
            printf("Status flag type %d is active on axis %d\n", flag, axisNumber);
        }
    }
}

See Also

MPIState | MPIStatusMask | mpiAxisStatus | mpiMotionStatus | meiMotorStatus

 

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2010 Motion Engineering