IDS Peak comfortSDK, genericSDK, IPL, and AFL developer manuals are external documents. Please contact us if you need them.
Most IDS Vision cameras support using I/O signals as trigger for image acquisition. This mode is often called hardware trigger.
When the camera receives a trigger signal on the line, a single image is captured and transferred. During initialization time, trigger signals are ignored.
While exposure and read out are still active, the camera can typically not start a second acquisition unless it is able to handle overlapping triggers. The latter means, that the next exposure can start while the previous read out is still active.
In hardware trigger mode, the AcquisitionFrameRate turns to read-only access and returns the maximum trigger frequency. If triggers are sent faster and the camera is not ready to apply the trigger, the trigger is missed.
![Fig. 66: Camera timing in hardware trigger mode with sequential frames Fig. 66: Camera timing in hardware trigger mode with sequential frames](./images/trigger-hardware-sequential.svg)
Fig. 66: Camera timing in hardware trigger mode with sequential frames
![Fig. 67: Camera timing in hardware trigger mode with overlapping frames Fig. 67: Camera timing in hardware trigger mode with overlapping frames](./images/trigger-hardware-overlapping.svg)
Fig. 67: Camera timing in hardware trigger mode with overlapping frames
![hint_info](./images/hint_info.png)
|
Note on I/O pinning and circuits
For I/O pin assignment and circuit information for your camera model, refer to the technical manual of the respective camera family.
|
Configuration
First make sure, you have chosen the AcquisitionMode "Continuous".
AcquisitionMode = Continuous;
Then activate the "ExposureStart" trigger.
TriggerSelector = ExposureStart;
TriggerMode = On;
As TriggerSource for the "ExposureStart" trigger, select the I/O line that holds the trigger signal.
TriggerSource = Line0;
Now the image acquisition is ready to be started. See Preparing image acquisition: create buffer and Starting and stopping image acquisition.
AcquisitionStart();
Alternatives and variations: Using the falling edge of the I/O signal
Instead of using the rising edge, you can also connect the "ExposureStart" trigger to the falling edge of your I/O signal. Make sure, the TriggerSelector is set correctly first. Then change the TriggerActivation according to the selected edge type.
TriggerSelector = ExposureStart;
TriggerActivation = FallingEdge;
![Fig. 68: Trigger activation on the falling edge of the input line Fig. 68: Trigger activation on the falling edge of the input line](./images/trigger-hardware-falling-edge.svg)
Fig. 68: Trigger activation on the falling edge of the input line
Alternatives and variations: Trigger delay
Some applications require, that the I/O signal triggers the image with a certain delay to synchronize different components in the process. Make sure, the TriggerSelector is set correctly first. Then change the TriggerDelay according to your application.
TriggerSelector = ExposureStart;
TriggerDelay = 100.0;
![Fig. 69: Trigger delay Fig. 69: Trigger delay](./images/trigger-hardware-delay.svg)
Fig. 69: Trigger delay
Alternatives and variations: Skipping trigger signals
Especially with high frequent trigger signal sources, some applications require to skip trigger signals. If the TriggerDivider is set to 2, only every second trigger signal is causing the capture of an image. If TriggerDivider is set to 10, only every 10th signal triggers an image, and so on.
Make sure, the TriggerSelector is set correctly first. Then change the TriggerDivider according to your application.
TriggerSelector = ExposureStart;
TriggerDivider = 2;
![Fig. 70: Skipping every second trigger signal with TriggerDivider=2 Fig. 70: Skipping every second trigger signal with TriggerDivider=2](./images/trigger-hardware-divider.svg)
Fig. 70: Skipping every second trigger signal with TriggerDivider=2
Additional information
IDS peak: code examples
// Load UserSet "Default", if the configuration of the camera is unclear
peak_status status = peak_Camera_ResetToDefaultSettings(hCam);
if (PEAK_ERROR(status)) { /* Error handling ... */ }
// Activate the ExposureStart trigger and configure its source to an IO line
// Line0 is typically the default trigger input and is preconfigured in the
// default hardware trigger configuration
// Set trigger mode
status = peak_Trigger_Mode_Set(hCam, PEAK_TRIGGER_MODE_HARDWARE_TRIGGER);
if (PEAK_ERROR(status)) { /* Error handling ... */ }
// Enable trigger mode
status = peak_Trigger_Enable(hCam, PEAK_TRUE);
if (PEAK_ERROR(status)) { /* Error handling ... */ }
// Next step: start acquisition
// VARIATION: GPIO as trigger channel
// Load UserSet "Default", if the configuration of the camera is unclear
peak_status status = peak_Camera_ResetToDefaultSettings(hCam);
if (PEAK_ERROR(status)) { /* Error handling ... */ }
// Create a trigger mode with GPIO_1 on frame start (equals exposure start)
peak_trigger_mode mode = { PEAK_TRIGGER_TARGET_FRAME_START, PEAK_IO_CHANNEL_GPIO_1 };
// Set trigger mode
status = peak_Trigger_Mode_Set(hCam, mode);
if (PEAK_ERROR(status)) { /* Error handling ... */ }
// Enable trigger mode
status = peak_Trigger_Enable(hCam, PEAK_TRUE);
if (PEAK_ERROR(status)) { /* Error handling ... */ }
// Next step: start acquisition
// VARIATION: Falling edge, TriggerDelay and TriggerDivider
// Load UserSet "Default", if the configuration of the camera is unclear
peak_status status = peak_Camera_ResetToDefaultSettings(hCam);
if (PEAK_ERROR(status)) { /* Error handling ... */ }
// Activate the ExposureStart trigger and configure its source to an IO line
// Set trigger mode
status = peak_Trigger_Mode_Set(hCam, PEAK_TRIGGER_MODE_HARDWARE_TRIGGER);
if (PEAK_ERROR(status)) { /* Error handling ... */ }
// Enable trigger mode
status = peak_Trigger_Enable(hCam, PEAK_TRUE);
if (PEAK_ERROR(status)) { /* Error handling ... */ }
// Use the falling edge of Line0 to activate the trigger
status = peak_Trigger_Edge_Set(hCam, PEAK_TRIGGER_EDGE_FALLING);
if (PEAK_ERROR(status)) { /* Error handling ... */ }
// Delay the start of the exposure by 100 us
status = peak_Trigger_Delay_Set(hCam, 100.0);
if (PEAK_ERROR(status)) { /* Error handling ... */ }
// Skip every second trigger signal
status = peak_Trigger_Divider_Set(hCam, 2);
if (PEAK_ERROR(status)) { /* Error handling ... */ }
// Next step: start acquisition
|
try
{
// Get RemoteDevice NodeMap
auto nodeMapRemoteDevice = device->RemoteDevice()->NodeMaps().at(0);
// Load UserSet "Default", if the configuration of the camera is unclear
nodeMapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("UserSetSelector")->SetCurrentEntry("Default");
nodeMapRemoteDevice->FindNode<peak::core::nodes::CommandNode>("UserSetLoad")->Execute();
// Activate the ExposureStart trigger and configure its source to an IO line
nodeMapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("TriggerSelector")->SetCurrentEntry("ExposureStart");
nodeMapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("TriggerMode")->SetCurrentEntry("On");
nodeMapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("TriggerSource")->SetCurrentEntry("Line0");
// Next step: start acquisition
}
catch (const std::exception& e)
{
std::string strError = e.what();
// ...
}
// VARIATION: Falling edge, TriggerDelay and TriggerDivider
try
{
// Get remote device nodemap
auto nodeMapRemoteDevice = device->RemoteDevice()->NodeMaps().at(0);
// Load UserSet "Default", if the configuration of the camera is unclear
nodeMapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("UserSetSelector")->SetCurrentEntry("Default");
nodeMapRemoteDevice->FindNode<peak::core::nodes::CommandNode>("UserSetLoad")->Execute();
// Activate the ExposureStart trigger and configure its source to an IO line
nodeMapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("TriggerSelector")->SetCurrentEntry("ExposureStart");
nodeMapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("TriggerMode")->SetCurrentEntry("On");
nodeMapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("TriggerSource")->SetCurrentEntry("Line0");
// Use the falling edge of Line0 to activate the trigger
nodeMapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("TriggerActivation")->SetCurrentEntry("FallingEdge");
// Delay the start of the exposure by 100 us
nodeMapRemoteDevice->FindNode<peak::core::nodes::FloatNode>("TriggerDelay")->SetValue(100.0);
// Skip every second trigger signal
nodeMapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("TriggerDivider")->SetValue(2);
// Next step: start acquisition
}
catch (const std::exception& e)
{
std::string strError = e.what();
// ...
}
|