User Output Value#
This can be useful to control external events or devices, e.g., a light source.
To configure the status of all output lines in a single operation, use the User Output Value All feature.
Using the Feature#
Prerequisites#
The line source of the desired output line must be set to a User Output signal.
Setting the Output Line Status#
How to set the output line status depends on how many User Output line sources are available on your camera model.
One User Output line source is available ("User Output"):
- If you want to set the line status to high (1), set the
UserOutputValue
parameter totrue
. - If you want to set the line status to low (0), set the
UserOutputValue
parameter tofalse
.
Multiple User Output line sources are available (e.g., "User Output 1", "User Output 2"):
- Set the
UserOutputSelector
parameter to the corresponding line source.
Example: Assume that you have set the line source of Line 2 toUserOutput1
. To configure the line status of Line 2, you must set theUserOutputSelector
parameter toUserOutput1
. - If you want to set the line status to high (1), set the
UserOutputValue
parameter totrue
. - If you want to set the line status to low (0), set the
UserOutputValue
parameter tofalse
.
Sample Code#
// Select Line 2 (output line)
camera.LineSelector.SetValue(LineSelector_Line2);
// Set the source signal to User Output 1
camera.LineSource.SetValue(LineSource_UserOutput1);
// Select the User Output 1 signal
camera.UserOutputSelector.SetValue(UserOutputSelector_UserOutput1);
// Set the User Output Value for the User Output 1 signal to true.
// Because User Output 1 is set as the source signal for Line 2,
// the status of Line 2 is set to high.
camera.UserOutputValue.SetValue(true);
INodeMap& nodemap = camera.GetNodeMap();
// Select Line 2 (output line)
CEnumerationPtr(nodemap.GetNode("LineSelector"))->FromString("Line2");
// Set the source signal to User Output 1
CEnumerationPtr(nodemap.GetNode("LineSource"))->FromString("UserOutput1");
// Select the User Output 1 signal
CEnumerationPtr(nodemap.GetNode("UserOutputSelector"))->FromString("UserOutput1");
// Set the User Output Value for the User Output 1 signal to true.
// Because User Output 1 is set as the source signal for Line 2,
// the status of Line 2 is set to high.
CBooleanPtr(nodemap.GetNode("UserOutputValue"))->SetValue(true);
INodeMap& nodemap = camera.GetNodeMap();
// Select Line 2 (output line)
CEnumParameter(nodemap, "LineSelector").SetValue("Line2");
// Set the source signal to User Output 1
CEnumParameter(nodemap, "LineSource").SetValue("UserOutput1");
// Select the User Output 1 signal
CEnumParameter(nodemap, "UserOutputSelector").SetValue("UserOutput1");
// Set the User Output Value for the User Output 1 signal to true.
// Because User Output 1 is set as the source signal for Line 2,
// the status of Line 2 is set to high.
CBooleanParameter(nodemap, "UserOutputValue").SetValue(true);
// Select Line 2 (output line)
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line2);
// Set the source signal to User Output 1
camera.Parameters[PLCamera.LineSource].SetValue(PLCamera.LineSource.UserOutput1);
// Select the User Output 1 signal
camera.Parameters[PLCamera.UserOutputSelector].SetValue(PLCamera.UserOutputSelector.UserOutput1);
// Set the User Output Value for the User Output 1 signal to true.
// Because User Output 1 is set as the source signal for Line 2,
// the status of Line 2 is set to high.
camera.Parameters[PLCamera.UserOutputValue].SetValue(true);
// Select Line 2 (output line)
Pylon.DeviceFeatureFromString(hdev, "LineSelector", "Line2");
// Set the source signal to User Output 1
Pylon.DeviceFeatureFromString(hdev, "LineSource", "UserOutput1");
// Select the User Output 1 signal
Pylon.DeviceFeatureFromString(hdev, "UserOutputSelector", "UserOutput1");
// Set the User Output Value for the User Output 1 signal to true.
// Because User Output 1 is set as the source signal for Line 2,
// the status of Line 2 is set to high.
Pylon.DeviceSetBooleanFeature(hdev, "UserOutputValue", 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 */
/* Select Line 2 (output line) */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line2");
CHECK(errRes);
/* Set the source signal to User Output 1 */
errRes = PylonDeviceFeatureFromString(hdev, "LineSource", "UserOutput1");
CHECK(errRes);
/* Select the User Output 1 signal */
errRes = PylonDeviceFeatureFromString(hdev, "UserOutputSelector", "UserOutput1");
CHECK(errRes);
/* Set the User Output Value for the User Output 1 signal to true. */
/* Because User Output 1 is set as the source signal for Line 2, */
/* the status of Line 2 is set to high. */
errRes = PylonDeviceSetBooleanFeature(hdev, "UserOutputValue", 1);
CHECK(errRes);
You can also use the pylon Viewer to easily set the parameters.