AxsunOCTControl_LW v2.2.0
A cross-platform library for controlling Axsun SS-OCT laser engine and data acquisition devices.
Loading...
Searching...
No Matches
AxsunOCTControl_LW Documentation

Background

The AxsunOCTControl_LW library and API is a Light-Weight "LW" alternative to the .NET-based AxsunOCTControl.dll and is designed for cross-platform compatibility including Windows-x64, Linux-x64, Linux-arm64, and Linux-arm32.

Supported communication interfaces include USB (1st Generation Laser Engines, Azmyth Laser Engine, Camera Link DAQ, and Ethernet/PCIe DAQ), Ethernet network (for Ethernet DAQ only), and serial/RS-232 (1st Generation Laser Engines only).

AxsunOCTControl_LW provides complete user functionality for Axsun laser engines (like AxsunOCTControl.dll) as well as additional convenience functions for the Axsun Ethernet/PCIe DAQ.

Use this AxsunOCTControl_LW library if you are:

  • creating an application for a non-Windows platform, or
  • controlling the Axsun Ethernet/PCIe DAQ, or
  • coding in a language other than C# and would like to avoid accessing AxsunOCTControl.dll through COM assembly registration.

Use AxsunOCTControl.dll if you are creating a .NET Framework application for controlling a laser engine in C# or in an alternative language which supports straightforward binding of .NET Framework assemblies on a Windows platform.


C API Usage Guidelines

Naming Conventions: All C function names in this library begin with "ax__". All enumerated typedefs in this library begin with "Ax__".

Error Handling: Functions usually return an error code as defined in the AxErr enum. Check that returned values indicate NO_AxERROR after function calls.

Thread Safety: All communication interface resources are protected from concurrent access within the same process. As of version 1.7.0, it is no longer required to design client applications to prevent concurrent library function calls when communicating with connected devices. Therefore, it is safe to communicate with connected devices from within client-supplied callbacks (i.e. invoked in background threads). The only function which cannot safely be invoked within a callback is axCloseAxsunOCTControl().

Project Configuration: Include the AxsunOCTControl_LW_C.h header file in your C/C++ project and link to AxsunOCTControl_LW.dll (or libaxsunoctcontrol_lw.so on Linux).

On Windows OS, you must also link to the include library AxsunOCTControl_LW.lib.

Library Usage: To integrate the library in your client application, follow the basic usage example provided in the C++ source code at AxsunOCTControl_LW_ExampleConsoleApp.cpp. A Python usage example is provided in AxsunOCTControl_LW_Python_example.py. A C# usage example is provided in AxsunOCTControl_LW_ExampleConsoleApp.cs.

The most simple library usage can be acheived with the following three pseudo-code steps:

1) Open a new AxsunOCTControl_LW context using axOpenAxsunOCTControl():

AxErr returnValue = axOpenAxsunOCTControl(1);           // the "1" argument automatically opens USB and Ethernet interfaces

2) Wait for attached devices to connect with the library (~3 seconds) using a Sleep() command appropriate for your system, then call functions from this library as desired within your application workflow. The last argument in most function calls identifies the device index to be addressed (which_device, which_laser, or which_DAQ). Most system configurations have only one device and this argument will = 0. Only system configurations that include more than one device need be concerned with non-zero values of this which_ argument. E.g.:

returnValue = axSetFPGARegister(24,     // regnum:      set FPGA register 24
                                0x7000, // regval:      to a value of 0x7000
                                0);     // which_DAQ:   on the 1st connected DAQ (index #0)

returnValue = axSetLaserEmission(1,     // emission_state:  on
                                 0);    // which_laser: on the 1st connected Laser (index #0)

returnValue = axDeviceType(&dev_type,   // pointer to receive device type
                           1);          // which_device: on the 2nd connected Device (index #1, could be Laser or DAQ)

3) Always call axCloseAxsunOCTControl() to release resources prior to quitting:

returnValue = axCloseAxsunOCTControl();