OptrisOptrisDocumentation

Documentation/OTC SDK/Optris.Sdk — C# API referencev12.0

NetworkTarget

public sealed class NetworkTarget

Which camera to reach over the network, and where it is.

Discovery is a UDP broadcast, and a broadcast does not cross a router. A camera behind one, or on a subnet this machine has no interface on, is invisible to Sdk.EnumerateDevices however long it waits. Naming the address is the only way to reach it, and on a plant it is the normal way.

NetworkTarget.Serial is optional. An address says where to look and a serial says which camera to accept, which matters because addresses get reassigned; but an operator typing an address into an "add camera" box does not know the serial yet. Left empty, the SDK asks the address who is there and opens whatever answers. Set it once you know it: for a camera you are reconnecting to, it is what stops you silently opening a different camera that inherited the address.

Example

// An operator typed an address; the serial is not known yet.
var target = new NetworkTarget { Address = "10.0.0.99" };

// List it before opening it, so the user can confirm.
DeviceInfo? found = Sdk.Probe(target);
if (found is null)
{
    Console.WriteLine("Nothing answered at 10.0.0.99.");
    return;
}

Console.WriteLine($"Found {found.Model} ({found.Serial}).");
await using var camera = ThermalCamera.Open(target);

NetworkTarget: constructors

public NetworkTarget()

NetworkTarget: properties

public string Address { get; init; }

The camera's address, for example 10.0.0.99.

public Nullable<TimeSpan> ConnectTimeout { get; init; }

How long to wait for the camera's control channel to answer before giving up.

This is what a mistyped address costs on ThermalCamera.Open(…). Without a bound the operating system decides, and on Linux that is a little over two minutes.

public Nullable<TimeSpan> DiscoveryTimeout { get; init; }

How long to wait for the camera to identify itself.

What Sdk.Probe(…) waits, and what ThermalCamera.Open(…) waits for the serial when NetworkTarget.Serial was not given. A camera answers the next discovery message rather than one already in flight, so this needs to span more than one attempt.

public Nullable<ushort> Port { get; init; }

The UDP port the camera streams to, or null to use the camera's own configured port.

public string? Serial { get; init; }

Accept only this camera, or null to accept whichever one answers at NetworkTarget.Address.