Back to Adaptive Vision Library website

You are here: Start » Function Reference » GigE Vision » GigEVision_OpenDevice

GigEVision_OpenDevice


Header: Genicam.h
Namespace: avl
Module: Genicam

Opens a handle to a GigE Vision device.

Syntax

C++
C#
 
GigEHandle avl::GigEVision_OpenDevice
(
	const atl::String& inDeviceAddress
)

Parameters

Name Type Default Description
inDeviceAddress const String& Textual address that identifies a device in the network.

Description

When specified device is already opened upon function call, a new handle to the same device connection is returned.

When the device is opened for the first time, the library will attempt to establish a network connection, set up its state, load and interpret GenICam description.

For every call to GigEVision_OpenDevice a GigEVision_CloseHandle function must be called on returned handle.

When the device is opened, a new thread is started in the process. It controls and sustains the connection with the device and will be responsible for receiving stream packets.

Device address can be specified in one of following forms:

  • IP Address - standard IPv4 address, for example "192.168.0.100". In this option the library will immediately attempt to establish a connection with specified address.
  • MAC Address - 6 hexadecimals numbers representing the device network interface hardware address, for example "11:22:33:aa:bb:cc". In this option the library will first attempt to find the specified device in the network to retrieve its current IP address. This option can be used when the device is configured for automatic IP setup.
  • Serial number - identified by "SN:" prefix, for example "SN:123456789". This option is similar to a MAC Address but uses a serial number to find the device in the network. Please note that not all GigE Vision devices support serial number identification.

Return Value

Handle to an open device. This handle can be used with other GigE Vision functions to control device state and image streaming, as well as with GenApi functions to access device GenApi parameters set.

Exceptions

This function will throw an exception in the following situations:

  • Device address string has an invalid format.
  • Device with specified address cannot be found in the network.
  • Device connection operation failed.
  • Device initial setup failed.
  • GenICam device description xml file could not be loaded.
  • Other GenICam or network related error occurred.