跳转到内容

Line Format#

相机的 Line Format 功能使您可以确定 I/O 线路的电气形式。

该功能的使用#

确定 Line Format#

要确定 I/O 线路的电气形式:

  1. LineSelector 参数设置为所需的 I/O 线路,例如 Line1
  2. 获取 LineFormat 参数的值。
    此为只读参数。

可能的值#

可能的值包括:

示例代码#

// Select the desired I/O line
camera.LineSelector.SetValue(LineSelector_Line1);
// Get the electrical format of the line
LineFormatEnums e = camera.LineFormat.GetValue();
INodeMap& nodemap = camera.GetNodeMap();
// Select the desired I/O line
CEnumerationPtr(nodemap.GetNode("LineSelector"))->FromString("Line1");
// Get the electrical format of the line
String_t e = CEnumerationPtr(nodemap.GetNode("LineFormat"))->ToString();
INodeMap& nodemap = camera.GetNodeMap();
// Select the desired I/O line
CEnumParameter(nodemap, "LineSelector").SetValue("Line1");
// Get the electrical format of the line
String_t e = CEnumParameter(nodemap, "LineFormat").GetValue();
// Select the desired I/O line
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line1);
// Get the electrical format of the line
string e = camera.Parameters[PLCamera.LineFormat].GetValue();
// Select the desired I/O line
Pylon.DeviceFeatureFromString(hdev, "LineSelector", "Line1");
// Get the electrical format of the line
string e = Pylon.DeviceFeatureToString(hdev, "LineFormat");
/* 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 the desired I/O line */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line1");
CHECK(errRes);
/* Get the electrical format of the line */
len = sizeof(e_str);
errRes = PylonDeviceFeatureToString(hdev, "LineFormat", e_str, &len);
CHECK(errRes);

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