Industrial Cameras FAQ/ Please show how to open camer...
Please show how to open camera specifying camera model name and serial number. (No.1507)
By using Cam_OpenFromInfo() function instead of Cam_Open() function, user application can open a camera whose model name and serial number are specified value. (It is necessary to call Sys_GetNumOfCameras() before opening cameras. )
The followings are example code for opening a camera whose model name is "CamModel" and whose serial number is "SerialNo". If user application has code for "Removed" event of the camera, append handle of "Removed" event object as an argument after camera handle argument.
CAM_HANDLE hCam = NULL;
CAM_API_STATUS uiSts = Cam_OpenFromInfo("CamModel", "SerialNo", NULL, &hCam);
In case of using .NET language in source code, use CreateDeviceObjectFromInfo() method of CameraSystem class instance instead of CreateDeviceObject() method.
CameraSystem camSystem = new CameraSystem();
...................................................................
CameraDevice cam = null;
CamApiStatus sts = camSystem.CreateDeviceObjectFromInfo("CamModel", "SerialNo", null, ref cam);
The followings are example code for opening a camera whose model name is "CamModel" and whose serial number is "SerialNo". If user application has code for "Removed" event of the camera, append handle of "Removed" event object as an argument after camera handle argument.
CAM_HANDLE hCam = NULL;
CAM_API_STATUS uiSts = Cam_OpenFromInfo("CamModel", "SerialNo", NULL, &hCam);
In case of using .NET language in source code, use CreateDeviceObjectFromInfo() method of CameraSystem class instance instead of CreateDeviceObject() method.
CameraSystem camSystem = new CameraSystem();
...................................................................
CameraDevice cam = null;
CamApiStatus sts = camSystem.CreateDeviceObjectFromInfo("CamModel", "SerialNo", null, ref cam);