User-Defined Values#

The User-Defined Values camera feature allows you to store user-defined values in the camera.

Using the Feature#

How It Works#

The camera can store up to five user-defined values. These can be values that you may require for your application (e.g., optical parameter values for panoramic images). These values are 32-bit signed integer values that you can set and get as desired. They serve as storage locations and have no impact on the operation of the camera.

The values are named Value1 to Value5.

Configuring User-Defined Values#

To configure a user-defined value:

  1. Set the UserDefinedValueSelector parameter to the desired user-defined value (Value1 to Value5).
  2. Enter the desired value for the UserDefinedValue parameter.

Sample Code#

// Selct user-defined value 1
camera.UserDefinedValueSelector.SetValue(UserDefinedValueSelector_Value1);
camera.UserDefinedValue.SetValue(1000);
// Get the value of user-defined value 1
camera.UserDefinedValueSelector.SetValue(UserDefinedValueSelector_Value1);
int64_t UserValue1 = camera.UserDefinedValue.GetValue();
INodeMap& nodemap = camera.GetNodeMap();
// Selct user-defined value 1
CEnumerationPtr(nodemap.GetNode("UserDefinedValueSelector"))->FromString("Value1");
CIntegerPtr(nodemap.GetNode("UserDefinedValue"))->SetValue(1000);
// Get the value of user-defined value 1
CEnumerationPtr(nodemap.GetNode("UserDefinedValueSelector"))->FromString("Value1");
int64_t UserValue1 = CIntegerPtr(nodemap.GetNode("UserDefinedValue"))->GetValue();
INodeMap& nodemap = camera.GetNodeMap();
// Selct user-defined value 1
CEnumParameter(nodemap, "UserDefinedValueSelector").SetValue("Value1");
CIntegerParameter(nodemap, "UserDefinedValue").SetValue(1000);
// Get the value of user-defined value 1
CEnumParameter(nodemap, "UserDefinedValueSelector").SetValue("Value1");
int64_t UserValue1 = CIntegerParameter(nodemap, "UserDefinedValue").GetValue();
// Selct user-defined value 1
camera.Parameters[PLCamera.UserDefinedValueSelector].SetValue(PLCamera.UserDefinedValueSelector.Value1);
camera.Parameters[PLCamera.UserDefinedValue].SetValue(1000);
// Get the value of user-defined value 1
camera.Parameters[PLCamera.UserDefinedValueSelector].SetValue(PLCamera.UserDefinedValueSelector.Value1);
Int64 UserValue1 = camera.Parameters[PLCamera.UserDefinedValue].GetValue();
// Selct user-defined value 1
Pylon.DeviceFeatureFromString(hdev, "UserDefinedValueSelector", "Value1");
Pylon.DeviceSetIntegerFeature(hdev, "UserDefinedValue", 1000);
// Get the value of user-defined value 1
Pylon.DeviceFeatureFromString(hdev, "UserDefinedValueSelector", "Value1");
Int64 UserValue1 = Pylon.DeviceGetIntegerFeature(hdev, "UserDefinedValue");
/* 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 */
int64_t UserValue1 = 0;
/* Selct user-defined value 1 */
errRes = PylonDeviceFeatureFromString(hdev, "UserDefinedValueSelector", "Value1");
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "UserDefinedValue", 1000);
CHECK(errRes);
/* Get the value of user-defined value 1 */
errRes = PylonDeviceFeatureFromString(hdev, "UserDefinedValueSelector", "Value1");
CHECK(errRes);
errRes = PylonDeviceGetIntegerFeature(hdev, "UserDefinedValue", &UserValue1);
CHECK(errRes);

You can also use the pylon Viewer to easily set the parameters.