User-Defined Data#
機能を使用する#
仕組み#
You have three options to store user-defined data in the camera:
User-Defined Valuesの設定#
カメラには、最大5つのユーザー定義値を保存できます。これらの値は、自分の用途に必要な値(パノラマ画像の光学パラメーター値など)にすることができます。これらの値は32ビット符号付き整数値で、必要に応じて設定および取得できます。これらは保管場所として機能し、カメラの動作には影響しません。
The values are named Value1 to Value5.
ユーザー定義の値を設定するには、次の手順に従います。
- Set the
UserDefinedValueSelectorparameter to the desired user-defined value, e.g.Value1. UserDefinedValueパラメーターに必要な値を入力します。
デバイスユーザーIDの設定#
With the DeviceUserID parameter, you can assign a user-defined name to a camera.
To assign a user-defined name to a camera:
- Enter a name for the
DeviceUserIDin the Device Control category. TheDeviceUserIDcan 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:
- In the pylon Viewer, open the camera you want to upload the user data file to.
- pylon Viewerの[カメラ]メニューで、[ファイルアクセス]をクリックします。
- In the Camera File drop-down box, select User Data.
- Click Upload and navigate to the file that you want to upload. The file must have the file ending *.dll.
- [開く]をクリックします。
- 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:
- In the pylon Viewer, open the camera you want to download the user data file from.
- pylon Viewerの[カメラ]メニューで、[ファイルアクセス]をクリックします。
- In the Camera File drop-down box, select User Data.
- Click Download, navigate to the directory where you want to save the file, and enter the desired file name with the file ending *.dll.
- Click Save.
- Close the Camera File Access dialog.
The file is downloaded to the defined directory.
Related Features#
サンプルコード#
// 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);
pylon Viewerを使用して、パラメーターを簡単に設定することもできます。