Introduction
By default, GigE Vision software will discover cameras by sending a discovery command that is broadcast to cameras on the same subnet. This is referred to as Broadcast Device Discovery. If a camera is located on a different subnet but still part of the same network, and the IP address of the camera is known, it is possible to discover this camera using Unicast Device Discovery.
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
Firmware:
- Phoenix: firmware v1.64 or higher
- Triton: firmware v1.75 or higher
Hardware:
- Router with static route capability
- PCIE-POE1-MG2 (ioi GE10P-PCIE4XG301)
Example Setup
Consider the following example setup:
Using Broadcast Device Discovery, the PC will not be able to find the TRI122S because it is in a different subnet. It would only find devices on the same network as 192.168.100.x. Using Unicast Device Discovery, the PC will send a discovery packet to the device’s IP address. The router would route traffic coming into 192.168.100.1 and destined for 192.168.200.x since it would be aware of both connected networks.
Discovering Unicast Devices
Since the host PC is in a different subnet from the camera, the host PC’s NIC that will be communicating with the router must be told to route packets meant for 192.168.200.x/24 addresses:
On Windows:
> route add 192.168.200.0 MASK 255.255.255.0 192.168.100.1
On Linux:
$ sudo route add -net 192.168.200.0/24 gw 192.168.100.1
To discover a camera with unicast device discovery, use the AddUnicastDeviceDiscovery function:
GenICam::gcstring deviceToDiscover = "192.168.200.200"; std::cout << "AddUnicastDiscoveryDevice: " << deviceToDiscover << std::endl; pSystem->AddUnicastDiscoveryDevice(deviceToDiscover.c_str()); pSystem->UpdateDevices(100); std::vector<Arena::DeviceInfo> deviceInfos = pSystem->GetDevices();
When the unicast device is discovered, you can connect to it as an Arena::IDevice:
size_t numDevices = deviceInfos.size(); if (numDevices > 0) { Arena::IDevice* pDevice = nullptr; size_t cameraIndex = -1; for (size_t i = 0; i < numDevices; i++) { if (deviceToDiscover == deviceInfos[i].IpAddressStr()) { cameraIndex = i; break; } } if (cameraIndex != -1) { pDevice = pSystem->CreateDevice(deviceInfos[cameraIndex]); } }
Removing Unicast Devices
To remove a device from the unicast device discovery list, use the RemoveUnicastDeviceDiscovery function:
GenICam::gcstring deviceToDiscover = "192.168.200.200"; // [...] std::cout << "RemoveUnicastDiscoveryDevice: " << deviceToDiscover << std::endl; pSystem->RemoveUnicastDiscoveryDevice(deviceToDiscover.c_str());