Multicast with CVB

<< Click to Display Table of Contents >>

Navigation:  CVB with GenICam > Configuration > Use Cases >

Multicast with CVB

 

Multicast with CVB

 

Common Vision Blox supports Multicast.  With Multicast, it is possible to send packets to all devices in the same network.

In IPv4, the address range from 224.0.0.0 to 239.255.255.255 is reserved for Multicast.

By Joining, the master will also join the Multicast session and be able to receive a stream. If NoJoin is set, the master (or slave/read only attendee) will not be part of the multicast session and only act as device controller without a stream.

The configuration can be done using the GenTL or the CVB GenICam driver.

For additional use of  the feature Turbo Drive, which is supported by all Genie Nano cameras, the configuration has to be done with the CVB GenICam driver, because the Turbo Drive feature is implemented in the driver.

 

Tested Software versions:

Operating system: Ubuntu 20.04 || Windows 10

Common Vision Blox: 13.04.002

 

1)Configuration using GenTL (SI GEV TL) in GenICam Browser

   

If your goal is to just setup and stream a camera to all network devices, this is the right configuration for you.

 

Master (Read/Write) configuration:

Open GenICam Browser

Configure and save your device settings

Right-click on the configured device

Select Open Mode -> Control

 

Multicast1

 

Select Master and No Switchover and confirm with Set

 01_MulticastOnly_Master

 

Slave (ReadOnly) configuration:

Open GenICam Browser

Configure and save your device settings

Right-click on the configured device

Select Open Mode -> ReadOnly

 

Multicast3

 

2) Configuration using CVB GenICam.vin driver

 A) Using the  GenICam.ini file

 

If your goal is to setup and stream a camera to all network devices, but the camera should be opened with a tool like the CVB Viewer by loading the GenICam.vin driver or by calling a Cvb::DeviceFactory::Open("path/to/GenICam.vin"), use this configuration.

 

 To configure the GenICam.ini file there are three viable options :

oconfiguring the GenICam.ini file in %CVBDATA%\Drivers directory on Windows or in etc/opt/cvb/drivers on Ubuntu with a text editor

oconfiguring the GenICam.ini file using the GenICam Browser Configured Devices (same as above, the saved configuration is always automatically written to the GenICam.ini file)

oconfiguring the GenICam.ini file using the GenICam Browser Configured Devices but this time using the Configured Device Options by right clicking on the configured device (see below)

Configuration and saving options  top right of the GenICam Browser: ConfigureSave

 

Master (Read/Write) configuration:

Set the AccessMode = 3 (Control)

Set MCMasterMode = 1

Slave (ReadOnly) configuration:

Set the AccessMode = 2 (ReadOnly)

Set MCMasterMode = 0

Multicast4
Multicast5

 

 B) Using Discovery properties in code (advanced)

If your goal is to set up and stream a camera to all network devices and the camera should be completely managed by code or you wish to use the Switchover feature in an unconditional streaming context (code only), prefer this configuration over 2)A) because 2)A) requires to change the GenICam.ini file, which makes no sense in a code only scenario.

When a programming only solution is desired, above properties can be set to the discovered device. Please note that there might be minor differences depending on the loaded driver (GevSD/GevFD) which can be chosen upon device discovery. To add multicast properties to the device before it is opened, call .SetParameter(...) on the device that should be opened. For a reference of possible parameters and spelling, please refer to the GenICam.ini file entries, which are mirrored in their behavior here. Also configuring like described under 1) or 2)A) is possible and then copying the parameters and values for use with SetParameter().

 

  // Discover all devices with the search criteria defined by the DiscoverFlags

  auto devices = Cvb::DeviceFactory::Discover(Cvb::DiscoverFlags::IgnoreVins | Cvb::DiscoverFlags::IgnoreGevSD);

  // Set access mode to the device, here we just assume device 0 to be the desired device

  devices[0].SetParameter(CVB_LIT("AccessMode"), CVB_LIT("3"));

  devices[0].SetParameter(CVB_LIT("MCNoJoin"), CVB_LIT("0"));

  devices[0].SetParameter(CVB_LIT("MCMasterMode"), CVB_LIT("1"));

  // Optionally also set the session

  devices[0].SetParameter(CVB_LIT("MCSession"), CVB_LIT("224.64.16.1"));

 

 

 

Multicast with CVB - Switchover and Unconditional Streaming

 

When using Multicast, a special feature combination using switchover and unconditional streaming makes it possible to keep the camera running on application crashes and re-set the master with configuration access for the device. This would normally not be possible, as an application crash of the master application would lead to a headless camera which is only controlled by the now unavailable host (if unconditional streaming is available but no switchover) or would stop the camera from streaming (if switchover is available but not unconditional streaming).

For availability of both switchover and unconditional streaming, please refer to your specific camera model and device firmware. If the camera supports both feature, the following will describe the setup using CVB:

 

All configurations can be copied from above setup (take your pick) with following additions:

 

To enable switchover, set Enable Switchover (in 1)) or set Open Mode to Control Enable Switchover in 2)A) or call .SetParameter(CVB_LIT("AccessMode"), CVB_LIT("5")); on the device that should be opened.

 

By enabling switchover, the device is in access mode "control". If a second application now tries to connect to the device, only the access modes read only and Request Switchover aka. Control Request Switchover, or .SetParameter(CVB_LIT("AccessMode"), CVB_LIT("6")); are sensible access modes. Trying to gain exclusive access on a switchover enabled device is also possible, but all other devices will be locked out from the device connection then.

Additionally, the switchover feature supports a Switchover Key which is a 16 bit value entered as four characters. The key is set when initially opening the device with the switchover enable command and is saved to the device. If a switchover request is received, the Switchover Key set along the switchover request must match the key used on the initial device opening with the switchover enable command. Otherwise no access is granted. The key remains valid until the device is completely closed.

To set the Switchover Key using the device discovery, use: .SetParameter(CVB_LIT("SwitchoverKey"), CVB_LIT("0x0000"));

 

If no Switchover Key is set, the key will be 0 in all cases, which also works just fine. The idea behind the key is more of an additional barrier to shield against involuntary external access to a GEV connected device.

To take control of a  switchover enabled device, set Request Switchover (in 1)) or set Open Mode to Control Request Switchover in 2)A) or call .SetParameter(CVB_LIT("AccessMode"), CVB_LIT("6")); on the device that should be opened.

To enable unconditional streaming tick the option in the device node map or set the node map option on the opened device in code.

activate_unconditional_streaming