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

Line Selector#

借助 Line Selector 相機功能,您可以選擇想要設定的 I/O line。

使用此功能#

選擇 Line#

若要選擇 line,請設定 LineSelector 參數至所需的 I/O 線路,例如: Line1 或 LinkSignal1.

根據相機型號,I/O line 的總數、line 的格式(opto-coupled 或 GPIO)以及針腳分配可能會有所不同。對於某些相機型號,您還可以設定 I/O link 信號(即虛擬 I/O 信號)。若要了解您的相機型號支援哪些功能,請查閱相機主題中的「General Specifications」表格與「Physical Interface」章節。您可以在 Area and Line Scan Cameras 章節中找到您的相機主題。

可執行的操作取決於 I/O line 是用作輸入還是輸出。

一旦選定 line,您可以執行以下操作:

任務 功能
為 input line 設定 input filtering Input Filter(若適用)
為 input line 設定 debouncer Line Debouncer(若適用)
為 output line 選擇來源信號 Line Source
為 output line 設定最小脈衝寬度 Line Minimum Output Pulse Width
設定可由使用者設定之 output line 的 Line Status User Output Value
設定 GPIO line 的 Line Mode Line Mode
啟用反轉功能 Line Inverter
檢查單一 I/O line 的狀態 Line Status

範例程式碼#

// Select input line 1
camera.LineSelector.SetValue(LineSelector_Line1);
INodeMap& nodemap = camera.GetNodeMap();
// Select input line 1
CEnumParameter(nodemap, "LineSelector").SetValue("Line1");
// Select input line 1
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line1);
/* 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 */
/* Select input line 1 */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line1");
CHECK(errRes);
# Select input line 1
camera.LineSelector.Value = "Line1"

您也可以使用 pylon Viewer 來輕鬆設定參數。