跳转到内容
STAGING SERVER
DEVELOPMENT SERVER

Line Timeout#

通过 Line Timeout camera feature,您可以设置一个最大时间(以微秒为单位),如果在该时间内未收到进一步的行触发信号,则停止 frame acquisition。

如果您想将直到超时发生时采集的不完整帧(部分帧)发送到主机,这非常有用。

此功能仅适用于配备 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 轻松设置参数。