AxsunOCTControl_LW  0.9.2.0
A light-weight & cross-platform alternative to the .NET-based AxsunOCTControl.dll.
Typedefs | Enumerations | Functions
AxsunOCTControl_LW_C.h File Reference

This header file defines the usage of the AxsunOCTControl_LW "lightweight" library in a C or C++ application. More...

#include "AxsunCommonEnums.h"
#include "extcode.h"
#include <stdint.h>

Go to the source code of this file.

Typedefs

typedef void(__cdecl * AxConnectCallbackFunctionC_t) (void *)
 Type defintion for a user-provided function to be called upon connection or disconnection of a device.
 

Enumerations

enum  AxEdgeSource { EXTERNAL = 0, INTERNAL = 1, LVDS = 2, LVCMOS = 3 }
 DAQ clock and trigger sources. More...
 
enum  AxPolarizationMode { HORIZONTAL = 0, VERTICAL = 1, DIVERSE = 2 }
 DAQ polarization modes. More...
 
enum  AxConnectionType {
  NONE = 0, USB = 1, RS232_PASSTHROUGH = 2, RS232 = 3,
  ETHERNET = 4
}
 
enum  AxDevType { UNDEFINED = 0, LASER = 40, CLDAQ = 41, EDAQ = 42 }
 
enum  AxTECState {
  TEC_UNINITIALIZED = 0, WARMING_UP = 1, WAITING_IN_RANGE = 2, READY = 3,
  NOT_INSTALLED = 5, ERROR_NEVER_GOT_TO_READY = 16, ERROR_WENT_OUT_OF_RANGE = 17
}
 Laser TEC states. More...
 

Functions

void axGetErrorString (AxErr errornum, char *error_string)
 Gets a string which explains an error code in a more verbose fashion. More...
 
AxErr axOpenAxsunOCTControl (uint32_t open_all_interfaces)
 Opens the AxsunOCTControl context for subsequent device communication. More...
 
AxErr axCloseAxsunOCTControl ()
 Closes an AxsunOCTControl context previously opened with axOpenAxsunOCTControl(). More...
 
AxErr axNetworkInterfaceOpen (uint32_t interface_status)
 Opens, resets, or closes the Ethernet network interface. More...
 
AxErr axUSBInterfaceOpen (uint32_t interface_status)
 Opens, resets, or closes the USB interface. More...
 
AxErr axSerialInterfaceOpen (uint32_t interface_status, char *port)
 Opens, resets, or closes a RS-232 serial interface on a given port. More...
 
AxErr axImagingCntrlEthernet (int16_t number_of_images, uint32_t which_DAQ)
 Control the DAQ operational mode (Live Imaging, Burst Recording, or Imaging Off) when using the Ethernet interface. More...
 
AxErr axSetImageSyncSource (AxEdgeSource source, float frequency, uint32_t which_DAQ)
 Select the Image_sync source. More...
 
AxErr axSetSampleClockSource (AxEdgeSource source, uint32_t which_DAQ)
 Select the ADC sample clock source. More...
 
AxErr axSetSweepTriggerSource (AxEdgeSource source, uint32_t which_DAQ)
 Select the sweep trigger source. More...
 
AxErr axSetPipelineMode (AxPipelineMode pipeline_mode, uint32_t which_DAQ)
 Select the DAQ's pipeline mode (i.e. bypass mode). More...
 
AxErr axSetPolarizationMode (AxPolarizationMode polarization_mode, uint32_t which_DAQ)
 Select the DAQ's polarization channel configuration. More...
 
AxErr axSetEightBitGain (float gain, uint32_t which_DAQ)
 Set the GAIN term during 16- to 8-bit dynamic range compression. More...
 
AxErr axSetEightBitOffset (float offset, uint32_t which_DAQ)
 Set the OFFSET term during 16- to 8-bit dynamic range compression. More...
 
AxErr axSetSubsamplingFactor (uint8_t subsampling_factor, uint32_t which_DAQ)
 Set the A-line subsampling factor. More...
 
AxErr axGetFPGARegister (const uint32_t regnum, uint16_t *regval, uint32_t which_DAQ)
 Gets (i.e. reads) the current value in a FPGA register. More...
 
AxErr axGetFPGARegisterRange (const uint32_t start_regnum, const uint32_t end_regnum, uint16_t *regvals, const uint32_t bytes_allocated, uint32_t which_DAQ)
 Gets (i.e. reads) current values in a range of FPGA registers. More...
 
AxErr axGetFPGARegisterDefaults (uint32_t elements_allocated, uint16_t *regnums, uint16_t *regvals, uint32_t *elements_returned, uint32_t which_DAQ)
 Gets (i.e. reads) the programmed power-on default FPGA register configuration script as register number-value pairs. More...
 
AxErr axSetFPGARegisterDefaults (const uint16_t *regnums, const uint16_t *regvals, const uint32_t count, uint32_t which_DAQ)
 Sets (i.e. writes) a power-on default FPGA register configuration script, overwriting the existing script. More...
 
AxErr axSetFPGARegister (const uint32_t regnum, const uint16_t regval, uint32_t which_DAQ)
 Sets (i.e. writes) a FPGA register with a single value. More...
 
