Triggered Image Acquisition (BCON for MIPI)#
Most modern imaging applications work with triggered image acquisition.
Using the Feature#
Hardware and Software Triggering#
When the camera is configured for hardware triggering, an electrical signal applied to one of the camera's input lines can act as a trigger signal.
When the camera is configured for software triggering, a software command or signal acts as a trigger signal. The software command can be executed using the pylon API.
In terms of configuration, the only difference between hardware and software triggering is the trigger source. For hardware triggering, you must choose a hardware trigger source. For software triggering, you must choose a software trigger source.
Also, some configuration steps don't apply to software triggering, e.g., choosing a trigger activation mode.
Configuring Triggered Image Acquisition#
To configure triggered image acquisition:
- Set the
Onto enable triggered image acquisition.
- Configure the trigger:
Don't trigger the camera at a rate that exceeds one or both of the following limiting factors:
- The maximum allowed frame rate for the current camera settings. If you apply Frame Start trigger signals to the camera when it is not ready to receive them, the signals will be ignored.
- The host computer's capacity limits for data transfer, storage, or both. If you try to acquire more images than the host computer is able to process, frames may be dropped.
You can set the trigger source using the
This defines how a trigger is triggered.
The following trigger sources are available:
Hardware Trigger Sources#
Line1: The trigger selected can be triggered by applying an electrical signal to I/O line 1.
PeriodicSignal1: The trigger selected can be triggered using the Periodic Signal feature.
Software Trigger Sources#
Software: The trigger selected can be triggered by executing a
TriggerSoftwarecommand via the pylon API.
Trigger Activation Modes#
You can set the activation mode using the
This setting only applies to hardware triggering. It defines which signal transition activates the selected trigger. For example, you can specify that a trigger becomes active when the trigger signal falls.
The following trigger activation modes are available:
LevelHigh: The trigger is active as long as the trigger signal is high.
LevelLow: The trigger is active as long as the trigger signal is low.
// Enable triggered image acquisition for the Frame Start trigger camera.TriggerMode.SetValue(TriggerMode_On); // Set the trigger source to Line 1 camera.TriggerSource.SetValue(TriggerSource_Line1); // Set the trigger activation mode to level high camera.TriggerActivation.SetValue(TriggerActivation_LevelHigh);
INodeMap& nodemap = camera.GetNodeMap(); // Enable triggered image acquisition for the Frame Start trigger CEnumParameter(nodemap, "TriggerMode").SetValue("On"); // Set the trigger source to Line 1 CEnumParameter(nodemap, "TriggerSource").SetValue("Line1"); // Set the trigger activation mode to level high CEnumParameter(nodemap, "TriggerActivation").SetValue("LevelHigh");
/* Macro to check for errors */ #define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc) GENAPIC_RESULT errRes = GENAPI_E_OK; /* Return value of pylon methods */ /* Enable triggered image acquisition for the Frame Start trigger */ errRes = PylonDeviceFeatureFromString(hdev, "TriggerMode", "On"); CHECK(errRes); /* Set the trigger source to Line 1 */ errRes = PylonDeviceFeatureFromString(hdev, "TriggerSource", "Line1"); CHECK(errRes); /* Set the trigger activation mode to level high */ errRes = PylonDeviceFeatureFromString(hdev, "TriggerActivation", "LevelHigh"); CHECK(errRes);
You can also use the pylon Viewer to easily set the parameters.