Line Logic#
The logic of an I/O line can either be positive or negative.
Using the Feature#
Determining the Line Logic#
To determine the logic of an I/O line:
- Set the
LineSelector
parameter to the desired I/O line. - Get the value of the
LineLogic
parameter.
This parameter is read-only.
Line Logic Overview#
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:
Electrical Status | LineStatus Parameter Value |
---|---|
Voltage level high | True |
Voltage level low | 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:
Electrical Status | LineStatus Parameter Value |
---|---|
Voltage level high | False |
Voltage level low | True |
Sample Code#
// Select a line
camera.LineSelector.SetValue(LineSelector_Line1);
// Get the logic of the line
LineLogicEnums e = camera.LineLogic.GetValue();
INodeMap& nodemap = camera.GetNodeMap();
// Select a line
CEnumParameter(nodemap, "LineSelector").SetValue("Line1");
// Get the logic of the line
String_t e = CEnumParameter(nodemap, "LineLogic").GetValue();
// Select a line
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line1);
// Get the logic of the line
string e = camera.Parameters[PLCamera.LineLogic].GetValue();
/* 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);
You can also use the pylon Viewer to easily set the parameters.