跳转到内容

Line Logic#

相机的 Line Logic 功能使您可以确定 I/O 线路的逻辑。

I/O 线路的逻辑可以为正或负。

该功能的使用#

确定 Line Logic#

要确定 I/O 线路的逻辑:

  1. 设置 LineSelector parameter to the desired I/O line.
  2. Get the value of the LineLogic parameter.
    此为只读参数。

Line Logic 概况#

Positive Line Logic#

If the line logic is positive, the relation between the electrical status of an I/O line and the LineStatus parameter is as follows:

电气状态 LineStatus 参数值
电压电平高 True
电压电平低 False

Negative Line Logic#

If the line logic is negative, the relation between the electrical status of an I/O line and the LineStatus parameter is as follows:

电气状态 LineStatus 参数值
电压电平高 False
电压电平低 True

示例代码#

// Select a line
camera.LineSelector.SetValue(LineSelector_Line1);
// Get the logic of the line
LineLogicEnums e = camera.LineLogic.GetValue();
INodeMap& nodemap = camera.GetNodeMap();
// Select a line
CEnumParameter(nodemap, "LineSelector").SetValue("Line1");
// Get the logic of the line
String_t e = CEnumParameter(nodemap, "LineLogic").GetValue();
// Select a line
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line1);
// Get the logic of the line
string e = camera.Parameters[PLCamera.LineLogic].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 */
size_t len = 0;
char e_str[64] = {0};
/* Select a line */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line1");
CHECK(errRes);
/* Get the logic of the line */
len = sizeof(e_str);
errRes = PylonDeviceFeatureToString(hdev, "LineLogic", e_str, &len);
CHECK(errRes);
# Select a line
camera.LineSelector.Value = "Line1"
# Get the logic of the line
e = camera.LineLogic.Value

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