Line Termination#
相機的 GPIO 線路旨在傳輸 RS-422 差動信號。在傳輸線結尾處啟用 120 Ω 電阻可避免信號反射並確保信號完整性。
資訊
如需有關相機 I/O 電路的詳細資訊,請參閱 I/O Control of racer 2 L and racer 2 XL Cameras 主題。
使用此功能#
啟用 Line Termination#
- 將
LineSelector參數設定至所需的 I/O 線路。 - 將
LineTermination參數設為true以啟用終端電阻。依預設,此 Property 設定為false,即停用 Line Termination。
範例程式碼#
INodeMap& nodemap = camera.GetNodeMap();
// Select Line 1
CEnumParameter(nodemap, "LineSelector").SetValue("Line1");
// Enable the line termination for the I/O line selected
CBooleanParameter(nodemap, "BslLineTermination").SetValue(true);
// Disable the line termination for the I/O line selected
CBooleanParameter(nodemap, "BslLineTermination").SetValue(false);
// Select Line 1
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line1);
// Enable the line termination for the I/O line selected
camera.Parameters[PLCamera.BslLineTermination].SetValue(true);
// Disable the line termination for the I/O line selected
camera.Parameters[PLCamera.BslLineTermination].SetValue(false);
/* 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 */
/* Select Line 1 */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line1");
CHECK(errRes);
/* Enable the line termination for the I/O line selected */
errRes = PylonDeviceSetBooleanFeature(hdev, "BslLineTermination", 1);
CHECK(errRes);
/* Disable the line termination for the I/O line selected */
errRes = PylonDeviceSetBooleanFeature(hdev, "BslLineTermination", 0);
CHECK(errRes);
您也可以使用 pylon Viewer 來輕鬆設定參數。