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

Line Timeout#

Line Timeout 相機功能可讓您設定一個最大時間(以微秒為單位);若在此時間內未收到任何新的行觸發訊號,系統便會停止幀擷取。

若您希望將在超時發生前擷取到的不完整幀(部分幀)傳送至主電腦,此功能便相當實用。

此功能僅適用於配備 GigE 介面的Baslerracer 2 S相機。

使用功能#

運作原理#

如果已啟用「Line Timeout 」功能,且 LineTimeout 一旦設定此參數,行超時計時便會在最後一個行觸發訊號發出後立即開始。若在由 LineTimeout 參數時,會發生以下情況:

  • 僅會傳送截至該指令執行時為止所擷取的資料行,也就是說,會以部分幀的形式傳輸至主機。
  • 若已啟用此事件,則會觸發線路超時事件。

範例:運送測試物件的輸送帶發生非預期的停機,導致線路超時,進而使影像擷取過程中斷,因為無法再接收到線路觸發訊號。該部分幀影像會被傳送至主機進行後續處理。

設定Line Timeout#

  1. 將相機中的 BslLineTimeoutEnable 參數設為 true.
  2. 將相機中的 BslLineTimeout 將該參數設定為所需的時間(單位為微秒)。

在設定 BslLineTimeout 參數應考量以下事項:

  • 該的值為 曝光時間 應小於 BslLineTimeout 參數中選擇性地指定 HTML 記錄檔 (*.html) 的路徑與檔名。
  • 運輸裝置的速度 (例如,輸送帶):該 BslLineTimeout 該參數必須足夠大。如果輸送裝置的速度會變化,例如有時較慢、有時較快,請確保該 LineTimeout 參數值大於輸送裝置所需的最長時間。
  • 固定停靠站 運輸裝置的各部分都發揮著作用。該 LineTimeout 參數值應大於常規停機所需的最長時間。

範例程式碼#

// Enable the Line Timeout feature
camera.BslLineTimeoutEnable.SetValue(true);
// Set the line timeout in microseconds
camera.BslLineTimeout.SetValue(1000000);
INodeMap& nodemap = camera.GetNodeMap();
// Enable the Line Timeout feature
CBooleanParameter(nodemap, "BslLineTimeoutEnable").SetValue(true);
// Set the line timeout in microseconds
CIntegerParameter(nodemap, "BslLineTimeout").SetValue(1000000);
// Enable the Line Timeout feature
camera.Parameters[PLCamera.BslLineTimeoutEnable].SetValue(true);
// Set the line timeout in microseconds
camera.Parameters[PLCamera.BslLineTimeout].SetValue(1000000);
/* 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 */
/* Enable the Line Timeout feature */
errRes = PylonDeviceSetBooleanFeature(hdev, "BslLineTimeoutEnable", 1);
CHECK(errRes);
/* Set the line timeout in microseconds */
errRes = PylonDeviceSetIntegerFeature(hdev, "BslLineTimeout", 1000000);
CHECK(errRes);
# Enable the Line Timeout feature
camera.BslLineTimeoutEnable.Value = True
# Set the line timeout in microseconds
camera.BslLineTimeout.Value = 1000000

您也可以 use the pylon Viewer 來輕鬆設定參數。