Line Termination#
此相機的 GPIO 線路設計用於傳輸RS-422 差分訊號。在傳輸線末端接上一個 120 Ω 電阻,可避免訊號反射並確保訊號完整性。
資訊
有關相機 I/O 電路之詳細資訊,請參閱「 racer 2 L 與racer 2 XL 相機的 I/O 控制」一節。
使用功能#
啟用Line Termination#
- 將相機中的
LineSelector將參數設定至所需的 I/O 線。 - 將相機中的
LineTermination參數設為true以啟用終端電阻。預設情況下,此參數設定為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 來輕鬆設定參數。