Line Connection#
연결 신호는 특정 카메라 기능을 제어하는 데 사용됩니다. 예를 들어, "TWI SDA" 및 "TWI SCL" 신호는 Two-Wire Interface 통신에 사용됩니다.
기능 사용#
Line Connection 설정#
Line Connection을 설정하려면:
- 파라미터를 원하는
LineSelector매개변수를 원하는 GPIO line. - 파라미터를 원하는
BslLineConnection파라미터를 설정하십시오:ConnectionOff: 현재 선택된 라인에 설정된 연결 신호가 없습니다.TwiSda: 현재 선택된 라인에 TWI SDA 신호가 설정되어 있습니다.TwiScl: 현재 선택된 라인에 TWI SCL 신호가 설정되어 있습니다.LightControl: 현재 선택된 라인에 Light Control 신호가 설정되어 있습니다.
- 다음을 확인하세요.
LineMode파라미터가 다음으로 설정된 경우에만 Light Control 기능과 함께 사용할 수 있음을 명시했습니다.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를 사용하여 파라미터를 손쉽게 설정할 수도 있습니다.