OceanOptics.OceanDirect 3.1.4

OceanOptics.OceanDirect

.NET 10 wrapper and Windows x64 native runtime for Ocean Optics OceanDirect 3.1.4.

The target computer must use a 64-bit process and have the official Ocean Optics WinUSB driver installed.

using OceanOptics.OceanDirect;

using OceanDirectSession session = new();
IReadOnlyList<int> deviceIds = session.FindDeviceIds();
using OceanDirectDevice device = session.OpenDevice(deviceIds[0]);

device.SetIntegrationTimeMicroseconds(100_000);
device.SetScansToAverage(1);
device.SetBoxcarWidth(0);
double[] wavelengths = device.GetWavelengths();
double[] spectrum = device.GetSpectrum();

Network devices can be discovered or registered by IP address before using the same OpenDevice method:

IReadOnlyList<int> networkDeviceIds = session.FindNetworkDeviceIds();

int deviceId = session.AddNetworkDevice("192.168.0.10", "OceanFX");
using OceanDirectDevice networkDevice = session.OpenDevice(deviceId);

The network device type is case-sensitive. OceanDirect documents OceanFX and OceanHDX as supported values.

For repeated acquisition without allocating a new array:

double[] spectrum = new double[device.SpectrumLength];
int writtenCount = device.ReadSpectrum(spectrum);

A blocked acquisition can be interrupted on devices that support the OceanDirect spectrum acquisition control feature:

device.AbortAcquisition();

Only one OceanDirectSession can be active in a process.

No packages depend on OceanOptics.OceanDirect.

.NET 10.0

  • No dependencies.

Version Downloads Last updated
3.1.4 15 07/30/2026