Line Overload Status#
该功能的使用#
线路过载的原因#
If a GPIO line is configured as an output line, you must apply appropriate output signal voltages as specified in your camera topic. You can find your camera topic in the Area and Line Scan Cameras section.
如果施加的电压不当,则可能会发生线路过载。只要不超过相机的绝对最大电压,相机就可以检测过载并通过 BslLineOverloadStatus 参数报告。
确定 I/O 线路的过载状态#
要确定 GPIO 线路是否过载,请执行以下操作:
- 将
LineSelector参数设置为所需的 I/O 线路,例如Line1。 - 获取
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, and dart R Cameras#
// 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 轻松设置参数。