Can't open devices for port > 0

Greetings,

I tried to upgrade from version 13.04.002 to 13.04.005 yesterday, but when I try to open any device not on port 0 (we have seven cameras connected to the system) by calling cvb.DeviceFactory.open_port(vin_driver_path, camera_index) or cvb.DeviceFactory.open(vin_driver_path, port=camera_index)
Python instantly terminates completely without even throwing an error.
This was working before with the old version and I can find any explanation what could cause this.

Regards,
Jens

Hi @j.wilhelm

try to open the camera in the GenICam Browser bevorehand.
I assume, that you have not added all cameras to the configured devices thus the driver has no camera to work with.
You can avoid this step in the future, if you work with the DeviceFactory and its discover method:

import cvb  

interface_flags = cvb.DiscoverFlags.UpToLevelInterface | cvb.DiscoverFlags.IgnoreGevSD 
all_interfaces = cvb.DeviceFactory.discover_from_root(interface_flags)  
broadcast_flags = cvb.DiscoverFlags.IgnoreVins | cvb.DiscoverFlags.IncludeInaccessible | cvb.DiscoverFlags.IgnoreGevSD 

all_devices = [] 

for interface in all_interfaces: 
    cvb.DiscoveryInformation.set_genapi_feature(interface, "TLInterface", "DisableSubnetMatch", "1") 
    cvb.DiscoveryInformation.set_genapi_feature(interface, "TLInterface", "AllowBroadcastDiscoveryResponse", "1") 
    found_devices = cvb.DeviceFactory.discover_from_level(interface.access_token, broadcast_flags) 
    for dev in found_devices: 
        all_devices.append(dev)  

for dev in all_devices: 
    # Check devices access status etc.: 
    # dev.read_property(cvb.DiscoveryProperties.DeviceAccessStatus)  

with cvb.DeviceFactory.open(all_devices[0].access_token) as device: # open first camera found (check accessibility before!) 

    # work with camera...

You can also try the codesnippet bevor configuring the driver, as long as the IPs of the cameras are in the same subnet, this should work.

Cheers
Chris

All devices are listed correctly in the driver. As I wrote I have been working with Version 13.04.002 and there wasn’t a problem so far with those seven cameras and calling those two methods this way.

Could you please attach a screenshot of what you see, when you open the GenICam Browser?

Cheers
Chris

Hi @j.wilhelm

the snippet I posted works for me.

I have a modified version here, so give it a try please:

import cvb  
import cvb.foundation
import os

interface_flags = cvb.DiscoverFlags.UpToLevelInterface | cvb.DiscoverFlags.IgnoreGevFD
all_interfaces = cvb.DeviceFactory.discover_from_root(interface_flags)  
broadcast_flags = cvb.DiscoverFlags.IgnoreVins | cvb.DiscoverFlags.IncludeInaccessible | cvb.DiscoverFlags.IgnoreGevFD

all_devices = []

for interface in all_interfaces:
    cvb.DiscoveryInformation.set_genapi_feature(interface, "TLInterface", "DisableSubnetMatch", "1")
    cvb.DiscoveryInformation.set_genapi_feature(interface, "TLInterface", "AllowBroadcastDiscoveryResponse", "1")

    found_devices = cvb.DeviceFactory.discover_from_level(interface.access_token, broadcast_flags)

    for dev in found_devices:
        all_devices.append(dev)  

server1 = cvb.DeviceFactory.open(all_devices[0].access_token)
server2 = cvb.DeviceFactory.open(all_devices[1].access_token)

map1 = server1.node_maps["Device"]
id1 = map1["DeviceUserID"].value

map2 = server2.node_maps["Device"]
id2 = map2["DeviceUserID"].value
print(id1)
print(id2)

This loads the first 2 devices and prints out ist DeviceUserID (has to be set in the GenICam Browser first)

Edit: Loading devices on 14.4.0 worked with the “old” way:

server2 = cvb.DeviceFactory.open(os.path.join(cvb.install_path(), “drivers”, “GenICam.vin”), port=1)

As you describe with 14.4.5 this does not work anymore thus using the open Method with the access_token as parameter is the only way for now.

server1 = cvb.DeviceFactory.open(all_devices[0].access_token)

Bug is reported and will be fixed.

Cheers
Chris