.

mpiAxisStatus

Declaration

 
long mpiAxisStatus(MPIAxis    axis,
                   MPIStatus  *status,
                   void       *external)
  Required Header: stdmpi.h

Description

mpiAxisStatus gets the status of an Axis (axis) and writes it into the structure pointed to by status and also writes it into the implementation-specific structure pointed to by external (if external is not NULL).

 
axis a handle to the Axis object
*status pointer to MPIStatus structure.
*external pointer to an implementation-specific structure.

Remarks

external should always be set to NULL.

 
Return Values  
MPIMessageOK  
MPIMessageARG_INVALID  

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

mpiAxisCommandPositionGet | mpiAxisActualPositionGet | Controller Positions

 

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