跳转到内容

Line Selector#

相机的 Line Selector 功能允许您选择要配置的 I/O 线路。

该功能的使用#

选择一条线路#

To select a line, set the LineSelector parameter to the desired I/O line, e.g., Line1.

根据相机型号的不同,I/O 线路的总数、线路的格式(光电耦合GPIO)以及引脚分配可能会有所不同。要了解您相机型号的具体规格,请检查相机主题中的“物理接口”部分。您可以在“型号”部分中找到适用于您相机的主题。

可能的任务取决于 I/O 线路用作输入还是输出

选择一条线路后,可以执行以下操作:

任务 功能
为输入线路配置消抖 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"

您也可以使用 pylon Viewer 轻松设置参数。