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 int32_t 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
Data Types