Line Format#
该功能的使用#
确定 Line Format#
要确定 I/O 线路的电气形式:
- 设置
LineSelector
parameter to the desired I/O line, e.g.,Line1
. - Get the value of the
LineFormat
parameter.
此为只读参数。
可能的值#
可能的值包括:
NoConnect
: The line is not connected.OptoCoupled
: The line is an opto-coupled I/O line.OpenDrain
,TTL
,LVTTL
, orRS422
: The line is a general purpose I/O (GPIO) line.
示例代码#
/* 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 轻松设置参数。