跳转到内容
STAGING SERVER
DEVELOPMENT SERVER

Line Overload Status#

相机的 Line Overload 功能可让您确定 GPIO 线路是否过载,即供电不正确。

该功能的使用#

线路过载的原因#

如果将 GPIO 线路 配置为输出线路,您必须施加相机主题中指定的相应输出信号电压。您可以在 面阵和线阵相机 部分找到您的相机主题。

如果您未施加适当的电压,可能会发生线路过载。只要未超过相机的绝对最大电压,相机就可以检测到过载并通过 BslLineOverloadStatus 参数。

确定 I/O 线路的过载状态#

要确定 GPIO 线路是否过载,请执行以下操作:

  1. 设置 LineSelector 参数设置为所需的 I/O line,例如 Line1.
  2. 获取 BslLineOverloadStatus 参数报告该过载。该参数为只读。

值为 false (0) 表示 GPIO 线路未过载。

值为 true (1) 表示 GPIO 线路过载。请检查您的 I/O 线路配置。

确定所有 I/O 线路的过载状态#

若要在单个操作中确定所有 I/O 线路的过载状态,请读取 BslLineOverloadStatusAll 参数配置多个输出线路的状态。该参数报告为一个 64 位值。

信息

即: BslLineOverloadStatusAll 参数仅可通过 pylon API 使用,无法通过 pylon Viewer 的功能树使用。

该值中的部分位与 I/O 线路相关联。每一位均指示其关联线路的状态:

  • 如果某位为0,则关联的线路不会过载。
  • 如果某位为1,则关联的线路过载。检查I / O线的配置。

位与线路的关联如下:

  • 位 0 指示 Line1 的状态。
  • 位 1 指示 Line2 的状态。
  • 位 2 指示 Line3 的状态。

示例:所有线路处于高电平 0b111

信息

如果 Line Inverter 功能已启用,相机会反转 BslLineOverloadStatusAll 参数值。所有 0 位变更为 1,反之亦然。

示例代码#

ace 2、boost 和 dart R 相机#
// Select a line
camera.LineSelector.SetValue(LineSelector_Line1);
// Determine the status of the selected line
bool status = camera.BslLineOverloadStatus.GetValue();
// Get the line overload status of all I/O lines
// Because the GenICam interface does not support
// 32-bit words, the line status is reported as a 64-bit value
int64_t lineOverloadStatusAll = camera.BslLineOverloadStatusAll.GetValue();
INodeMap& nodemap = camera.GetNodeMap();
// Select a line
CEnumParameter(nodemap, "LineSelector").SetValue("Line1");
// Determine the status of the selected line
bool status = CBooleanParameter(nodemap, "BslLineOverloadStatus").GetValue();
// Get the line overload status of all I/O lines
// Because the GenICam interface does not support
// 32-bit words, the line status is reported as a 64-bit value
int64_t lineOverloadStatusAll = CIntegerParameter(nodemap, "BslLineOverloadStatusAll").GetValue();
// Select a line
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line1);
// Determine the status of the selected line
bool status = camera.Parameters[PLCamera.BslLineOverloadStatus].GetValue();
// Get the line overload status of all I/O lines
// Because the GenICam interface does not support
// 32-bit words, the line status is reported as a 64-bit value
Int64 lineOverloadStatusAll = camera.Parameters[PLCamera.BslLineOverloadStatusAll].GetValue();
/* 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 */
_Bool status = false;
int64_t lineOverloadStatusAll = 0;
/* Select a line */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line1");
CHECK(errRes);
/* Determine the status of the selected line */
errRes = PylonDeviceGetBooleanFeature(hdev, "BslLineOverloadStatus", &status);
CHECK(errRes);
/* Get the line overload status of all I/O lines */
/* Because the GenICam interface does not support */
/* 32-bit words, the line status is reported as a 64-bit value */
errRes = PylonDeviceGetIntegerFeature(hdev, "BslLineOverloadStatusAll", &lineOverloadStatusAll);
CHECK(errRes);
# Select a line
camera.LineSelector.Value = "Line1"
# Determine the status of the selected line
status = camera.BslLineOverloadStatus.Value
# Get the line overload status of all I/O lines
# Because the GenICam interface does not support
# 32-bit words, the line status is reported as a 64-bit value
lineOverloadStatusAll = camera.BslLineOverloadStatusAll.Value
其他相机#
// Select a line
camera.LineSelector.SetValue(LineSelector_Line1);
// Determine the status of the selected line
bool status = camera.LineOverloadStatus.GetValue();
// Get the line overload status of all I/O lines
// Because the GenICam interface does not support
// 32-bit words, the line status is reported as a 64-bit value
int64_t lineOverloadStatusAll = camera.LineOverloadStatusAll.GetValue();
INodeMap& nodemap = camera.GetNodeMap();
// Select a line
CEnumParameter(nodemap, "LineSelector").SetValue("Line1");
// Determine the status of the selected line
bool status = CBooleanParameter(nodemap, "LineOverloadStatus").GetValue();
// Get the line overload status of all I/O lines
// Because the GenICam interface does not support
// 32-bit words, the line status is reported as a 64-bit value
int64_t lineOverloadStatusAll = CIntegerParameter(nodemap, "LineOverloadStatusAll").GetValue();
// Select a line
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line1);
// Determine the status of the selected line
bool status = camera.Parameters[PLCamera.LineOverloadStatus].GetValue();
// Get the line overload status of all I/O lines
// Because the GenICam interface does not support
// 32-bit words, the line status is reported as a 64-bit value
Int64 lineOverloadStatusAll = camera.Parameters[PLCamera.LineOverloadStatusAll].GetValue();
/* 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 */
_Bool status = false;
int64_t lineOverloadStatusAll = 0;
/* Select a line */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line1");
CHECK(errRes);
/* Determine the status of the selected line */
errRes = PylonDeviceGetBooleanFeature(hdev, "LineOverloadStatus", &status);
CHECK(errRes);
/* Get the line overload status of all I/O lines */
/* Because the GenICam interface does not support */
/* 32-bit words, the line status is reported as a 64-bit value */
errRes = PylonDeviceGetIntegerFeature(hdev, "LineOverloadStatusAll", &lineOverloadStatusAll);
CHECK(errRes);
# Select a line
camera.LineSelector.Value = "Line1"
# Determine the status of the selected line
status = camera.LineOverloadStatus.Value
# Get the line overload status of all I/O lines
# Because the GenICam interface does not support
# 32-bit words, the line status is reported as a 64-bit value
lineOverloadStatusAll = camera.LineOverloadStatusAll.Value

您也可以使用 pylon Viewer 轻松设置参数。