Multicast with CVB with Switchover and Unconditional Streaming

<< Click to Display Table of Contents >>

Navigation:  CVB with GenICam > Configuration > Use Cases >

Multicast with CVB with Switchover and Unconditional Streaming

 

For normal Multicast (without Switchover and Unconditional Streaming) checkout the according topic.

 

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

 

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.

Multicast6

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

 

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.

 

      // 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("5")); // 5 = Control Enable Switchover

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

      // The Key is optional and 0 if not set, feel free to not set the parameter

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