Trigger Software#
Using the Feature#
To trigger the camera by executing a software command:
- Set the
TriggerSelector
parameter to the desired trigger type, e.g.,FrameStart
. - Set the
TriggerMode
parameter toOn
. - Set the
TriggerSource
parameter toSoftware
. - Execute the
TriggerSoftware
command.
A software trigger signal is sent. The signal triggers the selected trigger type.
Sample Code#
// Select the Frame Start trigger
camera.TriggerSelector.SetValue(TriggerSelector_FrameStart);
// Enable triggered image acquisition for the Frame Start trigger
camera.TriggerMode.SetValue(TriggerMode_On);
// Set the trigger source for the Frame Start trigger to Software
camera.TriggerSource.SetValue(TriggerSource_Software);
// Generate a software trigger signal
camera.TriggerSoftware.Execute();
INodeMap& nodemap = camera.GetNodeMap();
// Select the Frame Start trigger
CEnumParameter(nodemap, "TriggerSelector").SetValue("FrameStart");
// Enable triggered image acquisition for the Frame Start trigger
CEnumParameter(nodemap, "TriggerMode").SetValue("On");
// Set the trigger source for the Frame Start trigger to Software
CEnumParameter(nodemap, "TriggerSource").SetValue("Software");
// Generate a software trigger signal
CCommandParameter(nodemap, "TriggerSoftware").Execute();
// Select the Frame Start trigger
camera.Parameters[PLCamera.TriggerSelector].SetValue(PLCamera.TriggerSelector.FrameStart);
// Enable triggered image acquisition for the Frame Start trigger
camera.Parameters[PLCamera.TriggerMode].SetValue(PLCamera.TriggerMode.On);
// Set the trigger source for the Frame Start trigger to Software
camera.Parameters[PLCamera.TriggerSource].SetValue(PLCamera.TriggerSource.Software);
// Generate a software trigger signal
camera.Parameters[PLCamera.TriggerSoftware].Execute();
/* 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 */
/* Select the Frame Start trigger */
errRes = PylonDeviceFeatureFromString(hdev, "TriggerSelector", "FrameStart");
CHECK(errRes);
/* Enable triggered image acquisition for the Frame Start trigger */
errRes = PylonDeviceFeatureFromString(hdev, "TriggerMode", "On");
CHECK(errRes);
/* Set the trigger source for the Frame Start trigger to Software */
errRes = PylonDeviceFeatureFromString(hdev, "TriggerSource", "Software");
CHECK(errRes);
/* Generate a software trigger signal */
errRes = PylonDeviceExecuteCommandFeature(hdev, "TriggerSoftware");
CHECK(errRes);
You can also use the pylon Viewer to easily set the parameters.