Skip to content

Trigger Software#

The Trigger Software camera feature allows you to trigger the camera by executing a software command.

Using the Feature#

To trigger the camera by executing a software command:

  1. Set the TriggerSelector parameter to the desired trigger type, e.g., FrameStart.
  2. Set the TriggerMode parameter to On.
  3. Set the TriggerSource parameter to Software.
  4. 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.