MPI 04.00 Reference >> mpiMotor

mpiMotorEventNotifyGet

Declaration

MPI_RESULT
   mpiMotorEventNotifyGet(MPIMotor            motor,
                          MPIEventMask        *eventMask,
                          MPIEventNotifyData  *eventNotifyData);

Required Header: stdmpi.h

Description

mpiMotorEventNotifyGet reads the event mask (that specifies the event types for the requested host notification) to the location pointed to by eventMask, and also writes the event notification structure (that specifies the event message controller addresses) to the location pointed to by eventNotifyData. Use the event mask macros mpiEventMaskGET(...), mpiEventMaskBitGET(...), etc. to decode the eventMask.

motor A handle to a motor object.
*eventMask A pointer to an event mask, whose bits are defined by the MPIEventType enumeration
*eventNotifyData A pointer to an event notification data structure, containing a list of controller addresses. The event data specified by the addresses is copied into the event message by the controller.
Return Values
MPIMessageOK

Sample Code

Example

/* Request notification of all events from motor */
mpiEventMaskCLEAR(eventMask);

returnValue =
    mpiMotorEventNotifyGet(motor,
                           &eventMask,
                           NULL);
mpiEventMaskMOTOR(eventMask); if (returnValue == MPIMessageOK) { returnValue = mpiMotorEventNotifySet(motor, eventMask, NULL); }

See Also

MPIEventType | MPIEventNotifyData | mpiMotorEventNotifySet