Discover and Open

<< Click to Display Table of Contents >>

Navigation:  Migration Guide for the Acquisition Stacks > CVBpy >

Discover and Open

What has changed?

The function to open a device accepts an access token provided by the device discovery as well as the preferred acquisition stack. It is possible to still use the 2nd generation acquisition stack (Vin) or to move to the 3rd generation acquisition stack (GenTL), depending on whether or not the new features like multi stream, multi part or composite streams should be used.
The following acquisition stack settings can be selected:

Vin: Use Vin acquisition stack or fail.

PreferVin: Prefer to load the Vin acquisition stack. If the Vin stack cannot be loaded try opening the non-streamable device interface before failing.

GenTL: Use GenTL acquisition stack or fail.

PreferGenTL: Prefer the GenTL acquisition stack. If the GenTL stack cannot be loaded first try opening the Vin stack then try opening the non-streamable device interface before failing.

 

Important Note

The discover method returns a list of device properties on which the functions for discovery properties can be used for retrieving device information such as MAC address or device model name. The list also includes a unique access token that is used for instantiating the corresponding device. The ignore vins flag may be passed as discovery flag to exclude CVB *.vin drivers other than the GenICam.vin.

 

Code Examples

2nd generation stack

1

2

3

4

5

devices = DeviceFactory.discover_from_root(DiscoverFlags.IgnoreVins)

# or any other flag combination e.g.

devices = DeviceFactory.discover_from_root(DiscoverFlags.IgnoreVins |

   DiscoverFlags.IgnoreGevSD)

with DeviceFactory.open(devices[0].access_token, AcquisitionStack.Vin) as device:

(1)(3) Discover all devices ignoring all *.vin drivers accept CVB's GenICam.vin.

(5) The Vin flag is responsible for opening the 2nd generation stack. To open non-streamable devices as well, use PreferVin instead.

 

3rd generation stack

1

2

3

4

5

devices = DeviceFactory.discover_from_root(DiscoverFlags.IgnoreVins)

# or any other flag combination e.g.

devices = DeviceFactory.discover_from_root(cvb.DiscoverFlags.IgnoreVins |

   DiscoverFlags.IgnoreGevSD)

with DeviceFactory.open(devices[0].access_token, AcquisitionStack.GenTL) as device:

(5) The GenTL flag is responsible for opening the new stack. To open non-streamable devices as well, use PreferGenTL instead.