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

Line Termination#

Line Termination 攝影機功能可讓您在攝影機的差分傳輸線末端啟用終端電阻。

此相機的 GPIO 線路設計用於傳輸RS-422 差分訊號。在傳輸線末端接上一個 120 Ω 電阻,可避免訊號反射並確保訊號完整性。

資訊

有關相機 I/O 電路之詳細資訊,請參閱「 racer 2 L 與racer 2 XL 相機的 I/O 控制」一節。

使用功能#

啟用Line Termination#

  1. 將相機中的 LineSelector 將參數設定至所需的 I/O 線。
  2. 將相機中的 LineTermination 參數設為 true 以啟用終端電阻。預設情況下,此參數設定為 false,也就是說,已停用行結尾。

範例程式碼#

// 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);

您也可以 use the pylon Viewer 來輕鬆設定參數。