AxErr axSetFPGARegisterSingleBit (const uint32_t regnum, const uint32_t bitnum, const uint32_t value, uint32_t which_DAQ)
 Sets or Clears a single bit in a FPGA register. More...
 
AxErr axSetFPGADataArray (const uint32_t regnum, const uint16_t *data_array, const uint32_t number_of_words, uint32_t which_DAQ)
 Sets (i.e. writes) a FPGA register with an array of multiple values. More...
 
AxErr axReadDAQPHYRegister (uint32_t phynum, uint32_t regnum, uint16_t *regval, uint32_t which_DAQ)
 Reads the current value in a DAQ PHY register. More...
 
AxErr axConnectionHeartbeat (uint32_t heartbeat_state, uint32_t which_device)
 Disable or re-enable the Connection Heartbeat for a device connected by Ethernet network or RS-232. More...
 
AxErr axDebugCommand (uint32_t command_number, uint32_t value_out, uint32_t *command_in, uint32_t *value_in, uint32_t which_device)
 Send a debug command. More...
 
AxErr axFirmwareVersion (uint32_t *major, uint32_t *minor, uint32_t *patch, uint32_t which_device)
 Gets the device firmware version. More...
 
AxErr axFPGAVersion (uint32_t *major, uint32_t *minor, uint32_t *patch, uint32_t *build, uint32_t which_device)
 Gets the device FPGA version. More...
 
AxErr axLibraryVersion (uint32_t *major, uint32_t *minor, uint32_t *patch, uint32_t *build)
 Gets the library version. More...
 
AxErr axDeviceType (AxDevType *device_type, uint32_t which_device)
 Gets the device type (e.g. Laser, EDAQ). More...
 
AxErr axSerialNumber (char *serial_number, uint32_t which_device)
 Gets the device serial number string. More...
 
AxErr axConnectionType (AxConnectionType *connection_type, uint32_t which_device)
 Gets the device connection interface (e.g. USB, Ethernet, RS-232). More...
 
AxErr axCountDeviceSettings (uint32_t *float_count, uint32_t *int_count, uint32_t *bool_count, uint32_t which_device)
 Counts the number of individual device settings elements for each of the three data types (float, int, and bool). More...
 
AxErr axGetFloatSetting (uint32_t which_setting, float *setting_value, char *setting_string, uint32_t which_device)
 Gets a floating point setting's value and name string. More...
 
AxErr axGetIntSetting (uint32_t which_setting, int32_t *setting_value, char *setting_string, uint32_t which_device)
 Gets a integer setting's value and name string. More...
 
AxErr axGetBoolSetting (uint32_t which_setting, uint8_t *setting_value, char *setting_string, uint32_t which_device)
 Gets a boolean setting's value and name string. More...
 
AxErr axSettingsToDevice (uint32_t float_count, uint32_t int_count, uint32_t bool_count, float *float_values, int32_t *int_values, uint8_t *bool_values, uint32_t which_device)
 Write device settings to non-volatile memory (i.e. flash). More...
 
uint32_t axCountConnectedDevices ()
 Counts the number of devices successfully connected and enumerated by AxsunOCTControl. More...
 
AxErr axSetLaserEmission (uint32_t emission_state, uint32_t which_laser)
 Enables or disables laser emission. More...
 
AxErr axGetLaserEmission (uint32_t *emitting, uint32_t which_laser)
 Gets laser emission status. More...
 
AxErr axSetClockDelay (uint32_t delay_code, uint32_t which_laser)
 Sets the electronic K-clock delay. More...
 
AxErr axGetClockDelay (uint32_t *delay_code, uint32_t which_laser)
 Gets the currently configured electronic K-clock delay. More...
 
AxErr axHomeVDL (uint32_t which_laser)
 Starts the VDL home operation. More...
 
AxErr axStopVDL (uint32_t which_laser)
 Stops any VDL operation (e.g. move or home) currently in progress. More...
 
AxErr axMoveRelVDL (float rel_position, float speed, uint32_t which_laser)
 Move the VDL relative to its current position. More...
 
AxErr axMoveAbsVDL (float abs_position, float speed, uint32_t which_laser)
 Move the VDL to an absolute position. More...
 
AxErr axGetVDLStatus (float *current_pos, float *target_pos, float *speed, int32_t *error_from_last_home, uint32_t *last_move_time, uint8_t *state, uint8_t *home_switch, uint8_t *limit_switch, uint8_t *VDL_error, uint32_t which_laser)
 Gets the current status of the VDL. More...
 
AxErr axGetTECState (AxTECState *TEC_state, uint32_t which_TEC, uint32_t which_laser)
 Gets the current state of a Laser Thermo-Electric Cooler (TEC). More...
 
AxErr axSetDACTable (uint32_t points, uint32_t speed, uint32_t timer1time, uint32_t timer2time, uint32_t timer1duration, uint32_t timer2duration, uint16_t *volts_currents, uint32_t which_laser)
 Sets the DAC table. More...
 
AxErr axGetDACTable (uint32_t *points, uint32_t *speed, uint32_t *timer1time, uint32_t *timer2time, uint32_t *timer1duration, uint32_t *timer2duration, uint16_t *volts_currents, uint32_t which_laser)
 Gets the currently configured DAC table. More...
 
