跳至內容
測試伺服器
開發伺服器

Line Termination#

使用 Line Termination 相機功能,您可以啟用相機差動傳輸線結尾處的終端電阻。

相機的 GPIO 線路旨在傳輸 RS-422 差動信號。在傳輸線結尾處啟用 120 Ω 電阻可避免信號反射並確保信號完整性。

資訊

如需有關相機 I/O 電路的詳細資訊,請參閱 I/O Control of racer 2 L and racer 2 XL Cameras 主題。

使用此功能#

啟用 Line Termination#

  1. 將 LineSelector 參數設定至所需的 I/O 線路。
  2. 將 LineTermination 參數設為 true 以啟用終端電阻。依預設,此 Property 設定為 false,即停用 Line Termination。

範例程式碼#

// Select Line 1
camera.LineSelector.SetValue(LineSelector_Line1);
// Enable the line termination for the I/O line selected
camera.BslLineTermination.SetValue(true);
// Disable the line termination for the I/O line selected
camera.BslLineTermination.SetValue(false);
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 來輕鬆設定參數。