Line Overload Status#
该功能的使用#
线路过载的原因#
如果将 GPIO 线路配置为输出线路,则必须施加相机主题中指定的对应输出信号电压。您可以在“型号”部分找到适用于您相机的主题。
If you don't apply the appropriate voltages, a line overload may occur. As long as the absolute maximum voltage of the camera is not exceeded, the camera can detect the overload and report it via the BslLineOverloadStatus
parameter.
确定 I/O 线路的过载状态#
要确定 GPIO 线路是否过载,请执行以下操作:
- 设置
LineSelector
parameter to the desired I/O line, e.g.,Line1
. - Get the value of the
BslLineOverloadStatus
parameter. The parameter is read-only.
A value of false
(0) means that the GPIO line is not overloaded.
A value of true
(1) means that the GPIO line is overloaded. Check the configuration of your I/O lines.
确定所有 I/O 线路的过载状态#
To determine the overload status of all I/O lines in a single operation, read the BslLineOverloadStatusAll
parameter. The parameter is reported as a 64-bit value.
信息
即: BslLineOverloadStatusAll
parameter is only available via the pylon API, not via the pylon Viewer feature tree.
该值中的部分位与 I/O 线路相关联。每一位均指示其关联线路的状态:
- 如果某位为0,则关联的线路不会过载。
- 如果某位为1,则关联的线路过载。检查I / O线的配置。
位与线路的关联如下:
- 位 0 指示 Line1 的状态。
- 位 1 指示 Line2 的状态。
- 位 2 指示 Line3 的状态。
示例:所有线路处于高电平 0b111
信息
If the Line Inverter feature is enabled, the camera inverts the BslLineOverloadStatusAll
parameter value. All 0 bits change to 1, and vice versa.
示例代码#
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 轻松设置参数。