MPIEventAxisData

Declaration

typedef struct MPIEventAxisData
{
   int32_t    moveId;
   int32_t    elementId;
   double  positionError;
   double  actualPosition;
   double  commandPosition;
   double  commandVelocity;
   double  commandAcceleration;
   double  commandJerk;
} MPIEventAxisData;

Required Header: stdmpi.h

Change History: Added in 04.00.

Description

MPIEventAxisData holds information about an axis event generated on the controller.

moveId The ID of the executing motion for the axis.
elementId The ID of the motion element the axis was executing when the event occurred.
positionError The position error of the axis when the event occurred.
actualPosition The actual position of the axis when the event occurred.
commandPosition The command position of the axis when the event occurred.
commandVelocity The command velocity of the axis when the event occurred.
commandAcceleration The command acceleration of the axis when the event occurred.
commandJerk The command jerk of the axis when the event occurred.

Sample Code

MPI_RESULT MPI_DECL2
    myAxisEventCallback(MPIControl control, const MPIEventData* status, void* userData)
{`
    /* print event information to the screen. */

    printf("%s event occurred at controller sample %d.\n"
           "  Move ID          = %d\n"
           "  Element ID       = %d\n"
           "  Position Error   = %f\n"
           "  Actual Position  = %f\n"
           "  Command Position = %f\n",
        mpiEventTypeName(status->eventType),
        status->data.sampleCounter,
        status->data.axis.moveId,
        status->data.axis.elementId,
        status->data.axis.positionError,
        status->data.axis.actualPosition,
        status->data.axis.commandPosition);
}

See Also

MPIEventData