Notify Objects
Introduction
A thread uses a Notify object to wait for event notification. For each thread intended to wait for events from an object (or objects), your application must create a Notify object. The source of firmware events are Motion, Sequence, and Recorder objects.
When it is desired to wait for event notifications from a single source, that source (i.e., object handle) can be passed as the second argument to mpiNotifyCreate. After a Notify object is appended to the EventMgr list of Notify objects, make a call to mpiNotifyEventWait to instruct the Notify object to wait for event notification.
| Error Messages |
Implementation
Notify objects maintain a FIFO ("First In, First Out") buffer of events that have occurred. Each call to mpiNotifyEventWait removes one event from the buffer. If the event buffer is empty, mpiNotifyEventWait(...) will wait for an event to be sent to the Notify object. This ensures that events will not be missed in cases where multiple events have occurred between calls to mpiNotifyEventWait(...). However, the danger is that an application may not call mpiNotifyEventWait(...) for a long time. In this case, the event buffer may grow rather quickly and use a large amount of system memory. In order to prevent this problem from occurring, one should use mpiNotifyEventMaskSet to enable and disable event notification at the proper times.
Methods
Create, Delete, Validate Methods | ||
mpiNotifyCreate | Create a Notify object | |
mpiNotifyDelete | Delete a Notify object | |
mpiNotifyValidate | Validate a Notify object |
Event Methods | ||
mpiNotifyEvent | Check to see if events have occurred | |
mpiNotifyEventFlush | Flush pending events from event queue | |
mpiNotifyEventMaskGet | Get event mask | |
mpiNotifyEventMaskSet | Set event mask | |
mpiNotifyEventWait | Get next event from queue or wait timeout msec for it to arrive | |
mpiNotifyEventWake | Wake up thread waiting for notify object |
Relational Methods | ||
List Methods for Event Sources | ||
mpiNotifySource | Get the indexth event source in list | |
mpiNotifySourceAppend | Append an event source to list | |
mpiNotifySourceCount | Count number of event sources in list | |
mpiNotifySourceFirst | Get first event source in list | |
mpiNotifySourceIndex | Get index value for event source in list | |
mpiNotifySourceInsert | Place event source after source in list | |
mpiNotifySourceLast | Get last event source in list | |
mpiNotifySourceListGet | Get list of event sources | |
mpiNotifySourceListSet | Create a list of event sources | |
mpiNotifySourceNext | Get next event source after source in list | |
mpiNotifySourcePrevious | Get the event source before source in list | |
mpiNotifySourceRemove | Remove event source from list |
Data Types
MPINotifyMessage | ||
MEINotifyTrace |