Introduction
Traditionally, GigE Vision applications that control a device must explicitly release control before another application can request control.
Primary Application Switchover allows another application to take control of a device without waiting for the original controlling application to release control. This can be useful if the primary application or host PC becomes unavailable and quick recovery is mandatory. This document shows how to use Primary Application Switchover with LUCID cameras.
Requirements
Arena SDK:
- Windows: Arena SDK v1.0.36.5 or higher
- Linux x64: Arena SDK v0.1.68 or higher
- Linux ARM64: Arena SDK v0.1.48 or higher
Equipment Used:
- PHX050S with firmware v1.62.0.0
- PCIE-POE2 (ADLINK 2-CH PCIe GigE Vision PoE+ Card)
- Netgear GS305PP
Example Setup
Consider the following example setup:
Normally, when multiple host PCs or multiple host applications attempt to connect to a single camera, the first application will be granted ReadWrite access and any subsequent connections will be granted ReadOnly access:
The above diagram contains the following sequence:
- PC1 connects to the PHX050S and is granted ReadWrite access to the camera
- PC2 connects to the PHX050S but since PC1 already has ReadWrite access, PC2 is granted ReadOnly access to the camera
- If PC2 attempts to set DeviceAccessStatus = ReadWrite to gain control of the camera, it will fail
Using Primary Application Switchover, it is possible for another PC or another host application to take control:
The above diagram contains the following sequence:
- PC1 connects to the PHX050S and is granted ReadWrite access to the camera
- PC1 sets the GenTL parameter CcpSwitchoverKey = 0x1000
GenTL parameters are connection specific. If another application connects and sets this key, it will be able to take control of the camera. - PC2 connects to the PHX050S but since PC1 already has ReadWrite access, PC2 is granted ReadOnly access to the camera
- PC2 sets the GenTL parameter CcpSwitchoverKey = 0x1000
- PC2 has set the correct switchover key, so it is granted ReadWrite access to the camera
In C++ code:
// Create a device Arena::IDevice* pDevice = pSystem->CreateDevice(deviceInfos[0]); // Retrieve DeviceAccessStatus GenICam::gcstring deviceAccessStatus = Arena::GetNodeValue<GenICam::gcstring>(pDevice->GetTLDeviceNodeMap(), "DeviceAccessStatus"); // The switchover key to be used static int64_t switchoverKey = 0x1000; // Check DeviceAccessStatus to determine if we have ReadWrite status // If we have ReadOnly status, another application has control of the camera: if (deviceAccessStatus == "ReadWrite") { // Set a switchover key in case another application needs to take control Arena::SetNodeValue<int64_t>(pDevice->GetTLDeviceNodeMap(), "CcpSwitchoverKey", switchoverKey); } else { // Apply the correct switchover key and change the DeviceAccessStatus to ReadWrite to gain control // If there is no switchover key, or an incorrect switchover key, ReadWrite access will not be granted Arena::SetNodeValue<int64_t>(pDevice->GetTLDeviceNodeMap(), "CcpSwitchoverKey", switchoverKey); Arena::SetNodeValue<GenICam::gcstring>(pDevice->GetTLDeviceNodeMap(), "DeviceAccessStatus", "ReadWrite"); }
In the above example, the last application to connect to the camera will be granted ReadWrite access as long as the correct switchover key is supplied.
Conclusion
For systems where redundancy and fault recovery are required, Primary Application Switchover allows a second application to recover control of a camera. It is also useful when there is a business requirement to allow another application or another host PC to immediately take control of a camera.