AxErr axSetDriveConfiguration (uint32_t which_config, uint32_t which_laser)
 Selects a pre-programmed laser drive configuration. More...
 
AxErr axGetDriveConfiguration (uint32_t *current_configuration, uint32_t which_laser)
 Gets the currently selected drive configuration. More...
 
AxErr axRegisterConnectCallback (AxConnectCallbackFunctionC_t callback_function, void *userData)
 Registers a callback function to be executed following a device connection or disconnection event. More...
 
AxErr axRegisterLabVIEWCallback (LVUserEventRef *refnumptr)
 Registers a LabVIEW user event to be executed following a device connection or disconnection event. More...
 

Detailed Description

This header file defines the usage of the AxsunOCTControl_LW "lightweight" library in a C or C++ application.

Refer to the Main Page for C API Usage Guidelines .

Enumeration Type Documentation

◆ AxConnectionType

Enumerator
USB 

USB 2.0 interface.

RS232_PASSTHROUGH 

via DAQ's Ethernet interface.

RS232 

RS-232 serial interface.

ETHERNET 

TCP/IP Ethernet interface.

◆ AxDevType

enum AxDevType
Enumerator
LASER 

Axsun Laser Engine Device.

CLDAQ 

Axsun Camera Link DAQ Device.

EDAQ 

Axsun Ethernet/PCIe DAQ Device.

◆ AxEdgeSource

DAQ clock and trigger sources.

Enumerator
EXTERNAL 

External source (i.e. laser engine trigger and k-clock).

INTERNAL 

Internally-generated source (e.g. for simulation purposes).

LVDS 

External LVDS (for Image_sync trigger only).

LVCMOS 

External LVCMOS (for Image_sync trigger only).

◆ AxPolarizationMode

DAQ polarization modes.

Enumerator
HORIZONTAL 

Channel 1 (Horizontal) only.

VERTICAL 

Channel 2 (Vertical) only.

DIVERSE 

Horizontal and Vertical channels mixed using vector sum.

◆ AxTECState

enum AxTECState

Laser TEC states.

Enumerator
TEC_UNINITIALIZED 

TEC has not been initialized.

WARMING_UP 

TEC is stabilizing.

WAITING_IN_RANGE 

TEC is stabilizing.

READY 

TEC is ready.

NOT_INSTALLED 

TEC is not installed.

ERROR_NEVER_GOT_TO_READY 

TEC error: never got to ready state.

ERROR_WENT_OUT_OF_RANGE 

TEC error: temperature went out of range.

Function Documentation

◆ axCloseAxsunOCTControl()

AxErr axCloseAxsunOCTControl ( )

Closes an AxsunOCTControl context previously opened with axOpenAxsunOCTControl().

Returns
NO_AxERROR on success or other AxErr error code on failure.
Examples
AxsunOCTControl_LW_Test.cpp.

◆ axConnectionHeartbeat()

AxErr axConnectionHeartbeat ( uint32_t  heartbeat_state,
uint32_t  which_device 
)

Disable or re-enable the Connection Heartbeat for a device connected by Ethernet network or RS-232.

Parameters
heartbeat_state=1 to enable the Heartbeat, =0 to disable the Heartbeat.
which_deviceThe numeric index of the desired device.
Returns
NO_AxERROR on success or other AxErr error code on failure.

The Connection Heartbeat is enabled by default when a device is connected. This function can be used to disable or subsequently re-enable it. The Connection Heartbeat sends a periodic, non-functional message to a connected device for determining its current connectivity status. If a Heartbeat response is not received, a device disconnection has occurred. If the connection Heartbeat is disabled, a disconnected device will not be recognized as such until the response to a subsequent functional message is not received.

◆ axConnectionType()

AxErr axConnectionType ( AxConnectionType connection_type,
uint32_t  which_device 
)

Gets the device connection interface (e.g. USB, Ethernet, RS-232).

Parameters
connection_typeThe interface on which the device is connected.
which_deviceThe numeric index of the desired device.
Returns
NO_AxERROR on success or other AxErr error code on failure.
Examples
AxsunOCTControl_LW_Test.cpp.

◆ axCountConnectedDevices()

uint32_t axCountConnectedDevices ( )

Counts the number of devices successfully connected and enumerated by AxsunOCTControl.

Returns
The number of connected devices.

Count includes Laser engine and DAQ boards. A device connected on two interfaces concurrently will be counted twice and thus is not a recommended configuration.

Examples
AxsunOCTControl_LW_Test.cpp.

◆ axCountDeviceSettings()

AxErr axCountDeviceSettings ( uint32_t *  float_count,
uint32_t *  int_count,
uint32_t *  bool_count,
uint32_t  which_device 
)

Counts the number of individual device settings elements for each of the three data types (float, int, and bool).

Parameters
float_countThe number of floating point settings.
int_countThe number of integer settings.
bool_countThe number of boolean settings.
which_deviceThe numeric index of the desired device.
Returns
NO_AxERROR on success or other AxErr error code on failure.

◆ axDebugCommand()

AxErr axDebugCommand ( uint32_t  command_number,
uint32_t  value_out,
uint32_t *  command_in,
uint32_t *  value_in,
uint32_t  which_device 
)

