Support Support Home » Knowledge Base » Setting a User ID to a Camera

Setting a User ID to a Camera

This feature allows the user to:

  • set any name (User ID) to camera, that is kept even after the camera is powered off
  • retrieve User ID from camera
  • open the camera by this name from xiAPI

Feature parameters

xiApi parameter

Feature related parameters
XI_PRM_DEVICE_USER_ID

GenICam reference (SFNC)

DeviceUserID

Setting the User ID

Using xiApi

Setting and getting the User ID:

// set name "left" to the camera
#define DEF_NAME "left" 
xiSetParamString(h,XI_PRM_DEVICE_USER_ID,DEF_NAME,sizeof(DEF_NAME));
// check if the name is the same
char name[100]="";
xiGetParamString(h,XI_PRM_DEVICE_USER_ID,name,sizeof(name));
if (0==strcmp(name,DEF_NAME))
{
    printf("Success of setting/getting User ID\n");
}

Opening the camera by User ID:

// open the camera by ID
char name[100]="left";
if (XI_OK == xiOpenDeviceBy(XI_OPEN_BY_USER_ID, name, &xiHandle))
{
   // now the camera is opened and ready to work
}

Using xiCOP

  • Connect camera
  • Open xiCOP
  • The User ID is displayed on the General tab under device user id (if no name is set only dash (-) is visible)


  • Double click on this field and a new window labeled Set Device User ID will open



  • Enter an arbitrary name to the edit box (e.g. left camera)
  • Press OK