コンテンツにスキップ
ステージングサーバー
開発サーバー

Line Connection#

のLine Connection カメラ機能を使用すると、現在選択されている汎用入出力ライン(GPIOライン)の接続信号を設定または決定できます。

接続信号は、カメラの特定の機能を制御するために使用されます。例えば、「TWI SDA」信号と「TWI SCL」信号は、 Two-Wire Interface通信に使用されます。

機能を使用する#

Line Connectionの設定#

ライン接続を設定するには、次の手順を実行します。

  1. パラメーターを LineSelector パラメータで目的の GPIOライン.
  2. パラメーターを BslLineConnection パラメーターを次のいずれかの値に設定します。
    • ConnectionOff現在選択されている回線には接続信号が設定されていません。
    • TwiSdaTWI SDA信号は、現在選択されている回線に対して設定されます。
    • TwiSclTWI SCL信号は、現在選択されている回線に設定されます。
    • LightControl:現在選択されているラインに対して、光制御信号が設定されます。
  3. 必ず LineMode パラメータが次のように設定されている場合: InOutこれにより、GPIO ラインを入出力ラインとして使用できます。パラメータが自動的に設定されていない場合は、 InOut手動で設定してください。

Line Connectionの確認#

ライン接続を確認するには、次の手順を実行します。

  1. パラメーターを LineSelector 目的の入出力ラインへのパラメータ。
  2. 次の値を取得します: BslLineConnection 入出力ラインの現在の接続状態を決定するためのパラメータ。

サンプルコード#

// Select Line 2
camera.LineSelector.SetValue(LineSelector_Line2);
// Set the line connection to TWI SDA
camera.BslLineConnection.SetValue(BslLineConnection_TwiSda);
// Get the current line connection
BslLineConnectionEnums e = camera.BslLineConnection.GetValue();
INodeMap& nodemap = camera.GetNodeMap();
// Select Line 2
CEnumParameter(nodemap, "LineSelector").SetValue("Line2");
// Set the line connection to TWI SDA
CEnumParameter(nodemap, "BslLineConnection").SetValue("TwiSda");
// Get the current line connection
String_t e = CEnumParameter(nodemap, "BslLineConnection").GetValue();
// Select Line 2
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line2);
// Set the line connection to TWI SDA
camera.Parameters[PLCamera.BslLineConnection].SetValue(PLCamera.BslLineConnection.TwiSda);
// Get the current line connection
string e = camera.Parameters[PLCamera.BslLineConnection].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 Line 2 */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line2");
CHECK(errRes);
/* Set the line connection to TWI SDA */
errRes = PylonDeviceFeatureFromString(hdev, "BslLineConnection", "TwiSda");
CHECK(errRes);
/* Get the current line connection */
len = sizeof(e_str);
errRes = PylonDeviceFeatureToString(hdev, "BslLineConnection", e_str, &len);
CHECK(errRes);
# Select Line 2
camera.LineSelector.Value = "Line2"
# Set the line connection to TWI SDA
camera.BslLineConnection.Value = "TwiSda"
# Get the current line connection
e = camera.BslLineConnection.Value

pylon Viewerを使用して、パラメーターを簡単に設定することもできます。