Using the Control_LW API

Download the AxsunOCTControl_LW binaries for your desired system architecture and host OS from the links on the Software Downloads page. Then follow the instructions below for installation of additional dependencies according to your host OS and desired communication interfaces. Finally, run the included example console application to confirm successful installation before integrating the Control_LW API into your custom application.

Installing USB Dependencies and Driver

If you plan to use the AxsunOCTControl_LW library for USB-based communication with an Axsun device, follow the installation steps below. RS-232 or Ethernet-based communication with Axsun devices do not require additional dependencies and the libusb installation and USB Device Driver steps can be skipped.

libusb

The AxsunOCTControl_LW library uses the libusb library for communication with Axsun devices connected via USB to a Windows or Linux host computer. Additional information and installation instructions regarding libusb can be found here.

Windows Installation

DOWNLOAD and extract the pre-built binary and move the file "libusb-1.0.dll" into your C:\Windows\System32 directory (or other location in the loader search path if preferred).

Linux Installation

Ubuntu Linux users can install libusb via package manager using the Terminal command:

sudo apt-get install libusb-1.0-0-dev

Installation in other Linux distributions should have an alternative package manager command that can be found via simple online search.

The USB device requires root permissions by default but modified non-root permissions can be achieved in a persistent fashion (across reboots) by creating and saving a new text file named "axsun.rules" with the following contents:

SUBSYSTEM=="usb", ATTRS{idVendor}=="1363", MODE="0666"
SUBSYSTEM=="usb_device", ATTRS{idVendor}=="1363", MODE="0666"

and then copying the file to the /etc/udev/rules.d directory and triggering a rule update:

sudo cp axsun.rules /etc/udev/rules.d/
sudo udevadm trigger

USB Device Driver (Windows OS only)

If you plan to use AxsunOCTControl_LW to connect to devices via USB on Windows OS, you must install the USB device driver libusb-win32 v1.2.6 or newer (or upgrade the USB device driver to v1.2.6 or newer if an older version was previously installed during installation of OCT Host).

Following installation of OCT Host (possibly with an older USB driver version), a connected Axsun device (DAQ or Laser Engine) will be displayed in Device Manager as "Axsun OCT Engine" in the "Axsun OCT Devices" device class with "Driver Provider: Axsun" and "Digital Signer: Axsun Technologies, Inc."

"Axsun OCT Engine" in Device Manager, indicating an older driver which needs to be updated for compatibility with AxsunOCTControl_LW.

To install or update the newer USB driver for compatibility with AxsunOCTControl_LW:

  • DOWNLOAD and extract the .zip on your local disk.

  • With the Axsun device connected to the PC via USB and powered-on, run the batch file titled RunMeAsAdministrator.bat by right-clicking on its icon and selecting the Run as administrator menu item.

  • Answer YES if a Microsoft User Account Control pop-up requests permission to make changes to your computer.

  • A terminal window will launch and display the driver installation status. Press any key to close the terminal window once prompted.

NOTE: If the USB driver installation is unsuccessful after selecting the Run as administrator menu item on the .bat file in Windows Explorer, launch a Command Prompt as administrator, change directory to the location of the .bat file on your disk, and execute it directly from the command prompt.

Following successful installation, each connected Axsun USB device will appear in Device Manager as "Axsun OCT USB Device" in the "Axsun OCT Devices" class, and the Device Properties window will indicate "Driver Provider: Excelitas Technologies" and "Digital Signer: Excelitas Technologies Corp."

Device Manager with one Axsun device connected via USB (following USB device driver installation).
Device Properties window for the Axsun OCT USB Device with the updated driver successfully installed.

Updating C++ Runtime

Windows

Install the most recent available version of the x64 Microsoft Visual C++ Redistributable from this link.

Linux OS

Depending on the age of your OS and the AxsunOCTControl_LW library version used, you may need to install an updated version of the C++ runtime (libstd++.so).

For AxsunOCTControl_LW version 2.0.2 (and older) symbol version GLIBCXX_3.4.26 is required.

For AxsunOCTControl_LW version 2.2.0 (and newer) symbol version GLIBCXX_3.4.31 is required.

Ubuntu 18.04 (or newer) users experiencing errors such as "GLIBCXX_3.4.31 not found" when loading the AxsunOCTControl_LW shared library can safely upgrade the C++ runtime via the toolchain test PPA:

sudo apt install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install libstdc++6

Run the Example Console Application

Launch the console application "AxsunOCTControl_LW_Example" which can be found in the /bin directory of the downloaded AxsunOCTControl_LW package. If all dependencies and drivers are installed correctly, the console should print something similar to:

and if any Axsun devices are connected to the host system they will be listed as shown:

Press "Q" and ENTER to quit the console application.

Integrating Into Your Application

Basic functionality of the AxsunOCTControl_LW API can be achieved with only several function calls as demonstrated in the AxsunOCTControl_LW Function Reference example programs.

  • The AxsunOCTControl_LW API is a "plain-old" ANSI C interface which can be directly called from applications coded in native C or C++.

  • LabVIEW integration can be achieved using the Call Library Function Node.

  • C#/.NET Framework integration can be achieved using P/Invoke and the DllImport attribute discussed here.

  • Python integration can be achieved using the ctypes library.

Last updated

Was this helpful?