Main Content

Supporting Hardware Triggers

The toolbox supports three types of triggers:

  • Immediate — Trigger fires when video input object is started.

  • Manual — Trigger fires when user calls trigger function.

  • Hardware — Trigger fires when externally defined conditions are met

The engine provides automatic support for immediate and manual triggers. If you want your adaptor to support hardware triggers you must check to see if users have specified a hardware trigger in your acquisition thread function. Before you start acquiring frames from your device, insert a call to the IAdaptor member function useHardwareTrigger() to determine if the frame acquisition loop should wait for a hardware trigger to fire. If a hardware trigger is configured, insert device SDK calls required to wait for trigger.

The following figure illustrates the frame acquisition loop with the test for hardware trigger.

Main Acquisition Loop with Test for Hardware Trigger

Example

The following is an acquisition thread function that includes a call to check for hardware trigger.

while(adaptor->isAcquisitionNotComplete()) {

    // Check for hardware trigger 
    if (adaptor->useHardwareTrigger()) {

                    // Add code here to configure the image
                    // acquisition device for hardware
                    // triggering.
                }

                if (adaptor->isSendFrame()) {

                 // see acquistion thread

                } // if isSendFrame()

            // Increment the frame count.
            adaptor->incrementFrameCount();

            } // while(isAcquisitionNotComplete() 

             break;
        } //switch-case WM_USER
   } //while message is not WM_QUIT
   
return 0;
}