跳至內容
測試伺服器
開發伺服器

Periodic Signal (dart E)#

dart E 相機上的 Periodic Signal 相機功能可讓您同步多部相機的影像擷取。

使用功能#

運作原理#

支援 Periodic Signal 功能的 Basler dart E 相機提供額外的相機訊號源, PeriodicSignal1。此訊號與透過相機輸入線 1 套用的電氣訊號同步。

例如,如果您將週期為 0.3 秒的電氣訊號套用到輸入線 1,相機內部的 periodic signal 就會調整,進而讓相機每 0.3 秒擷取一次影像。

當您增加或減少電氣訊號的週期時,相機內部的 periodic signal 需要花一些時間來調整至新的週期。相機的影格率也會隨之增加或減少。當您停止套用電氣訊號時,就會發生 Acquisition Stop。

相較於標準硬體觸發,這具有以下優勢:

  • 它允許邊緣觸發(上升緣或下降緣,透過 BslPeriodicSignalActivation 參數進行設定)。標準硬體觸發僅允許位準觸發。
  • 由於相機「知道」訊號是週期的,因此它可以預測下一個訊號並準備好相機進行影像擷取。這縮短了偵測觸發訊號與實際開始曝光之間的時間。
  • 您可以指定負的 Trigger Delay(透過 BslPeriodicSignalDelay 參數進行設定),這表示相機在實際套用電氣訊號之前就會擷取影像。

資訊

Basler 建議以穩定的速率套用電氣訊號。在擷取期間減少或增加週期可能會導致相機行為不穩定,並可能導致掉格。

設定 Periodic Signal#

若要將相機設定為同步影像擷取:

  1. 設定相機由 periodic signal 觸發:
    1. 將相機中的 TriggerMode 參數設為 On.
    2. 將相機中的 TriggerSource 參數設為 PeriodicSignal1.
  2. 設定訊號轉換類型:
    • 如果您希望相機在 下降 緣(輸入訊號的)擷取影像,請將 BslPeriodicSignalActivation 參數設為 FallingEdge.
    • 如果您希望相機在 上升 緣(輸入訊號的)擷取影像,請將 BslPeriodicSignalActivation 參數設為 RisingEdge.
  3. 設定信號延遲:
    • 如果您希望相機在輸入訊號到達時 立即 擷取影像,請設定 BslPeriodicSignalDelay 參數設為 0。
    • 如果您希望相機在輸入訊號到達時 在輸入訊號到達 之前或之後 BslPeriodicSignalDelay parameter 設為納秒 (nanoseconds) 的任何其他值。例如,如果您將參數設為 -500000,相機將會在預期收到下一個信號的 0.5 秒前擷取影像。
  4. 透過相機的 input line 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 輕鬆設定參數。