# Support Different Trigger Modes

Copy

    // NOTE: Only enable ONE of the following Configure methods
    // NOTE: The Hardware Auto and Hardware Semi Auto Trigger Modes will require some additional,
    // camera-specific set up.  Check their Configure methods' implementations before using them.

    // Configures this project for synchronous
    // acquisition using the Manual trigger mode.
    void CSimpleAcquisitionDlg::ConfigureForManualSynchronous()
    {
        // In Manual Mode, the camera trigger is entirely software-controlled.
        // Acquisition is started by calling Acquire() or StartAcquire().
        // If StartAcquire() is called, the acquisition must be completed by
        // calling CompleteAcquire().

        m_acqFifo->OwnedTriggerParams()->setTriggerModel(AcqTriggerModelConstants::Manual);

        // We use this variable to control how we trigger the acquisition.
        // For Manual Synchronous Mode, we will trigger acquisition by calling
        // m_acqFifo->Acquire().  See the SimpleAcquire() function for usage.

        m_acquireMode = AcquireMode::Acquire;
    }

    // Configures this project for asynchronous
    // acquisition using the Manual trigger mode.
    void CSimpleAcquisitionDlg::ConfigureForManualAsynchronous()
    {
        // In Manual Mode, the camera trigger is entirely software-controlled.
        // Acquisition is started by calling Acquire() or StartAcquire().
        // If StartAcquire() is called, the acquisition must be completed by
        // calling CompleteAcquire().
        m_acqFifo->OwnedTriggerParams()->setTriggerModel(AcqTriggerModelConstants::Manual);

        // Register our Complete Event Handler, which will call CompleteAcquire()
        // We're doing this before changing the trigger model here as Free Run will
        // start acquiring immediately, so we want to be ready for it.
        static CompleteEventReceiver completeEventReceiver(*this);
        m_acqFifo->CompleteEvent().Connect(&CompleteEventReceiver::OnEvent, &completeEventReceiver);

        // We use this variable to control how we trigger the acquisition.
        // For Manual Asynchronous Mode, we will trigger acquisition by calling
        // m_acqFifo->StartAcquire().  See the SimpleAcquire() function for usage.
        m_acquireMode = AcquireMode::StartAcquire;
    }

    // Configures this project for acquisition
    // using the Free Run trigger mode.
    void CSimpleAcquisitionDlg::ConfigureForFreeRun()
    {
        // In Free Run Mode, the camera trigger is entirely automated, and the camera is
        // configured to send images as quickly as possible.  Acquisition does not need
        // to be started, but it does need to be completed by calling CompleteAcquire().

        // Register our Complete Event Handler, which will call CompleteAcquire()
        // We're doing this before changing the trigger model here as Free Run will
        // start acquiring immediately, so we want to be ready for it.
        static CompleteEventReceiver completeEventReceiver(*this);
        m_acqFifo->CompleteEvent().Connect(&CompleteEventReceiver::OnEvent,
        &completeEventReceiver);

        m_acqFifo->OwnedTriggerParams()->setTriggerModel(AcqTriggerModelConstants::FreeRun);

        // We use this variable to control how we trigger the acquisition.
        // For Free Run Mode, the camera will trigger acquisition.
        // See the SimpleAcquire() function for usage.
        m_acquireMode = AcquireMode::Camera;
    }

    // Configures this project for acquisition
    // using the Hardware Auto trigger mode.
    void CSimpleAcquisitionDlg::ConfigureForHardwareAuto()
    {
        // In Hardware Auto Mode, the camera trigger is entirely handled by the camera
        // hardware.  Acquisition is started by the camera in response to an external
        // trigger signal, and is completed by calling Acquire() or CompleteAcquire().

        m_acqFifo->OwnedTriggerParams()->setTriggerModel(AcqTriggerModelConstants::Auto);

        InitializeGigEFeatures();

        // Register our Complete Event Handler, which will call CompleteAcquire().
        static CompleteEventReceiver completeEventReceiver(*this);
        m_acqFifo->CompleteEvent().Connect(&CompleteEventReceiver::OnEvent,
        &completeEventReceiver);

        // We use this variable to control how we trigger the acquisition.
        // For Hardware Auto mode, the camera hardware will trigger acquisition.
        // See the SimpleAcquire() function for usage.
        m_acquireMode = AcquireMode::Camera;
    }

    // Configures this project for acquisition
    // using the Hardware Semi-Auto trigger mode.
    void CSimpleAcquisitionDlg::ConfigureForHardwareSemiAuto()
    {
        // In Hardware Semi-Auto, camera trigger control is shared between VisionPro
        // and the camera hardware.  First, acquisition must be started by calling
        // either Acquire() or StartAcquire().  Then, the camera will wait until
        // it receives its external trigger signal to acquire the image.  If Acquire()
        // was called, it will return the image at this point.  If StartAcquire() was
        // called, you will need to call CompleteAcquire().

        // You can queue multitple image requests by calling StartAcquire() multiple times.
        // As the camera receives external triggers, it will service the requests in the order
        // they came in.

        m_acqFifo->OwnedTriggerParams()->setTriggerModel(AcqTriggerModelConstants::Semi);

        InitializeGigEFeatures();

        // Register our Complete Event Handler, which will call CompleteAcquire().
        static CompleteEventReceiver completeEventReceiver(*this);
        m_acqFifo->CompleteEvent().Connect(&CompleteEventReceiver::OnEvent,
        &completeEventReceiver);

        // We use this variable to control how we trigger the acquisition.
        // For Hardware Semi-Auto Mode, we will trigger acquisition by calling
        // m_acqFifo->StartAcquire().  See the SimpleAcquire() function for usage.
        m_acquireMode = AcquireMode::StartAcquire;
    }