Send a debug command.

Parameters
command_number
value_out
command_in
value_in
which_deviceThe numeric index of the desired device.
Returns
NO_AxERROR on success or other AxErr error code on failure.

This function is for Axsun internal use only.

◆ axDeviceType()

AxErr axDeviceType ( AxDevType device_type,
uint32_t  which_device 
)

Gets the device type (e.g. Laser, EDAQ).

Parameters
device_typeThe type of device.
which_deviceThe numeric index of the desired device.
Returns
NO_AxERROR on success or other AxErr error code on failure.
Examples
AxsunOCTControl_LW_Test.cpp.

◆ axFirmwareVersion()

AxErr axFirmwareVersion ( uint32_t *  major,
uint32_t *  minor,
uint32_t *  patch,
uint32_t  which_device 
)

Gets the device firmware version.

Parameters
majorVersion number major element.
minorVersion number minor element.
patchVersion number patch element.
which_deviceThe numeric index of the desired device.
Returns
NO_AxERROR on success or other AxErr error code on failure.
Examples
AxsunOCTControl_LW_Test.cpp.

◆ axFPGAVersion()

AxErr axFPGAVersion ( uint32_t *  major,
uint32_t *  minor,
uint32_t *  patch,
uint32_t *  build,
uint32_t  which_device 
)

Gets the device FPGA version.

Parameters
majorVersion number major element.
minorVersion number minor element.
patchVersion number patch element.
buildVersion number build element.
which_deviceThe numeric index of the desired device.
Returns
NO_AxERROR on success or other AxErr error code on failure.

Devices which do not have an FPGA will return all version elements = 0.

Examples
AxsunOCTControl_LW_Test.cpp.

◆ axGetBoolSetting()

AxErr axGetBoolSetting ( uint32_t  which_setting,
uint8_t *  setting_value,
char *  setting_string,
uint32_t  which_device 
)

Gets a boolean setting's value and name string.

Parameters
which_settingThe index of a boolean setting.
setting_valueThe boolean setting value (non-zero if TRUE, zero if FALSE).
setting_stringA char array pre-allocated with at least 40 bytes into which the setting name will be copied as a null-terminated string.
which_deviceThe numeric index of the desired device.
Returns
NO_AxERROR on success or other AxErr error code on failure.

Use axCountDeviceSettings() to determine the number of boolean settings available (bool_count) and then call this function in a loop while indexing which_setting from 0 up to bool_count - 1.

◆ axGetClockDelay()

AxErr axGetClockDelay ( uint32_t *  delay_code,
uint32_t  which_laser 
)

Gets the currently configured electronic K-clock delay.

Parameters
delay_codeWill contain a 6-bit code representing the configured delay value.
which_laserThe numeric index of the desired Laser.
Returns
NO_AxERROR on success or other AxErr error code on failure.

See details for axSetClockDelay().

◆ axGetDACTable()

AxErr axGetDACTable ( uint32_t *  points,
uint32_t *  speed,
uint32_t *  timer1time,
uint32_t *  timer2time,
uint32_t *  timer1duration,
uint32_t *  timer2duration,
uint16_t *  volts_currents,
uint32_t  which_laser 
)

Gets the currently configured DAC table.

Parameters
points
speed
timer1time
timer2time
timer1duration
timer2duration
currents
voltages
which_laserThe numeric index of the desired Laser.
Returns
NO_AxERROR on success or other AxErr error code on failure.

This function is for Axsun internal use only.

◆ axGetDriveConfiguration()

AxErr axGetDriveConfiguration ( uint32_t *  current_configuration,
uint32_t  which_laser 
)

Gets the currently selected drive configuration.

Parameters
current_configurationThe currently selected drive configuration.
which_laserThe numeric index of the desired Laser.
Returns
NO_AxERROR on success or other AxErr error code on failure.

Laser Engines must be programmed during manufacture to support multiple drive configurations. Contact Axsun technical support for more information.

◆ axGetErrorString()

void axGetErrorString ( AxErr  errornum,
char *  error_string 
)

Gets a string which explains an error code in a more verbose fashion.

Parameters
errornumAn error code number returned from other "ax" functions in this library.
error_stringA char array pre-allocated with at least 512 bytes into which the error explanation will be copied as a nul-terminated string.

axGetErrorString() can be called at any time. It is unsafe to pass a error_string output buffer allocated with fewer than 512 bytes.

Examples
AxsunOCTControl_LW_Test.cpp.

◆ axGetFloatSetting()

AxErr axGetFloatSetting ( uint32_t  which_setting,
float *  setting_value,
char *  setting_string,
uint32_t  which_device 
)

Gets a floating point setting's value and name string.

Parameters
which_settingThe index of a floating point setting.
setting_valueThe floating point setting value.
setting_stringA char array pre-allocated with at least 40 bytes into which the setting name will be copied as a null-terminated string.
which_deviceThe numeric index of the desired device.
Returns
NO_AxERROR on success or other AxErr error code on failure.

Use axCountDeviceSettings() to determine the number of floating point settings available (float_count) and then call this function in a loop while indexing which_setting from 0 up to float_count - 1.

◆ axGetFPGARegister()

