Line Connection#
Connection signals are used to control certain camera features. For example, the "TWI SDA" and "TWI SCL" signals are used for Two-Wire Interface communication.
機能を使用する#
Line Connectionの設定#
ライン接続を設定するには、次の手順を実行します。
LineSelectorパラメーターを目的のGPIOラインに設定します。- パラメーターを 
BslLineConnectionパラメーターを次のいずれかの値に設定します。ConnectionOff:現在選択されているラインに接続信号が設定されていません。TwiSda:現在選択されているラインにTWI SDA信号が設定されています。TwiScl:現在選択されているラインにTWI SCL信号が設定されています。LightControl: The light control signal is set for the currently selected line.
 - Make sure the 
LineModeparameter is set toInOut. This allows you to use the GPIO line as an input-output line. If the parameter isn't automatically set toInOut, set it manually. 
Line Connectionの確認#
ライン接続を確認するには、次の手順を実行します。
LineSelectorパラメーターを目的のI/Oラインに設定します。BslLineConnectionパラメーターの値を取得して、I/Oラインの現在のライン接続を確認します。
サンプルコード#
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);
pylon Viewerを使用して、パラメーターを簡単に設定することもできます。