Users Manual – svs4021, svs2020,svs2050, svs2051, svs1020, svs1050, svs285, svs340, svs625
p. 68
Last Update 20.07.2009
Once an application is done with a camera it needs to close the connection and
thus allowing the camera container to release all resources that have been kept
occupied in meantime for the active application-camera relation.
Camera_closeConnection(Camera);
After a camera connection has been closed it can be re-opened again at any
time as long as the program is a valid client to the camera container.
Opening a camera requires the existence of a valid IP address in the camera.
The easiest way for making sure connectivity is to force valid network settings:
unsigned int IPAddress;
unsigned int SubnetMask;
SVGigERet = Camera_forceValidNetworkSettings(Camera, &IPAddress, &SubnetMask);
That function will do nothing in case the camera has already got a valid IP
address. If this is not the case the function will first force a free IP address in
current subnet into the camera. Subsequently that IP address may be assigned
as a fixed IP address to the camera if this is wanted:
Camera_setIPAddress(hCamera,IPAddress,NetMask);
When the available cameras in the attached network segment have changed it
will be necessary to run the
discovery
command again in order to synchronize the
information in the camera container with the actually available set of cameras
in the network. Afterwards one has to take care since a previous index of a
specific camera might have changed in meantime.
Alternatively to selecting a camera by index a search string can be provided to
a
findCamera
function:
Camera = CameraContainer_findCamera(CameraClient, CameraItem);
In this case a string
CameraItem
will be provide to a camera container function
which tries to find a match between all discovered cameras where the given
string is contained in at least one of the MAC address, IP address, serial number
and user defined name items.
17.10.3
Identifying a camera
Every GigE camera maintains a set of information strings which allow for
identifying a camera in the network.
CString CameraName
= Camera_getMacAddress(Camera);
CString CameraName
= Camera_getIPAddress(Camera);
CString ModelName
= Camera_getModelName(Camera);
CString Manufacturer = Camera_getManufacturerName(Camera);
CString SerialNumber = Camera_getSerialNumber(Camera);
CString DeviceVersion = Camera_getDeviceVersion(Camera);
CString CameraName
= Camera_getUserDefinedName(Camera);
An application could query those strings and could display one or a combination
of those information strings to a user for allowing a selection of a specific
camera. However, applications that know beforehand which camera to use for a
given purpose can use the
findCamera
function that was described before.
17.10.4
Opening a streaming channel
The main goal for operating cameras is to get an image stream back to the
application. Once a connection to the desired camera has been opened a stream
can be initiated and a callback function for receiving that stream can be
registered.
if( SVGigE_SUCCESS !=
StreamingChannel_create (
&StreamingChannel, // a streaming channel handle will be returned
CameraClient,
// a valid camera container client handle
Camera,
// a valid camera handle
BufferCount,
// buffer count
&ImageCallback,
// callback function pointer where images are delivered to
this) )
// the this pointer serves as a context that will be returned
return;
// each time the callback function is called
The application will receive a handle for the streaming channel on success. That
handle will be used later for shutting down the streaming channel once the
application has finished working with the channel.