AxErr axGetFPGARegister ( const uint32_t  regnum,
uint16_t *  regval,
uint32_t  which_DAQ 
)

Gets (i.e. reads) the current value in a FPGA register.

Parameters
regnumThe FPGA register number to read.
regvalThe value read back from the FPGA register.
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

◆ axGetFPGARegisterDefaults()

AxErr axGetFPGARegisterDefaults ( uint32_t  elements_allocated,
uint16_t *  regnums,
uint16_t *  regvals,
uint32_t *  elements_returned,
uint32_t  which_DAQ 
)

Gets (i.e. reads) the programmed power-on default FPGA register configuration script as register number-value pairs.

Parameters
elements_allocatedIndicates the size (in number of U16 elements, NOT bytes) of the pre-allocated regnums and regvals arrays.
regnumsPointer to a pre-allocated array to hold the 16-bit register numbers read back from the device.
regvalsPointer to a pre-allocated array to hold the 16-bit register values read back from the device.
elements_returnedThe number of register number-value pairs read back from the device.
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

regnums and regvals are arrays which must be pre-allocated by the user. elements_returned will never be higher than elements_allocated, however if elements_returned == elements_allocated, there may be more register number-value pairs stored on the device which were not returned (indicating elements_allocated was too small to hold the full FPGA register configuration script).

◆ axGetFPGARegisterRange()

AxErr axGetFPGARegisterRange ( const uint32_t  start_regnum,
const uint32_t  end_regnum,
uint16_t *  regvals,
const uint32_t  bytes_allocated,
uint32_t  which_DAQ 
)

Gets (i.e. reads) current values in a range of FPGA registers.

Parameters
start_regnumThe first FPGA register to read in the range.
end_regnumThe last FPGA register to read in the range; must be greater than or equal to start_regnum.
regvalsPointer to a pre-allocated array to hold the 16-bit register values read back from the requested range of FPGA registers.
bytes_allocatedThe number of bytes pre-allocated by the user in the array pointed to by regvals.
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

The size of the pre-allocated memory pointed to by regvals must be 2 bytes per register in the included range: bytes_allocated should equal 2 * (end_regnum - start_regnum + 1).

Examples
AxsunOCTControl_LW_Test.cpp.

◆ axGetIntSetting()

AxErr axGetIntSetting ( uint32_t  which_setting,
int32_t *  setting_value,
char *  setting_string,
uint32_t  which_device 
)

Gets a integer setting's value and name string.

Parameters
which_settingThe index of an integer setting.
setting_valueThe integer setting value.
setting_stringA char array pre-allocated with at least 40 bytes into which the setting name will be copied as a null-terminated string.
which_deviceThe numeric index of the desired device.
Returns
NO_AxERROR on success or other AxErr error code on failure.

Use axCountDeviceSettings() to determine the number of integer settings available (int_count) and then call this function in a loop while indexing which_setting from 0 up to int_count - 1.

◆ axGetLaserEmission()

AxErr axGetLaserEmission ( uint32_t *  emitting,
uint32_t  which_laser 
)

Gets laser emission status.

Parameters
emittingWill be non-zero if laser is emitting or =0 if laser is not emitting.
which_laserThe numeric index of the desired Laser.
Returns
NO_AxERROR on success or other AxErr error code on failure.

◆ axGetTECState()

AxErr axGetTECState ( AxTECState TEC_state,
uint32_t  which_TEC,
uint32_t  which_laser 
)

Gets the current state of a Laser Thermo-Electric Cooler (TEC).

Parameters
TEC_stateCurrent state of the queried laser TEC as described by the AxsunOCTControl_LW::TECState enum.
which_TECThe index of which TEC to query (1 or 2).
which_laserThe numeric index of the desired Laser.
Returns
NO_AxERROR on success or other AxErr error code on failure.

Some Laser Engines support more than one TEC. To query the state of the primary "TEC 1", use which_TEC = 1, or for a secondary TEC use which_TEC = 2.

Examples
AxsunOCTControl_LW_Test.cpp.

◆ axGetVDLStatus()

AxErr axGetVDLStatus ( float *  current_pos,
float *  target_pos,
float *  speed,
int32_t *  error_from_last_home,
uint32_t *  last_move_time,
uint8_t *  state,
uint8_t *  home_switch,
uint8_t *  limit_switch,
uint8_t *  VDL_error,
uint32_t  which_laser 
)

Gets the current status of the VDL.

Parameters
current_posCurrent VDL position (mm).
target_posTarget VDL position (mm). Will be different than the current position during a move or home operation.
speedCurrent speed of VDL (mm/sec).
error_from_last_homeAccumulated error since last home operation (number of microsteps).
last_move_timeTime for last move operation (sec).
stateInteger codes to represent VDL state.
  • 1 = idle
  • 2 = moving
  • 3 = seeking home
  • 4 = backing off home
  • 5 = at home
  • 10 = error state
home_switchNon-zero if home (minimum position) limit switch is activated, =0 otherwise.
limit_switchNon-zero if maximum position limit switch is activated, =0 otherwise.
VDL_errorDebugging information for VDL errors.
which_laserThe numeric index of the desired Laser.
Returns
NO_AxERROR on success or other AxErr error code on failure.

Refer to documentation on AxsunOCTControl_LW::VDLStatus for additional explanation of function arguments.

