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

Create, Delete, Validate Methods
mpiNotifyCreate Create a Notify object
mpiNotifyDelete Delete a Notify object
mpiNotifyValidate Validate a Notify object

Enable Methods
mpiNotifyEnableGet  
mpiNotifyEnableSet  

Event Methods
mpiNotifyEvent Check to see if events have occurred
mpiNotifyEventCount  
mpiNotifyEventFlush Flush pending events from event queue
mpiNotifyEventMaskGet Get event mask
mpiNotifyEventMaskSet Set event mask
mpiNotifyEventPost  
mpiNotifyEventSignal  
mpiNotifyEventWait Get next event from queue or wait timeout msec for it to arrive
mpiNotifyEventWaitSpecific  
mpiNotifyEventWake Wake up thread waiting for notify object

Relational Methods
List Methods for Event Sources
mpiNotifySourceAdd  
mpiNotifySourceRemove Remove event source from list

Data Types

MPINotifyTrace