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

Line Timeout#

透過 Line Timeout 相機功能,您可以設定最大時間(以微秒為單位),如果在該時間內未收到進一步的行觸發訊號,將會停止畫面擷取。

如果您希望將在逾時發生前擷取的不完整畫面(部分畫面)傳送至主機電腦,這將非常有用。

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

使用此功能#

運作原理#

如果啟用 Line Timeout 功能且 LineTimeout 參數已設定,則行逾時的計時將在發出最後一個行觸發訊號後立即開始。如果在 LineTimeout 參數設定的時間內未收到下一個行觸發訊號,將會發生以下情況:

  • 僅傳送執行命令時已擷取的行,即以部分畫面形式傳輸至主機電腦。
  • 如果已啟用行逾時事件,則會產生該事件。

範例: 運送受測物件的輸送帶意外停止,導致行逾時到期,從而中斷影像擷取程序,因為未收到進一步的行觸發訊號。部分畫面會傳送至主機電腦進行進一步處理。

設定 Line Timeout#

  1. 將 BslLineTimeoutEnable 參數設為 true.
  2. 將 BslLineTimeout 參數設為所需的微秒數。

在設定 BslLineTimeout 參數時,請考慮以下事項:

  • 的數值 曝光時間 應小於 BslLineTimeout 參數的值。
  • 輸送裝置的速度 (例如輸送帶): 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

您也可以使用 pylon Viewer 來輕鬆設定參數。