Multicast with CVB

<< Click to Display Table of Contents >>

Navigation:  CVB with GenICam > Configuration > Use Cases >

Multicast with CVB

 

For Multicast Switchover and Unconditional Streaming checkout the according topic.

 

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 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

 

For Multicast with Socket Driver (SD) please consider the Network Configuration, especially for Multicast with Socket Driver.

 

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"));

      // Can be kept as 0 (join = no join disabled) to get images on all devices

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

      // Keep master mode set to true on reconnect after application crash.

      // If the master is set to 0, the MC session will be closed.

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

      // Optionally set a session, this is also the default multicast session.

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