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

Periodic Signal (dart E)#

Periodic Signal 相機功能可讓您 dart E 相機上的「xml-ph-0000@deepl.internal」攝影功能,可讓您同步多台相機的影像擷取。

使用功能#

運作原理#

支援「Periodic Signal 」功能的 Baslerdart E 相機,可提供額外的相機訊號來源, PeriodicSignal1. 該訊號與透過相機輸入線 1 傳入的電訊號保持同步。

舉例來說,若您向輸入線路 1 施加一個週期為 0.3 秒的電訊號,相機的內部週期性訊號便會隨之調整,進而使相機每 0.3 秒擷取一張影像。

當您增加或減少電訊號的週期時,相機的內部週期性訊號需要一段時間才能適應新的週期。相機的幀率會隨之增加或減少。當您停止施加電訊號時,影像擷取也會停止。

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

  • 它支援邊沿觸發(上升沿或下降沿,可透過 BslPeriodicSignalActivation 參數)。標準硬體觸發僅支援電平觸發。
  • 由於相機「知道」該訊號具有週期性,因此能夠預測下一個訊號,並讓相機做好影像擷取的準備。這能縮短從偵測到觸發訊號到實際開始曝光之間的時間。
  • 您可以指定負值的觸發延遲(透過 BslPeriodicSignalDelay 參數),這表示相機會在電訊號實際施加之前就先擷取影像。

資訊

Basler 建議以恆定速率施加電訊號。在擷取過程中縮短或延長週期,可能會導致相機運作不穩定,並可能造成畫面遺失。

設定Periodic Signal#

若要設定相機以進行同步影像擷取:

  1. 將攝影機設定為由週期性訊號觸發:
    1. 將相機中的 TriggerMode 參數設為 On.
    2. 將相機中的 TriggerSource 參數設為 PeriodicSignal1.
  2. 設定訊號轉換類型:
    • 若您希望相機在 墜落 輸入訊號的邊緣,請將 BslPeriodicSignalActivation 參數設為 FallingEdge.
    • 若您希望相機在 上升 輸入訊號的邊緣,請將 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 輕鬆設定參數。