Periodic Signal#

The Periodic Signal camera feature allows you to generate periodic trigger signals that are synchronized across devices.

This allows you to, e.g., capture images on multiple cameras at the same time and the same frame rate.

This feature is similar to the Synchronous Free Run feature, but apart image acquisition it can also be used for other purposes.

Using the Feature#

How It Works#

Basler cameras supporting the Periodic Signal feature provide an additional camera signal source, PeriodicSignal1. Via this source, the camera transmits a signal with the following characteristics:

  • The signal is repetitive.
  • The signal can be synchronized across devices via Precision Time Protocol.
  • The period of the signal can be configured.
  • The delay before the first period can be configured.

The PeriodicSignal1 signal source can be used for many different purposes, e.g., to synchronize counters or image acquisition across devices.

Using Periodic Signal to Synchronize Image Acquisition#

To synchronize image acquisition on multiple cameras:

  1. Open one of the cameras that you want to synchronize using Periodic Signal.
  2. Make sure that the BslPeriodicSignalSource parameter on the camera is set to PtpClock.
    This indicates that the camera is synchronized via the Precision Time Protocol feature.
  3. Set the BslPeriodicSignalPeriod parameter to the reciprocal of the desired frame rate, converted to microseconds. For example, if you want to synchronize the cameras at 50 frames per second, set the parameter to 20000 (1/50 = 0.02 seconds = 20000 microseconds). You must specify the same parameter value on all cameras.
  4. Configure the periodic signal delay:
    • If you want all cameras to acquire images at the same time, set the BslPeriodicSignalDelay parameter to 0 on all cameras.
    • If you want all cameras to acquire images sequentially, i.e, in regular intervals, set the BslPeriodicSignalDelay parameter to 0 on the first camera and to multiples of the desired interval on the other cameras.
      For example, assume you want to acquire images with an interval of 10000 µs between cameras. To do so, set the delay to 0 on the first camera, to 10000 on the second camera, to 20000 on the third camera, and so on.
  5. Configure the camera to be triggered by the periodic signal:
    1. Set the TriggerSelector parameter to FrameStart.
    2. Set the TriggerMode parameter to On.
    3. Set the TriggerSource parameter to PeriodicSignal1.
  6. Repeat steps 1 to 5 for all cameras.

Using Periodic Signal to Synchronously Trigger External Devices#

You can use the Periodic Signal feature to synchronously trigger external devices. This allows you to make non-PTP devices PTP-capable.

The camera's internal periodic signal can't be used as an I/O signal. However, you can trigger the camera's Timer feature using the periodic signal, and then use the timer signal as an I/O signal.

To do so:

  1. Open the camera that you want to use to trigger the external device.
  2. Make sure that the BslPeriodicSignalSource parameter on the camera is set to PtpClock.
    This indicates that the camera is synchronized via the Precision Time Protocol feature.
  3. Set the BslPeriodicSignalPeriod parameter to the reciprocal of the desired trigger rate, converted to microseconds. For example, if you want to generate 20 trigger signals per second, set the parameter to 50000 (1/20 = 0.05 seconds = 50000 microseconds).
  4. If you want to trigger the external device with a time delay, set the BslPeriodicSignalDelay parameter to the desired delay.
  5. Configure the camera's Timer feature to be triggered by periodic signals:
    1. Set the TimerSelector parameter to Timer1.
    2. Set the TimerDuration parameter to the desired timer duration in microseconds.
      The camera will send an I/O signal with a width equal to this value. Therefore, set a parameter value high enough for the external device to be able to receive the signal. In most cases, the default value of 10 µs should be sufficient.
    3. Set the TimerTriggerSource parameter to PeriodicSignal1.
  6. Configure the camera to output the timer signal:
    1. Set the LineSelector parameter to the desired I/O line, e.g., Line2. The line must be configured as output.
    2. Set the LineSource parameter to Timer1Active.
  7. Connect the external device to the output line selected in step 6.
    The device now receives synchronized trigger signals on this line.
  8. If you want to trigger another external device, repeat steps 1 to 6, using Timer2 and Timer2Active in steps 5 and 6.

Info

You can also synchronize image acquisition between cameras and synchronously trigger external devices using the same periodic signal. To do so, carry out both the procedures detailed above.

Additional Parameters#

  • BslPeriodicSignalSelector: Sets the periodic signal channel to be configured. Because all Basler cameras currently offer one channel, this parameter is preset to PeriodicSignal1 and can't be changed.

Sample Code#

