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.
Set the TriggerMode parameter to On to enable triggered image acquisition.
Configure the trigger:
Set the TriggerSource parameter to define which signal triggers the trigger.
If applicable, set the TriggerActivation parameter to define which signal transition triggers the trigger.
Info
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 activation mode using the TriggerActivation parameter.
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 triggercamera.TriggerMode.SetValue(TriggerMode_On);// Set the trigger source to Line 1camera.TriggerSource.SetValue(TriggerSource_Line1);// Set the trigger activation mode to level highcamera.TriggerActivation.SetValue(TriggerActivation_LevelHigh);
INodeMap&nodemap=camera.GetNodeMap();// Enable triggered image acquisition for the Frame Start triggerCEnumParameter(nodemap,"TriggerMode").SetValue("On");// Set the trigger source to Line 1CEnumParameter(nodemap,"TriggerSource").SetValue("Line1");// Set the trigger activation mode to level highCEnumParameter(nodemap,"TriggerActivation").SetValue("LevelHigh");
// Enable triggered image acquisition for the Frame Start triggercamera.Parameters[PLCamera.TriggerMode].SetValue(PLCamera.TriggerMode.On);// Set the trigger source to Line 1camera.Parameters[PLCamera.TriggerSource].SetValue(PLCamera.TriggerSource.Line1);// Set the trigger activation mode to level highcamera.Parameters[PLCamera.TriggerActivation].SetValue(PLCamera.TriggerActivation.LevelHigh);
/* Macro to check for errors */#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)GENAPIC_RESULTerrRes=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);
# Enable triggered image acquisition for the Frame Start triggercamera.TriggerMode.Value="On"# Set the trigger source to Line 1camera.TriggerSource.Value="Line1"# Set the trigger activation mode to level highcamera.TriggerActivation.Value="LevelHigh"
You can also use the pylon Viewer to easily set the parameters.