Opening the Camera

To control the camera, it first has to be opened. Opening the camera establishes the logical connection (i.e. not the physical connection) between the camera and the CameraSDK.

To open an attached USB camera, use the following method:

camera = P1::CameraSdk::Camera::OpenUsbCamera();
camera = Camera.OpenUsbCamera();

The OpenUsbCamera method will open any camera connected through USB. If multiple cameras are connected, the method can be given an argument (i.e. the serial-number for USB) to specify which camera to open. If only one camera is connected, this argument is optional.

To open a camera through TCP/IP, use the following method:

camera = P1::CameraSdk::Camera::OpenIpCamera(CAMERA_IP_ADDRESS);
camera = Camera.OpenIpCamera(CAMERA_IP_ADDRESS);

This method will open the camera with the specified IP address, as this is specified as an argument to the method.

The IQP uses port 7381. As the CameraSDK is the client, there are usually no issues with this related to firewalls, etc.

To list all USB cameras currently visible to the CameraSDK, use the following method:

std::vector<P1::CameraSdk::CameraListElement> list = 
			P1::CameraSdk::Camera::GetAvailableCameras();
IEnumerable<CameraDescriptor> list = Camera.GetAvailableCameras();

The GetAvailableCameras method returns a list of all discovered cameras with an physical USB connection. In the list, each visible camera has a name, serial number and a connection type (TCP/IP or USB).

It is possible to force the CameraSDK to initialize beforehand, using the following method:

P1::CameraSdk::EnsureOpen();
Sdk.Get.EnsureOpen();