/* Using Periodic Signal to Synchronize Image Acquisition */
// Set the signal period to 20000 µs
camera.BslPeriodicSignalPeriod.SetValue(20000.0);
// Set the signal delay to 0
camera.BslPeriodicSignalDelay.SetValue(0);
// Configure the camera to be triggered by the periodic signal
camera.TriggerSelector.SetValue(TriggerSelector_FrameStart);
camera.TriggerMode.SetValue(TriggerMode_On);
camera.TriggerSource.SetValue(TriggerSource_PeriodicSignal1);

/* Using Periodic Signal to Synchronously Trigger External Devices */
// Set the signal period to 50000 µs
camera.BslPeriodicSignalPeriod.SetValue(50000.0);
// Set the signal delay to 0
camera.BslPeriodicSignalDelay.SetValue(0);
// Configure the camera's Timer feature to be triggered by periodic signals
camera.TimerSelector.SetValue(TimerSelector_Timer1);
camera.TimerDuration.SetValue(10.0);
camera.TimerTriggerSource.SetValue(TimerTriggerSource_PeriodicSignal1);
// Configure the camera to output the timer signal on Line 2
camera.LineSelector.SetValue(LineSelector_Line2);
camera.LineMode.SetValue(LineMode_Output);
camera.LineSource.SetValue(LineSource_Timer1Active);
INodeMap& nodemap = camera.GetNodeMap();
/*Using Periodic Signal to Synchronize Image Acquisition*/

CFloatPtr(nodemap.GetNode("BslPeriodicSignalPeriod"))->SetValue(20000.0);
// Set the signal delay to 0
CIntegerPtr(nodemap.GetNode("BslPeriodicSignalDelay"))->SetValue(0);
// Configure the camera to be triggered by the periodic signal
CEnumerationPtr(nodemap.GetNode("TriggerSelector"))->FromString("FrameStart");
CEnumerationPtr(nodemap.GetNode("TriggerMode"))->FromString("On");
CEnumerationPtr(nodemap.GetNode("TriggerSource"))->FromString("PeriodicSignal1");

/*Using Periodic Signal to Synchronously Trigger External Devices*/

CFloatPtr(nodemap.GetNode("BslPeriodicSignalPeriod"))->SetValue(50000.0);
// Set the signal delay to 0
CIntegerPtr(nodemap.GetNode("BslPeriodicSignalDelay"))->SetValue(0);
// Configure the camera's Timer feature to be triggered by periodic signals
CEnumerationPtr(nodemap.GetNode("TimerSelector"))->FromString("Timer1");
CFloatPtr(nodemap.GetNode("TimerDuration"))->SetValue(10.0);
CEnumerationPtr(nodemap.GetNode("TimerTriggerSource"))->FromString("PeriodicSignal1");
// Configure the camera to output the timer signal on Line 2
CEnumerationPtr(nodemap.GetNode("LineSelector"))->FromString("Line2");
CEnumerationPtr(nodemap.GetNode("LineMode"))->FromString("Output");
CEnumerationPtr(nodemap.GetNode("LineSource"))->FromString("Timer1Active");
INodeMap& nodemap = camera.GetNodeMap();
/*Using Periodic Signal to Synchronize Image Acquisition*/

CFloatParameter(nodemap, "BslPeriodicSignalPeriod").SetValue(20000.0);
// Set the signal delay to 0
CIntegerParameter(nodemap, "BslPeriodicSignalDelay").SetValue(0);
// Configure the camera to be triggered by the periodic signal
CEnumParameter(nodemap, "TriggerSelector").SetValue("FrameStart");
CEnumParameter(nodemap, "TriggerMode").SetValue("On");
CEnumParameter(nodemap, "TriggerSource").SetValue("PeriodicSignal1");

/*Using Periodic Signal to Synchronously Trigger External Devices*/

CFloatParameter(nodemap, "BslPeriodicSignalPeriod").SetValue(50000.0);
// Set the signal delay to 0
CIntegerParameter(nodemap, "BslPeriodicSignalDelay").SetValue(0);
// Configure the camera's Timer feature to be triggered by periodic signals
CEnumParameter(nodemap, "TimerSelector").SetValue("Timer1");
CFloatParameter(nodemap, "TimerDuration").SetValue(10.0);
CEnumParameter(nodemap, "TimerTriggerSource").SetValue("PeriodicSignal1");
// Configure the camera to output the timer signal on Line 2
CEnumParameter(nodemap, "LineSelector").SetValue("Line2");
CEnumParameter(nodemap, "LineMode").SetValue("Output");
CEnumParameter(nodemap, "LineSource").SetValue("Timer1Active");
/*Using Periodic Signal to Synchronize Image Acquisition*/