◆ axHomeVDL()

AxErr axHomeVDL ( uint32_t  which_laser)

Starts the VDL home operation.

Parameters
which_laserThe numeric index of the desired Laser.
Returns
NO_AxERROR on success or other AxErr error code on failure.

This function returns after requesting the homing operation from the VDL controller; it does not wait for the mechanical homing operation to complete before returning.

Examples
AxsunOCTControl_LW_Test.cpp.

◆ axImagingCntrlEthernet()

AxErr axImagingCntrlEthernet ( int16_t  number_of_images,
uint32_t  which_DAQ 
)

Control the DAQ operational mode (Live Imaging, Burst Recording, or Imaging Off) when using the Ethernet interface.

Parameters
number_of_images=0 for Imaging Off (idle), =-1 for Live Imaging (no record), or any positive value between 1 and 32767 to request the desired number of images in a Burst Record operation.
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

This function does NOT control the laser and therefore the laser emission must be enabled/disabled separately using axSetLaserEmission(). To control the DAQ operational mode when using the PCIe interface, call axImagingCntrlPCIe() in the AxsunOCTCapture library.

Examples
AxsunOCTControl_LW_Test.cpp.

◆ axLibraryVersion()

AxErr axLibraryVersion ( uint32_t *  major,
uint32_t *  minor,
uint32_t *  patch,
uint32_t *  build 
)

Gets the library version.

Parameters
majorVersion number major element.
minorVersion number minor element.
patchVersion number patch element.
buildVersion number build element.
Returns
NO_AxERROR on success.
Examples
AxsunOCTControl_LW_Test.cpp.

◆ axMoveAbsVDL()

AxErr axMoveAbsVDL ( float  abs_position,
float  speed,
uint32_t  which_laser 
)

Move the VDL to an absolute position.

Parameters
abs_positionThe new desired position in mm.
speedThe speed at which to move in mm/sec (maximum =7.5).
which_laserThe numeric index of the desired Laser.
Returns
NO_AxERROR on success or other AxErr error code on failure.

◆ axMoveRelVDL()

AxErr axMoveRelVDL ( float  rel_position,
float  speed,
uint32_t  which_laser 
)

Move the VDL relative to its current position.

Parameters
rel_positionThe distance to move from the current position in mm.
speedThe speed at which to move in mm/sec (maximum =7.5).
which_laserThe numeric index of the desired Laser.
Returns
NO_AxERROR on success or other AxErr error code on failure.

◆ axNetworkInterfaceOpen()

AxErr axNetworkInterfaceOpen ( uint32_t  interface_status)

Opens, resets, or closes the Ethernet network interface.

Parameters
interface_status=1 opens the interface or resets an existing open interface, =0 closes the interface.
Returns
NO_AxERROR on success or other AxErr error code on failure.

When the interface is open, devices present on this interface will be detected, enumerated, and trigger the execution of a callback function registered using axRegisterConnectCallback(). Use this function if the interface was not opened automatically during the initial axOpenAxsunOCTControl() call.

Examples
AxsunOCTControl_LW_Test.cpp.

◆ axOpenAxsunOCTControl()

AxErr axOpenAxsunOCTControl ( uint32_t  open_all_interfaces)

Opens the AxsunOCTControl context for subsequent device communication.

Parameters
open_all_interfacesIf TRUE the USB and Ethernet interfaces will be started automatically. If FALSE no interfaces will be started.
Returns
NO_AxERROR on success or other AxErr error code on failure.

See C API Usage Guidelines on the Main Page for more information.

If interfaces are not opened at the time of this function call, they can be opened later using axNetworkInterfaceOpen(), axUSBInterfaceOpen(), or axSerialInterfaceOpen(). This allows the registration of the connect/disconnect callback function using axRegisterConnectCallback() prior to opening interfaces and gives the user individual control over which interface(s) to use.

Close an AxsunOCTControl context by calling axCloseAxsunOCTControl().

Examples
AxsunOCTControl_LW_Test.cpp.

◆ axReadDAQPHYRegister()

AxErr axReadDAQPHYRegister ( uint32_t  phynum,
uint32_t  regnum,
uint16_t *  regval,
uint32_t  which_DAQ 
)

Reads the current value in a DAQ PHY register.

Parameters
phynumThe PHY to read.
regnumThe PHY register number to read.
regvalThe value read back from the PHY register.
Returns
NO_AxERROR on success or other AxErr error code on failure.

This function is for Axsun internal use only.

◆ axRegisterConnectCallback()

AxErr axRegisterConnectCallback ( AxConnectCallbackFunctionC_t  callback_function,
void *  userData 
)

Registers a callback function to be executed following a device connection or disconnection event.

Parameters
callback_functionA user-supplied function to be called.
userDataAn arbitrary structure to be made available inside the callback function (or NULL if unused).
Returns
NO_AxERROR on success or other AxErr error code on failure.

The supplied callback function will be executed by a background thread when a new device is detected or when an existing device is disconnected. Within the callback function, access is provided to arbitrary user data passed as a void* parameter to this function.

Examples
AxsunOCTControl_LW_Test.cpp.

◆ axRegisterLabVIEWCallback()

