Users Manual – svs4021, svs2020,svs2050, svs2051, svs1020, svs1050, svs285, svs340, svs625
p. 67
Last Update 20.07.2009
17.10
Best programming practices
In the following a step-by-step procedure will be given how to communicate to
a SVCam GigE camera by a software application. A working application that
implements all hints can be found in the sources of the SVGigE_Example.VC8
program which comes as a part of the SVGigE SDK.
The project file of the SVGige_Example.VC8 program was generated by the
Visual Studio 2005 development environment which can be used to compile the
project in order to get to a running application:
NOTE
: An application which was compiled with Visual Studio 2005 needs a
runtime environment in order to run on a WinXP computer. Dependent on the
software components that have already been installed on the target computer it
might be necessary to install the Microsoft VC runtime package (
vcredist_x86.exe
)
in addition to the runtime DLLs that are shipped with Visual Studio 2005. A
discussion of the involved problems can be found here:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=164132&SiteId=1
17.10.1
Connecting to the camera container
Whenever an application is going to operate SVCam GigE cameras it has to
become a client of the camera container first which is located inside the
SVGigE.dll module.
CameraContainerClient_handle CameraClient;
CameraClient = CameraContainer_create(SVGigETL_TypeWinsock);
When establishing a connection to the camera container the application will
demand for the type of transport layer to be used for the network connection to
the camera, either a FilterDriver (recommended) or a Winsock (for first testing
purposes) based transport layer. The FilterDriver based transport layer
guaranties the highest possible performance
Once the application is done with cameras the connection to the container will
be closed what will allow the SVGigE DLL to release all resources which were
occupied for that client.
CameraContainer_delete(CameraClient);
Between becoming a camera client and shutting down the connection to the
camera container an application will be allowed to operate all SVCam GigE
cameras that are available in the attached network segment. The
CameraClient
handle is used for identifying the application against the camera container
module inside the SVGigE.dll.
17.10.2
Connecting to a camera
Based on a valid connection to the camera container an application can query
for available cameras and can open connections to one or multiple cameras.
Camera_handle Camera;
if( SVGigE_SUCCESS != CameraContainer_discovery(CameraClient) )
return;
int NumCameras = CameraContainer_getNumberOfCameras(CameraClient);
if( 0 == NumCameras )
return;
Camera = CameraContainer_getCamera(CameraClient, Index);// Index < NumCameras
The
Camera
handle relates a specific camera to an application. The application
will have to open a connection to the camera before being able to issue
commands to the camera and to initiate an image stream.
Camera_openConnection(Camera);