camera.Parameters[PLCamera.BslPeriodicSignalPeriod].SetValue(20000.0);
// Set the signal delay to 0
camera.Parameters[PLCamera.BslPeriodicSignalDelay].SetValue(0);
// Configure the camera to be triggered by the periodic signal
camera.Parameters[PLCamera.TriggerSelector].SetValue(PLCamera.TriggerSelector.FrameStart);
camera.Parameters[PLCamera.TriggerMode].SetValue(PLCamera.TriggerMode.On);
camera.Parameters[PLCamera.TriggerSource].SetValue(PLCamera.TriggerSource.PeriodicSignal1);

/*Using Periodic Signal to Synchronously Trigger External Devices*/

camera.Parameters[PLCamera.BslPeriodicSignalPeriod].SetValue(50000.0);
// Set the signal delay to 0
camera.Parameters[PLCamera.BslPeriodicSignalDelay].SetValue(0);
// Configure the camera's Timer feature to be triggered by periodic signals
camera.Parameters[PLCamera.TimerSelector].SetValue(PLCamera.TimerSelector.Timer1);
camera.Parameters[PLCamera.TimerDuration].SetValue(10.0);
camera.Parameters[PLCamera.TimerTriggerSource].SetValue(PLCamera.TimerTriggerSource.PeriodicSignal1);
// Configure the camera to output the timer signal on Line 2
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line2);
camera.Parameters[PLCamera.LineMode].SetValue(PLCamera.LineMode.Output);
camera.Parameters[PLCamera.LineSource].SetValue(PLCamera.LineSource.Timer1Active);
/*Using Periodic Signal to Synchronize Image Acquisition*/

Pylon.DeviceSetFloatFeature(hdev, "BslPeriodicSignalPeriod", 20000.0);
// Set the signal delay to 0
Pylon.DeviceSetIntegerFeature(hdev, "BslPeriodicSignalDelay", 0);
// Configure the camera to be triggered by the periodic signal
Pylon.DeviceFeatureFromString(hdev, "TriggerSelector", "FrameStart");
Pylon.DeviceFeatureFromString(hdev, "TriggerMode", "On");
Pylon.DeviceFeatureFromString(hdev, "TriggerSource", "PeriodicSignal1");

/*Using Periodic Signal to Synchronously Trigger External Devices*/

Pylon.DeviceSetFloatFeature(hdev, "BslPeriodicSignalPeriod", 50000.0);
// Set the signal delay to 0
Pylon.DeviceSetIntegerFeature(hdev, "BslPeriodicSignalDelay", 0);
// Configure the camera's Timer feature to be triggered by periodic signals
Pylon.DeviceFeatureFromString(hdev, "TimerSelector", "Timer1");
Pylon.DeviceSetFloatFeature(hdev, "TimerDuration", 10.0);
Pylon.DeviceFeatureFromString(hdev, "TimerTriggerSource", "PeriodicSignal1");
// Configure the camera to output the timer signal on Line 2
Pylon.DeviceFeatureFromString(hdev, "LineSelector", "Line2");
Pylon.DeviceFeatureFromString(hdev, "LineMode", "Output");
Pylon.DeviceFeatureFromString(hdev, "LineSource", "Timer1Active");
/* 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 */
/*Using Periodic Signal to Synchronize Image Acquisition*/

errRes = PylonDeviceSetFloatFeature(hdev, "BslPeriodicSignalPeriod", 20000.0);
CHECK(errRes);
/* Set the signal delay to 0 */
errRes = PylonDeviceSetIntegerFeature(hdev, "BslPeriodicSignalDelay", 0);
CHECK(errRes);
/* Configure the camera to be triggered by the periodic signal */
errRes = PylonDeviceFeatureFromString(hdev, "TriggerSelector", "FrameStart");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "TriggerMode", "On");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "TriggerSource", "PeriodicSignal1");
CHECK(errRes);

/*Using Periodic Signal to Synchronously Trigger External Devices*/

errRes = PylonDeviceSetFloatFeature(hdev, "BslPeriodicSignalPeriod", 50000.0);
CHECK(errRes);
/* Set the signal delay to 0 */
errRes = PylonDeviceSetIntegerFeature(hdev, "BslPeriodicSignalDelay", 0);
CHECK(errRes);
/* Configure the camera's Timer feature to be triggered by periodic signals */
errRes = PylonDeviceFeatureFromString(hdev, "TimerSelector", "Timer1");
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "TimerDuration", 10.0);
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "TimerTriggerSource", "PeriodicSignal1");
CHECK(errRes);
/* Configure the camera to output the timer signal on Line 2 */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line2");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "LineMode", "Output");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "LineSource", "Timer1Active");
CHECK(errRes);

You can also use the pylon Viewer to easily set the parameters.