AxErr axRegisterLabVIEWCallback ( LVUserEventRef *  refnumptr)

Registers a LabVIEW user event to be executed following a device connection or disconnection event.

Parameters
refnumptrA refnum pointer of a LabVIEW user event.
Returns
NO_AxERROR on success or other AxErr error code on failure.

LabVIEW code can be called directly from this library when a new device is detected or when an existing device is disconnected, similar to a C-based callback function registered using axRegisterConnectCallback(). See the AxsunOCTControl_LW LabVIEW example project and extcode.h header file (provided by National Instruments) for more details.

◆ axSerialInterfaceOpen()

AxErr axSerialInterfaceOpen ( uint32_t  interface_status,
char *  port 
)

Opens, resets, or closes a RS-232 serial interface on a given port.

Parameters
interface_status=1 opens an interface or resets an existing open interface, =0 closes an interface if a port is provided, or closes all interfaces if port is "" (empty string).
portNull-terminated char array describing the name of the port (e.g. typically "COM_" on Windows or "/dev/tty.___" on Linux/macOS)
Returns
NO_AxERROR on success or other AxErr error code on failure.

When the interface is open, a device present on this interface will be detected, enumerated, and trigger the execution of a callback function registered using axRegisterConnectCallback().

◆ axSerialNumber()

AxErr axSerialNumber ( char *  serial_number,
uint32_t  which_device 
)

Gets the device serial number string.

Parameters
serial_numberA char array pre-allocated with at least 40 bytes into which the device serial number will be copied as a null-terminated string.
which_deviceThe numeric index of the desired device.
Returns
NO_AxERROR on success or other AxErr error code on failure.
Examples
AxsunOCTControl_LW_Test.cpp.

◆ axSetClockDelay()

AxErr axSetClockDelay ( uint32_t  delay_code,
uint32_t  which_laser 
)

Sets the electronic K-clock delay.

Parameters
delay_codeA 6-bit code representing the desired delay value.
which_laserThe numeric index of the desired Laser.
Returns
NO_AxERROR on success or other AxErr error code on failure.

<TODO> SOME DETAILS HERE

◆ axSetDACTable()

AxErr axSetDACTable ( uint32_t  points,
uint32_t  speed,
uint32_t  timer1time,
uint32_t  timer2time,
uint32_t  timer1duration,
uint32_t  timer2duration,
uint16_t *  volts_currents,
uint32_t  which_laser 
)

Sets the DAC table.

Parameters
points
speed
timer1time
timer2time
timer1duration
timer2duration
currents
voltages
which_laserThe numeric index of the desired Laser.
Returns
NO_AxERROR on success or other AxErr error code on failure.

This function is for Axsun internal use only.

◆ axSetDriveConfiguration()

AxErr axSetDriveConfiguration ( uint32_t  which_config,
uint32_t  which_laser 
)

Selects a pre-programmed laser drive configuration.

Parameters
which_configThe desired configuration number (0, 1, 2, or 3).
which_laserThe numeric index of the desired Laser.
Returns
NO_AxERROR on success or other AxErr error code on failure.

Laser Engines must be programmed during manufacture to support multiple drive configurations. Contact Axsun technical support for more information.

◆ axSetEightBitGain()

AxErr axSetEightBitGain ( float  gain,
uint32_t  which_DAQ 
)

Set the GAIN term during 16- to 8-bit dynamic range compression.

Parameters
gainGain must be between 0 and 15.999756.
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

◆ axSetEightBitOffset()

AxErr axSetEightBitOffset ( float  offset,
uint32_t  which_DAQ 
)

Set the OFFSET term during 16- to 8-bit dynamic range compression.

Parameters
offsetOffset must be between -128.0 and 127.996094.
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

◆ axSetFPGADataArray()

AxErr axSetFPGADataArray ( const uint32_t  regnum,
const uint16_t *  data_array,
const uint32_t  number_of_words,
uint32_t  which_DAQ 
)

Sets (i.e. writes) a FPGA register with an array of multiple values.

Parameters
regnumThe FPGA register number in which to write.
data_arrayPointer to an array containing 16-bit values to be written.
number_of_wordsThe number of 16-bit register values pointed to by data_array.
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

◆ axSetFPGARegister()

AxErr axSetFPGARegister ( const uint32_t  regnum,
const uint16_t  regval,
uint32_t  which_DAQ 
)

Sets (i.e. writes) a FPGA register with a single value.

Parameters
regnumThe FPGA register number in which to write.
regvalThe value to be written.
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

◆ axSetFPGARegisterDefaults()

AxErr axSetFPGARegisterDefaults ( const uint16_t *  regnums,
const uint16_t *  regvals,
const uint32_t  count,
uint32_t  which_DAQ 
)

Sets (i.e. writes) a power-on default FPGA register configuration script, overwriting the existing script.

Parameters
regnumsPointer to an array containing 16-bit register numbers.
regvalsPointer to an array containing 16-bit register values.
countThe number of register number-value pairs to be written to the device.
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

regnums points to an array containing count register numbers and regvals points to an equal-sized array of corresponding register default values.

◆ axSetFPGARegisterSingleBit()

AxErr axSetFPGARegisterSingleBit ( const uint32_t  regnum,
const uint32_t  bitnum,
const uint32_t  value,
uint32_t  which_DAQ 
)

