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

Line Selector#

「Line Selector 」相機功能可讓您選擇要進行設定的 I/O 線路。

使用功能#

選擇一行#

要選取一行,請將 LineSelector 參數設為所需的 I/O 線路,例如: Line1 或 LinkSignal1.

視相機型號而定,I/O 線的總數、線路格式(光耦合或 GPIO)以及腳位配置可能會有所不同。 對於某些相機型號,您亦可配置 I/O 鏈路訊號(即虛擬 I/O 訊號)。若要了解您的相機型號提供哪些功能,請查閱相機相關主題中的「一般規格」表格及「物理介面」章節。您可在「區域式與線掃式相機」章節中找到相應的相機主題。

可能的任務取決於該 I/O 線路是用作輸入還是輸出。

選取一行後,您可以執行以下操作:

工作 功能
為輸入線配置輸入過濾設定 Input Filter (如有)
為輸入線配置去抖動電路 Line Debouncer (如有)
為輸出線選擇來源訊號 Line Source
設定輸出線路的最小脈衝寬度 Line Minimum Output Pulse Width
設定可由使用者設定的輸出線路之線路狀態 User Output Value
設定 GPIO 線路的運作模式 Line Mode
啟用反轉功能 Line Inverter
檢查單一 I/O 線的狀態 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"

您也可以 use the pylon Viewer 來輕鬆設定參數。