LogoLogo
Software DownloadsDatasheetsRequest Support
  • Axsun Knowledge Base
  • OCT Product Configurations
  • Essential Information Guide
  • Getting Started Guides
    • SS-OCT Laser Engine
    • Integrated Engine (Laser & DAQ)
      • Making Connections
      • Installing Software
      • Operating the Integrated Engine
  • Reference Manuals
    • Dimensions
    • Electrical Interfaces & Connectors
    • Environmental Requirements
    • SS-OCT Laser Engine
      • Advanced Laser Engine Features
      • Laser Accessories
      • Laser Test Report
      • Frequently Asked Questions
      • Laser Troubleshooting
    • Ethernet/PCIe DAQ Board
      • Architecture & Interface Background
      • Basic Operation
      • Advanced DAQ Features
      • FPGA Register Reference
      • Frequently Asked Questions
      • DAQ Troubleshooting
    • Camera Link DAQ Board
  • How-Tos
    • Upgrading Board Firmware
    • Upgrading FPGA Bitstreams
    • Using AxsunOCTControl.dll in C++
    • Operating a Variable Delay Line
    • Using the Interface Board
    • Installing the PCIe Device Driver
  • Using Bus Power for the PCIe DAQ
  • Software Tools
    • OCT Host
    • Hardware Control Tool
    • Image Capture Tool
  • API References
    • AxsunOCTControl (.NET)
      • Using the Control.NET API
      • AxsunOCTControl Function Reference
    • AxsunOCTControl_LW (light-weight)
      • Using the Control_LW API
      • AxsunOCTControl_LW Function Reference
    • AxsunOCTCapture
      • Using the Capture API
      • Linux Installation
      • AxsunOCTCapture Function Reference
  • Other
    • Software Downloads
    • Datasheets
    • References
    • Contact Excelitas For Help
      • Tech Support Request Form
Powered by GitBook

© 2025 Excelitas Technologies

On this page
  • Installing Driver Dependencies
  • Integrating Into Your Application
  • C#
  • C/C++
  • LabVIEW
  • MATLAB
  • Python
  • Error Handling and Reporting
  • Firmware Error Codes
  • Library Error Codes

Was this helpful?

  1. API References
  2. AxsunOCTControl (.NET)

Using the Control.NET API

PreviousAxsunOCTControl (.NET)NextAxsunOCTControl_LW (light-weight)

Last updated 4 months ago

Was this helpful?

Installing Driver Dependencies

Follow the instructions for to also install the dependencies for the AxsunOCTControl.NET API. is a GUI application based on AxsunOCTControl.dll. For USB communication with Axsun devices, the AxsunOCTControl library also depends on LibUsbDotNet.dll and a USB device driver which are also installed with OCT Host.

Integrating Into Your Application

The AxsunOCTControl.NET API can be called into from source code platforms that support .NET library integration. The basic syntax for several common languages is shown below:

C#

Create an instance of an AxsunOCTControl object using its default constructor, then call member functions as desired:

AxsunOCTControl.AxsunOCTControl AOCT;
AOCT = new AxsunOCTControl.AxsunOCTControl();

string ControlVersion = "";
AOCT.GetControlVersion(ref ControlVersion);

More extensive sample code is available in the .

C/C++

Integrating AxsunOCTControl in a C++ application requires some extra setup involving COM assembly registration. Refer to the Guide on for more details.

To use the AxsunOCTControl in a "plain-old" C application, first perform the steps to integrate AxsunOCTControl with a C++ application and then create an extern "C" {} wrapper library for the AxsunOCTControl.dll methods you wish to call.

LabVIEW

Integrating AxsunOCTControl in a LabVIEW application is straightforward using the functions on the Connectivity -> .NET palette:

  • Place a Constructor Node function on your block diagram.

  • Use the file dialog to navigate to the location of the AxsunOCTControl.dll assembly on your disk, open it, and then select "AxsunOCTControl" in the list of available objects:

  • Place Invoke Node (.NET) functions and wire the reference output from the AxsunOCTControl constructor node to the reference input of the invoke node. Select desired AxsunOCTControl methods to call via each of the invoke nodes, for example GetControlVersion()

  • Add a string indicator and also a Close Reference function to explicitly close the AxsunOCTControl object at the end of your program flow.

  • Run the VI to display the version of the AxsunOCTControl library in the string indicator:

  • The Reg Event Callback function can be used to register a callback VI to execute when the library detects the connection or disconnection of a device.

MATLAB

% (note your library path may be different)
NET.addAssembly('C:\Program Files\Axsun\Axsun OCT Control\AxsunOCTControl.dll');
AOCT = AxsunOCTControl.AxsunOCTControl;
ControlVersionString = char(AOCT.GetControlVersion());

NOTE: A known bug (1759533) in MATLAB version R2018a may generate an "external component" exception. To avoid this, please downgrade to MATLAB 2017 or upgrade to MATLAB R2018b or newer.

Python

import clr
import string
import sys

# note your library path may be different
dllFile = r'C:\Program Files (x86)\Axsun\OCT Host\AxsunOCTControl'
clr.AddReference(dllFile)

from AxsunOCTControl import AxsunOCTControl
AOCT = AxsunOCTControl()                            # call constructor
ControlVersionString = AOCT.GetControlVersion()     # call library functions

Error Handling and Reporting

The tables below list possible error codes which can occur during the use of the AxsunOCTControl library and an Axsun OCT device such as a Laser Engine, Camera Link DAQ Board, or Ethernet/PCIe DAQ Board.

It is rare for errors to result from a device hardware malfunction. Rather, errors that do occur are more likely a result of device-host communication issues or an improper sequence of API calls. If an error or warning occurs that cannot be explained, try the following steps:

  1. Restart (power-cycle) the device hardware.

  2. Restart the Host PC.

Firmware Error Codes

Firmware errors are generated by the microcontroller on the OCT device (e.g. laser driver board or DAQ board) and reported to the user via the AxsunOCTControl library API or GUI tools based on this API.

Error Code

Description & Notes

0

No Error

1

USB_CHECKSUM_ERROR

2

USB_TIMEOUT_ERROR

3

USB_READ_ERROR

4

USB_WRITE_ERROR

5

HIGHEST_USB_ERROR

6

DAC_TABLE_TOO_LARGE

...

...

Library Error Codes

Library errors are generated by the AxsunOCTControl library running on the host PC.

Error Code

Description & Notes

1000

ERROR_READING

1001

ERROR_WRITING_1

1002

NO_DEVICE_PRESENT

1003

CHECKSUM_ERROR

1004

TOO_MANY_PACKET_TRIES

...

...

NOTE: Consider using the "light-weight" if your application is based on a C or C++ codebase.

Install the pythonnet library from

Reset the AxsunOCTControl library instance and/or the GUI Tool (e.g. , , or your custom application) which is built around the AxsunOCTControl library.

If unexplained errors or warnings continue after following these steps, please .

AxsunOCTControl_LW library
https://github.com/pythonnet/pythonnet
OCT Host
Hardware Control Tool
contact Axsun Customer Support
OCT Host
AxsunOCTControl function reference
Using AxsunOCTControl.dll in C++
Installing OCT Host
The LabVIEW 2016 .NET functions palette.
Open the AxsunOCTControl.dll assembly and create an AxsunOCTControl object.
Select a method to correspond with each invoke node.
Wire a VI Ref callback to execute on OCTDeviceConnectOrDisconnectEvent.