Skip to content
STAGING SERVER
DEVELOPMENT SERVER

User-Defined Data#

The User-Defined Data camera feature allows you to store user-defined data in the camera.

Using the Feature#

How It Works#

You have three options to store user-defined data in the camera:

Configuring User-Defined Values#

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.

To configure a user-defined value:

  1. Set the UserDefinedValueSelector parameter to the desired user-defined value, e.g. Value1.
  2. Enter the desired value for the UserDefinedValue parameter.

Setting the Device User ID#

With the DeviceUserID parameter, you can assign a user-defined name to a camera.

To assign a user-defined name to a camera:

  1. Enter a name for the DeviceUserID in the Device Control category. The DeviceUserID can consist of any combination of numbers, letters, and spaces.

For GigE cameras, you can set the DeviceUserID also in the pylon IP Configurator.

On USB 3.0 cameras, you must reset the camera using the DeviceReset command for the changes to take effect.

See also information about other device information parameters.

Storing User Data as a Binary File#

You can store binary data on your camera (up to approximately 200 kB on ace 2 cameras) on your camera. This data is saved as a separate file called User Data and is transferred using the File Access function in the pylon Viewer.

Examples of typical user data:

  • Calibration data
  • Shading correction data

Uploading User Data to the Camera#

To upload a user data file using the pylon Viewer:

  1. In the pylon Viewer, open the camera you want to upload the user data file to.
  2. In the Camera menu of the pylon Viewer, click File Access.
  3. In the Camera File drop-down box, select User Data.
  4. Click Upload and navigate to the file that you want to upload. The file must have the file ending *.dll.
  5. Click Open.
  6. Close the Camera File Access dialog.

The file is stored on your camera.

Downloading User Data from the Camera#

To download a user data file using the pylon Viewer:

  1. In the pylon Viewer, open the camera you want to download the user data file from.
  2. In the Camera menu of the pylon Viewer, click File Access.
  3. In the Camera File drop-down box, select User Data.
  4. Click Download, navigate to the directory where you want to save the file, and enter the desired file name with the file ending *.dll.
  5. Click Save.
  6. Close the Camera File Access dialog.

The file is downloaded to the defined directory.

Sample Code#

// Select user-defined value 1
camera.UserDefinedValueSelector.SetValue(UserDefinedValueSelector_Value1);
// Set the value for the UserDefinedValue parameter
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();
// Select user-defined value 1
CEnumParameter(nodemap, "UserDefinedValueSelector").SetValue("Value1");
// Set the value for the UserDefinedValue parameter
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();
// Select user-defined value 1
camera.Parameters[PLCamera.UserDefinedValueSelector].SetValue(PLCamera.UserDefinedValueSelector.Value1);
// Set the value for the UserDefinedValue parameter
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();
/* 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;
/* Select user-defined value 1 */
errRes = PylonDeviceFeatureFromString(hdev, "UserDefinedValueSelector", "Value1");
CHECK(errRes);
/* Set the value for the UserDefinedValue parameter */
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);
# Select user-defined value 1
camera.UserDefinedValueSelector.Value = "Value1"
# Set the value for the UserDefinedValue parameter
camera.UserDefinedValue.Value = 1000
# Get the value of user-defined value 1
camera.UserDefinedValueSelector.Value = "Value1"
UserValue1 = camera.UserDefinedValue.Value

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