跳转到内容
暂存服务器
开发服务器

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 轻松设置参数。