跳转到内容

Line Overload Status#

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

该功能的使用#

线路过载的原因#

如果将 GPIO 线路配置为输出线路,则必须施加相机主题中指定的对应输出信号电压。您可以在“型号”部分找到适用于您相机的主题。

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

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

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

  1. LineSelector 参数设置为所需的 I/O 线路,例如 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,所有 1 位变为 0。

示例代码#

ace 2 和 boost 相机#

// 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
CEnumerationPtr(nodemap.GetNode("LineSelector"))->FromString("Line1");
// Determine the status of the selected line
bool status = CBooleanPtr(nodemap.GetNode("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 = CIntegerPtr(nodemap.GetNode("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();
// Select a line
Pylon.DeviceFeatureFromString(hdev, "LineSelector", "Line1");
// Determine the status of the selected line
bool status = Pylon.DeviceGetBooleanFeature(hdev, "BslLineOverloadStatus");
// 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 = Pylon.DeviceGetIntegerFeature(hdev, "BslLineOverloadStatusAll");
/* 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.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
CEnumerationPtr(nodemap.GetNode("LineSelector"))->FromString("Line1");
// Determine the status of the selected line
bool status = CBooleanPtr(nodemap.GetNode("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 = CIntegerPtr(nodemap.GetNode("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();
// Select a line
Pylon.DeviceFeatureFromString(hdev, "LineSelector", "Line1");
// Determine the status of the selected line
bool status = Pylon.DeviceGetBooleanFeature(hdev, "LineOverloadStatus");
// 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 = Pylon.DeviceGetIntegerFeature(hdev, "LineOverloadStatusAll");
/* 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);

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