コンテンツにスキップ

Line Logic#

Line Logicカメラ機能を使用すると、I/Oラインのロジックを決定できます。

I/Oラインのロジックは、正または負のいずれかです。

機能を使用する#

Line Logicの決定#

I/Oラインのロジックを決定するには、次の手順に従います。

  1. Set the LineSelector parameter to the desired I/O line.
  2. Get the value of the LineLogic parameter.
    This parameter is read-only.

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を使用して、パラメーターを簡単に設定することもできます。