Line Format#
使用此功能#
決定 Line Format#
若要決定 I/O 線路的電氣格式:
- 將
LineSelector參數至所需的 I/O 線路,例如:Line1. - 取得
LineFormat參數的值。
此參數為唯讀。
可能的值#
可能的值包括:
NoConnect:該線路未連接。OptoCoupled:該線路為 光耦合 I/O 線路.OpenDrain,TTL,LVTTL或RS422:該線路為 通用 I/O (GPIO) 線路。
範例程式碼#
/* 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 the desired I/O line */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line1");
CHECK(errRes);
/* Get the electrical format of the line */
len = sizeof(e_str);
errRes = PylonDeviceFeatureToString(hdev, "LineFormat", e_str, &len);
CHECK(errRes);
您也可以使用 pylon Viewer 來輕鬆設定參數。