Enabling Triggers
Trigger enabling is the on/off switch for the acquisition engine thread. When triggers are enabled, the engine thread begins processing acquisition requests. When triggers are disabled, the engine thread halts any acquisitions in progress and waits for triggers to become enabled before restarting.
When triggers are disabled, external triggers are ignored, producing neither acquisitions nor isMissed errors. For trigger models that do not use external triggering, acquisition is also disabled when triggerEnable() is false. This is demonstrated by the following code:
fifo->triggerEnable(false);
for (i=0; i < 10; ++i)
fifo->start();
// 10 acquisitions are queued, but will not be acquired until
// some time later, when triggers are enabled
fifo->triggerEnable(true);
While disabling triggers halts any acquisition in progress, it does not flush the FIFO. This preserves successfully completed acquisitions in the FIFO. However, consider the following code, where the expected number of acquisitions does not take place:
for (i=0; i < 10; ++i)
fifo->start();
// After some, but not all, acquisitions have completed:
fifo->triggerEnable(false);
// We just halted one of the 10 acquisitions, now resume:
fifo->triggerEnable(true);
// Allow enough time for all acquisitions to complete
ccTimer::Sleep(10.0);
// This will probably display "9"
cogOut << fifo->completedAcqs() << std::endl;
When triggers are disabled in the above example, the acquisition in progress is halted and disappears from the FIFO. However, any acquisitions that have not started are left intact and ready to resume when triggers are re-enabled.
When two or more FIFOs are associated in a synchronous (master-slave) relationship, be especially watchful of trigger disabling side effects. See Considerations When Using Master-Slave Acquisition for details.
The following functions make internal calls to triggerEnable(), disabling triggers then re-enabling them before exiting only if triggers were originally enabled.
ccAcqFifo::triggerModel()
ccTriggerProp::triggerMaster()
ccAcqFifo::flush()
The following function disables triggers and then destroys the FIFO object: