跳转到内容

Line Inverter#

相机的 Line Inverter 功能使您可以反转 I/O 线路的电信号电平。

所有高 (1) 电平信号都将转换为低 (0) 电平信号,反之亦然。

该功能的使用#

启用 Line Inverter#

信息

仅应在未使用 I/O 线路时启用线路逆变器。否则,相机可能会出现无法预料的行为。

  1. 设置 LineSelector parameter to the desired I/O line.
  2. 设置 LineInverter parameter to true to invert the electrical signal level of the I/O line selected or to false to disable inversion.

示例代码#

// Select Line 1
camera.LineSelector.SetValue(LineSelector_Line1);
// Enable the line inverter for the I/O line selected
camera.LineInverter.SetValue(true);
INodeMap& nodemap = camera.GetNodeMap();
// Select Line 1
CEnumParameter(nodemap, "LineSelector").SetValue("Line1");
// Enable the line inverter for the I/O line selected
CBooleanParameter(nodemap, "LineInverter").SetValue(true);
// Select Line 1
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line1);
// Enable the line inverter for the I/O line selected
camera.Parameters[PLCamera.LineInverter].SetValue(true);
/* 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 Line 1 */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line1");
CHECK(errRes);
/* Enable the line inverter for the I/O line selected */
errRes = PylonDeviceSetBooleanFeature(hdev, "LineInverter", 1);
CHECK(errRes);
# Select Line 1
camera.LineSelector.Value = "Line1"
# Enable the line inverter for the I/O line selected
camera.LineInverter.Value = True

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