Common Vision Blox 15.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Friends Modules Pages
Device Discovery - USB3 Vision

Discovering USB3 Vision (U3V) devices can be done using the Cvb::DeviceFactory::Discover.

In the case that multiple devices using different Transport Layers are connected (e.g. USBTL and GEVTL), no filtering flags can be applied during the discovery process to select a specific transport layer. Instead, after discovery, the Cvb::DiscoveryProperties in the Cvb::DiscoveryInformation should be accessed to determine the transport layer used and filter appropriately.

#include <cvb/device_factory.hpp>
auto discoveredDevices = Cvb::DeviceFactory::Discover(Cvb::DiscoverFlags::IgnoreVins); // (1)
auto chosenDiscoveryInformation = std::find_if(discoveredDevices.begin(), discoveredDevices.end(),
[](auto discoveryInformation) {
return discoveryInformation[Cvb::DiscoveryProperties::DeviceTransportLayerType] == "USB3"; // (2)
});
auto device = Cvb::DeviceFactory::Open<Cvb::GenICamDevice>(chosenDiscoveryInformation->AccessToken(), Cvb::AcquisitionStack::PreferGenTL); // (3)
// Configure device
// Start acquisition and streaming
static std::vector< DiscoveryInformation > Discover()
static std::shared_ptr< T > Open(const String &provider, AcquisitionStack acquisitionStack=AcquisitionStack::PreferVin)

using (var discoveredDevices = DeviceFactory.Discover(DiscoverFlags.IgnoreVins)) // (1)
{
var chosenDiscoveryInformation = discoveredDevices.First(discoveryInformation => {
return discoveryInformation[DiscoveryProperties.DeviceTransportLayerType] == "USB3"; // (2)
});
using (var device = (GenICamDevice)DeviceFactory.Open(chosenDiscoveryInformation, AcquisitionStack.PreferGenTL)) // (3)
{
// Configure device
// Start acquisition and streaming
}
}
static Device Open(DiscoveryInformation info, AcquisitionStack acquisitionStack=AcquisitionStack.PreferVin)
static DiscoveryInformationList Discover()

import cvb
discoveredDevices = cvb.DeviceFactory.discover_from_root(cvb.DiscoverFlags.IgnoreVins) # (1)
chosenDiscoveryInformation = next(filter(lambda discoveryInformation: discoveryInformation.read_property(cvb.DiscoveryProperties.DeviceTransportLayerType) == "USB3", discoveredDevices)) # (2)
with (cvb.GenICamDevice)cvb.DeviceFactory.open(chosenDiscoveryInformation.access_token, cvb.AcquisitionStack.PreferGenTL) as device: # (3)
# Configure device
# Start acquisition and streaming
Union[cvb.GenICamDevice, cvb.VinDevice, cvb.EmuDevice, cvb.VideoDevice, cvb.NonStreamingDevice] open(str provider, int acquisition_stack=cvb.AcquisitionStack.PreferVin)
List[cvb.DiscoveryInformation] discover_from_root(int flags=cvb.DiscoverFlags.FindAll, int time_span=300)

Note: Error handling has been omitted from the above example.

  1. Discover all GenTL devices. By default all devices are discovered so by using the Cvb::DiscoverFlags::IgnoreVins flag, the legacy VIN drivers are excluded.
  2. Filter the found discovery information to use the first that uses the USBTL driver.

    Common options are:

    • Mixed - Several supported technologies
    • Custom - Custom technologies
    • GEV - GigE Vision technology
    • CL - Camera Link technology
    • IIDC - IIDC 1394 technology
    • UVC - USB video class devices
    • CXP - CoaXPress
    • CLHS - Camera Link HS
    • USB3 - USB3 Vision Standard
    • Ethernet - Ethernet devices
    • PCI - PCI/PCIe devices
  3. Open the device as a Cvb::GenICamDevice using Cvb::AcquisitionStack::PreferGenTL. When using USBTL, these flags are mandatory to ensure that all GenICam features are enabled.