MPI 04.00 Reference >> mpiMotor
mpiMotorEventNotifySet
Declaration
MPI_RESULT mpiMotorEventNotifySet(MPIMotor motor, const MPIEventMask eventMask, const MPIEventNotifyData *eventNotifyData);
Required Header: stdmpi.h
Description
mpiMotorEventNotifySet requests host notification of the events that are generated by motor and specified by eventMask, and also specified by 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 create 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
/* Request notification of all events from motor */ mpiEventMaskCLEAR(eventMask); returnValue = mpiMotorEventNotifyGet(motor, &eventMask, NULL); mpiEventMaskMOTOR(eventMask); if (returnValue == MPIMessageOK) { returnValue = mpiMotorEventNotifySet(motor, eventMask, NULL); }