跳转到内容
STAGING SERVER
DEVELOPMENT SERVER

Periodic Signal (dart E)#

dart E 相机上的 Periodic Signal 相机功能允许您在多个相机上同步图像采集。

该功能的使用#

运作原理#

支持 Periodic Signal 功能的 Basler dart E 相机提供了一个额外的相机信号源, PeriodicSignal1。该信号与通过相机的输入线路 1 施加的电信号同步。

例如,如果您将周期为 0.3 秒的电信号施加到输入线 1,则相机的内部周期信号会进行调整,进而使相机每隔 0.3 秒捕获一次图像。

当您延长或缩短电信号的周期时,相机的内部周期信号需要一段时间才能调整到新的周期。相机的帧速率会相应增加或减少。当您停止施加电信号时,图像采集将停止。

与标准的硬件触发相比,它具有以下优点:

  • 它允许边沿触发(上升沿或下降沿,通过 BslPeriodicSignalActivation 参数进行配置)。标准硬件触发仅允许电平触发。
  • 因为相机“知道”信号是周期性的,所以它可以预测下一个信号并使相机准备好进行图像采集。这缩短了从检测到触发信号到实际开始曝光之间的时间。
  • 您可以指定负的 Trigger Delay(通过 BslPeriodicSignalDelay 参数配置),这意味着相机在实际施加电信号之前采集图像。

信息

Basler 建议以稳定的速率施加电信号。采集期间缩短或延长周期会导致不稳定的相机行为,并可能导致丢帧。

配置 Periodic Signal#

要将相机配置为进行同步图像采集:

  1. 将相机配置为由 periodic signal 触发:
    1. 设置 TriggerMode 参数至 On.
    2. 设置 TriggerSource 参数至 PeriodicSignal1.
  2. 配置信号过渡类型:
    • 如果您希望相机在输入信号的 下降沿 捕获图像,请将上升沿 BslPeriodicSignalActivation 参数至 FallingEdge.
    • 如果您希望相机在输入信号的 rising 捕获图像,请将上升沿 BslPeriodicSignalActivation 参数至 RisingEdge.
  3. 配置信号延迟:
    • 如果您希望相机在输入信号到达时 立即 捕获图像,请将 BslPeriodicSignalDelay 参数设置为 0。
    • 如果您希望相机在输入信号到达时 之前或之后 输入信号到达,请将 BslPeriodicSignalDelay 参数设置为纳秒级的任何其他值。例如,如果将该参数设置为 -500000,相机将在预期下一个信号到达前的 0.5 秒采集图像。
  4. 通过相机的输入线 1 施加周期性的电信号。

示例代码#

// Configure the camera to be triggered by the periodic signal
// Note: You must set the trigger source first and then the trigger mode
camera.TriggerSource.SetValue(TriggerSource_PeriodicSignal1);
camera.TriggerMode.SetValue(TriggerMode_On);
// Set the transition type to falling edge
camera.BslPeriodicSignalActivation.SetValue(BslPeriodicSignalActivation_FallingEdge);
// Set the signal delay to 0
camera.BslPeriodicSignalDelay.SetValue(0);
INodeMap& nodemap = camera.GetNodeMap();
// Configure the camera to be triggered by the periodic signal
// Note: You must set the trigger source first and then the trigger mode
CEnumParameter(nodemap, "TriggerSource").SetValue("PeriodicSignal1");
CEnumParameter(nodemap, "TriggerMode").SetValue("On");
// Set the transition type to falling edge
CEnumParameter(nodemap, "BslPeriodicSignalActivation").SetValue("FallingEdge");
// Set the signal delay to 0
CIntegerParameter(nodemap, "BslPeriodicSignalDelay").SetValue(0);
// Configure the camera to be triggered by the periodic signal
// Note: You must set the trigger source first and then the trigger mode
camera.Parameters[PLCamera.TriggerSource].SetValue(PLCamera.TriggerSource.PeriodicSignal1);
camera.Parameters[PLCamera.TriggerMode].SetValue(PLCamera.TriggerMode.On);
// Set the transition type to falling edge
camera.Parameters[PLCamera.BslPeriodicSignalActivation].SetValue(PLCamera.BslPeriodicSignalActivation.FallingEdge);
// Set the signal delay to 0
camera.Parameters[PLCamera.BslPeriodicSignalDelay].SetValue(0);
/* 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 */
/* Configure the camera to be triggered by the periodic signal */
/* Note: You must set the trigger source first and then the trigger mode */
errRes = PylonDeviceFeatureFromString(hdev, "TriggerSource", "PeriodicSignal1");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "TriggerMode", "On");
CHECK(errRes);
/* Set the transition type to falling edge */
errRes = PylonDeviceFeatureFromString(hdev, "BslPeriodicSignalActivation", "FallingEdge");
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
# Note: You must set the trigger source first and then the trigger mode
camera.TriggerSource.Value = "PeriodicSignal1"
camera.TriggerMode.Value = "On"
# Set the transition type to falling edge
camera.BslPeriodicSignalActivation.Value = "FallingEdge"
# Set the signal delay to 0
camera.BslPeriodicSignalDelay.Value = 0
/* 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 */
/* Configure the camera to be triggered by the periodic signal */
errRes = PylonDeviceFeatureFromString(hdev, "TriggerMode", "On");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "TriggerSource", "PeriodicSignal1");
CHECK(errRes);
/* Set the transition type to falling edge */
errRes = PylonDeviceFeatureFromString(hdev, "BslPeriodicSignalActivation", "FallingEdge");
CHECK(errRes);
/* Set the signal delay to 0 */
errRes = PylonDeviceSetIntegerFeature(hdev, "BslPeriodicSignalDelay", 0);
CHECK(errRes);

您还可以使用 pylon Viewer 轻松设置参数。