typedef enum MPIActionSource
} MPIActionSource;
  Change History: Added in the 03.04.00


MPIActionSource is an enumeration that helps determine whether a non-idle axis and motion supervisor state was caused by an application on the host computer or by an action created by a controller event.

Idle states are not checked for the action source because the idle state is considered to be the "normal" state. If the state of an axis or motion supervisor is idle, then MPIStatus.actionSource will be set to MPIActionSourceCONTROLLER.

It is sometimes useful to know whether a non-idle state was caused by a controller event or host action. If the action source was the controller, the controller may be queried to find out what event caused the error state. In a multi-threaded or multi-process environment, it can also be useful to know if a another thread or process commanded an action that placed the motion supervisor or axis into a non-idle state.

MPIActionSourceUSER An application on the host computer commanded an action via mpiMotionAction that put the axis or motion supervisor into the current non-idle state.
MPIActionSourceCONTROLLER An event on the motion controller put the axis or motion supervisor into the current non-idle state.


The MPIMotor object does not store information about action sources. Therefore, mpiMotorStatus will always set MPIStatus.actionSource to MPIActionSourceCONTROLLER.

Sample Code

MPIStatus status;
returnValue = mpiAxisStatus(axis, &status, NULL);
msgCHECK(returnValue); if (status.state != MPIStateIDLE)
{ switch(status.actionSource)
{ case MPIActionSourceUSER:
printf("Action source was the host computer\n");
case MPIActionSourceCONTROLLER:
printf("Action source was the controller\n");
printf("ERROR: The action source value is invalid.\n");

See Also

MPIStatus | mpiAxisStatus | mpiMotionStatus | mpiMotionAction


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