Line Connection#
연결 신호는 특정 카메라 기능을 제어하는 데 사용됩니다. 예를 들어, "TWI SDA" 및 "TWI SCL" 신호는 Two-Wire Interface 통신에 사용됩니다.
기능 사용법#
Line Connection 설정#
Line Connection 설정 방법:
- 다음 값 중 하나로
LineSelectorparameter를 원하는 GPIO line. - 다음 값 중 하나로
BslLineConnection매개변수를 다음 값 중 하나로 설정합니다:ConnectionOff: 현재 선택된 라인에 설정된 연결 신호가 없습니다.TwiSda: 현재 선택된 라인에 TWI SDA 신호가 설정됩니다.TwiScl: 현재 선택된 라인에 TWI SCL 신호가 설정됩니다.LightControl: 현재 선택된 라인에 Light Control 신호가 설정됩니다.
- 다음을 확인하세요:
LineMode로 설정된 경우InOut. 이를 통해 GPIO line을 입출력 라인으로 사용할 수 있습니다. 파라미터가 자동으로 다음과 같이 설정되지 않는 경우InOut, 수동으로 설정하십시오.
Line Connection 결정#
Line Connection 확인 방법:
- 다음 값 중 하나로
LineSelector파라미터를 원하는 I/O 라인에 설정합니다. - 다음의 값을 가져옵니다:
BslLineConnection파라미터를 사용하여 I/O line의 현재 Line Connection을 확인합니다.
샘플 코드#
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를 사용하여 파라미터를 손쉽게 설정할 수 있습니다.