跳至內容
測試伺服器
開發伺服器

Line Overload Status#

藉由 Line Overload Status camera feature,您可以判斷 GPIO 線路是否過載(即供電不正確)。

使用此功能#

線路過載的原因#

如果 GPIO 線路已設定為輸出線路,您必須施加相機主題中指定的適當輸出訊號電壓。您可以在面陣與線陣相機專區找到您的相機主題。

若未施加適當的電壓,可能會發生線路過載。只要未超過相機的絕對最大電壓,相機就能偵測到過載並透過以下方式回報: BslLineOverloadStatus 參數的值。

判斷 I/O 線路的過載狀態#

若要判斷 GPIO 線路是否過載:

  1. 將 LineSelector 參數至所需的 I/O 線路,例如: Line1.
  2. 取得 BslLineOverloadStatus 參數。此參數為唯讀。

數值 false (0) 表示 GPIO 線路未過載。

數值 true (1) 表示 GPIO 線路過載。請檢查您的 I/O 線路組態。

確定所有 I/O Lines 的過載狀態#

若要透過單一操作判斷所有 I/O 線路的過載狀態,請讀取 BslLineOverloadStatusAll 參數。此參數回報為 64 位元數值。

資訊

影像 BslLineOverloadStatusAll 參數僅能透過 pylon API 取得,無法透過 pylon Viewer 功能樹狀結構取得。

數值中的特定位元會與 I/O 線路建立關聯。每個位元皆會顯示其對應線路的狀態:

  • 若位元為 0,表示對應的線路未過載。
  • 若位元為 1,表示對應的線路過載。請檢查您的 I/O 線路組態。

位元與線路的對應關係如下:

  • 位元 0 表示 Line1 狀態。
  • 位元 1 表示 Line2 狀態。
  • 位元 2 表示 Line3 狀態。

範例:所有線路皆為 high = 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 來輕鬆設定參數。