MEIEventStatusInfo

MEIEventStatusInfo

 

typedef struct MEIEventStatusInfo {
    union {
    	MPIHandle    handle;    /* generic */
    	MPIAxis      axis;      /* MEIEventTypeAXIS_FIRST ... MEIEventTypeAXIS_LAST - 1 */
    	long         number;    /* MPIEventTypeMOTION	
                    MPIEventTypeMOTOR_FIRST ... MPIEventTypeMOTOR_LAST - 1
    		    MEIEventTypeMOTOR_FIRST ... MEIEventTypeMOTOR_LAST - 1 */
        long         value;     /* MPIEventTypeEXTERNAL */
	    } type;

	    MEIXmpSignalID signalID;

	    /* Contents of addresses specified by MEIEventNotifyData{} */
	    union {
                  long sampleCounter;
                  struct {
                      long sampleCounter;
                  } motion;
                  struct {
                       long sampleCounter;
                       long actualPosition;
                  } axis;
                  struct {
                       long sampleCounter;
                       long encoderPosition;
                  } motor;
                  long word[MEIXmpSignalUserData];
             } data;
} MEIEventStatusInfo;
Description

EventStatusInfo is an information structure that tells the XMP what the data in MPIEventStatus.info holds.

  type A union that specifies the object handle, motion number, or external ID value that generated the event
  type.handle A generic object handle. Used by MPIRecorder and MPIMotor events
  type.axis An axis object handle. Used by MPIAxis events
  type.number The motion number of the MPIMotion object that generated the event
  type.value An ID value used to identify what external source or MPISequence event was generated
  signalID Specifies what type of object actually generated the event
  data A union that contains extra data about the event that was generated
  data.sampleCounter The value of the sampleCounter when the event was generated
  data.motion A union that contains extra data about the motion event that was generated
  data.motion.sampleCounter The value of the sampleCounter when the motion event was generated
  data.axis A union that contains extra data about the axis event that was generated
  data.axis.sampleCounter The value of the sampleCounter when the axis.event was generated
  data.axis.actualPosition The value of the axis' actual position when the event was generated
  data.motor A union that contains extra data about the motor event that was generated
  data.motor.sampleCounter The value of the sampleCounter when the motor event was generated
  data.motor.encoderPosition The value of the motor's ecoder position when the event was generated
  data.word[] The extra data about the event that was generated formatted as an array of long values
Sample Code
 

        MPINotify      notify
        MPIEventStatus eventStatus;

        . . .

        /* Wait for event */
        returnValue =
            mpiNotifyEventWait(notify,
                                         &eventStatus,
                                          MPIWaitFOREVER);
        msgCHECK(returnValue);

        if (eventStatus.type == MPIEventTypeMOTION_DONE) {
            MEIEventStatusInfo *info;

            info = (MEIEventStatusInfo *)eventStatus.info;

            . . .
        }

 
See Also MPIEventStatus | MPIAxis