Line Logic#
I/O 线路的逻辑可以为正或负。
该功能的使用#
确定 Line Logic#
要确定 I/O 线路的逻辑:
- 设置
LineSelector
parameter to the desired I/O line. - Get the value of the
LineLogic
parameter.
此为只读参数。
Line Logic 概况#
Positive Line Logic#
If the line logic is positive, the relation between the electrical status of an I/O line and the LineStatus
parameter is as follows:
电气状态 | LineStatus 参数值 |
---|---|
电压电平高 | True |
电压电平低 | False |
Negative Line Logic#
If the line logic is negative, the relation between the electrical status of an I/O line and the LineStatus
parameter is as follows:
电气状态 | LineStatus 参数值 |
---|---|
电压电平高 | False |
电压电平低 | True |
示例代码#
/* 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 a line */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line1");
CHECK(errRes);
/* Get the logic of the line */
len = sizeof(e_str);
errRes = PylonDeviceFeatureToString(hdev, "LineLogic", e_str, &len);
CHECK(errRes);
您也可以使用 pylon Viewer 轻松设置参数。