Sets or Clears a single bit in a FPGA register.

Parameters
regnumThe FPGA register number in which to set or clear a bit.
bitnumThe bit number in the interval [0..15] to set or clear.
value=1 to Set the bit, =0 to Clear the bit.
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

◆ axSetImageSyncSource()

AxErr axSetImageSyncSource ( AxEdgeSource  source,
float  frequency,
uint32_t  which_DAQ 
)

Select the Image_sync source.

Parameters
sourceThe desired Image_sync source. Must be either INTERNAL, LVCMOS, or LVDS.
frequencyThe Image_sync frequency (Hz); this parameter is optional and is ignored when source is not INTERNAL.
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

Use INTERNAL Image_sync source only for simulation and troubleshooting.

◆ axSetLaserEmission()

AxErr axSetLaserEmission ( uint32_t  emission_state,
uint32_t  which_laser 
)

Enables or disables laser emission.

Parameters
emission_state=1 enables laser emission, =0 disables laser emission.
which_laserThe numeric index of the desired Laser.
Returns
NO_AxERROR on success or other AxErr error code on failure.
Examples
AxsunOCTControl_LW_Test.cpp.

◆ axSetPipelineMode()

AxErr axSetPipelineMode ( AxPipelineMode  pipeline_mode,
uint32_t  which_DAQ 
)

Select the DAQ's pipeline mode (i.e. bypass mode).

Parameters
pipeline_modeThe desired pipeline mode.
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

Insure that A-line subsampling has been configured with SetSubsamplingFactor() prior to setting a pipeline mode which could saturate the data interface bandwidth if subsampling is insufficient.

◆ axSetPolarizationMode()

AxErr axSetPolarizationMode ( AxPolarizationMode  polarization_mode,
uint32_t  which_DAQ 
)

Select the DAQ's polarization channel configuration.

Parameters
polarization_modeThe desired polarization channel (HORIZONTAL, VERTICAL, or DIVERSE).
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

◆ axSetSampleClockSource()

AxErr axSetSampleClockSource ( AxEdgeSource  source,
uint32_t  which_DAQ 
)

Select the ADC sample clock source.

Parameters
sourceThe desired sample clock source. Must be either EXTERNAL (Laser k-clock) or INTERNAL (500 MS/s).
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

Use INTERNAL sample clock source only for simulation and troubleshooting.

◆ axSetSubsamplingFactor()

AxErr axSetSubsamplingFactor ( uint8_t  subsampling_factor,
uint32_t  which_DAQ 
)

Set the A-line subsampling factor.

Parameters
subsampling_factorSubsampling factor must be between 1 and 166.
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

◆ axSetSweepTriggerSource()

AxErr axSetSweepTriggerSource ( AxEdgeSource  source,
uint32_t  which_DAQ 
)

Select the sweep trigger source.

Parameters
sourceThe desired sweep trigger source. Must be either EXTERNAL (from Laser) or INTERNAL (100 kHz).
which_DAQThe numeric index of the desired DAQ.
Returns
NO_AxERROR on success or other AxErr error code on failure.

Use INTERNAL sweep trigger source only for simulation and troubleshooting.

◆ axSettingsToDevice()

AxErr axSettingsToDevice ( uint32_t  float_count,
uint32_t  int_count,
uint32_t  bool_count,
float *  float_values,
int32_t *  int_values,
uint8_t *  bool_values,
uint32_t  which_device 
)

Write device settings to non-volatile memory (i.e. flash).

Parameters
float_countThe number of floating point settings in the float_values array.
int_countThe number of integer settings in the int_values array.
bool_countThe number of boolean settings in the bool_values array.
float_valuesAn array of floating point setting values.
int_valuesAn array of integer setting values.
bool_valuesAn array of boolean setting values (1 = TRUE, 0 = FALSE).
which_deviceThe numeric index of the desired device.
Returns
NO_AxERROR on success or other AxErr error code on failure.

After reading all device setting values and names (using axCountDeviceSettings(), axGetFloatSetting(), axGetIntSetting(), and axGetBoolSetting()), original (i.e. unchanged) and new (i.e. changed or updated) settings are written back to the device's non-volatile memory with this function. Do NOT change the ordering or indexing of the device settings. The original values of unchanged settings must be written back to the device with the changed ones.

◆ axStopVDL()

AxErr axStopVDL ( uint32_t  which_laser)

Stops any VDL operation (e.g. move or home) currently in progress.

Parameters
which_laserThe numeric index of the desired Laser.
Returns
NO_AxERROR on success or other AxErr error code on failure.

◆ axUSBInterfaceOpen()

AxErr axUSBInterfaceOpen ( uint32_t  interface_status)

Opens, resets, or closes the USB interface.

Parameters
interface_status=1 opens the interface or resets an existing open interface, =0 closes the interface.
Returns
NO_AxERROR on success or other AxErr error code on failure.

When the interface is open, devices present on this interface will be detected, enumerated, and trigger the execution of a callback function registered using axRegisterConnectCallback(). Use this function if the interface was not opened automatically during the initial axOpenAxsunOCTControl() call.

Examples
AxsunOCTControl_LW_Test.cpp.