AxsunOCTControl_LW  1.0.0.0
A light-weight & cross-platform alternative to the .NET-based AxsunOCTControl.dll.
AxsunOCTControl_LW_C.h
Go to the documentation of this file.
1 // AxsunOCTControl_LW_C.h
2 // Copyright 2020 Axsun Technologies
3 
10 #ifndef AXSUNOCTCONTROLLW_C_H
11 #define AXSUNOCTCONTROLLW_C_H
12 
13 #include "AxsunCommonEnums.h"
14 
15 #ifdef LabVIEW_CALLBACK
16 #include "extcode.h" // only required for LabVIEW callback integration
17 #endif
18 
19 #ifdef __cplusplus
20 #include <cstdint>
21 extern "C" {
22 #else
23 #include <stdint.h>
24 #endif // __cplusplus
25 
27 typedef enum {
28  EXTERNAL = 0,
29  INTERNAL = 1,
30  LVDS = 2,
31  LVCMOS = 3,
32 } AxEdgeSource;
33 
34 typedef enum {
35  NONE = 0,
36  USB = 1,
38  RS232 = 3,
39  ETHERNET = 4
41 
42 typedef enum {
43  UNDEFINED = 0,
44  LASER = 40,
45  CLDAQ = 41,
46  EDAQ = 42
48 
50 typedef enum {
52  WARMING_UP = 1,
54  READY = 3,
59 
61 typedef void(__cdecl *AxConnectCallbackFunctionC_t)(void*);
62  AXSUN_EXPORTS
70 void axGetErrorExplained(AxErr errornum, char* error_string);
71  AXSUN_EXPORTS
81 AxErr axOpenAxsunOCTControl(uint32_t open_all_interfaces);
82  AXSUN_EXPORTS
88  AXSUN_EXPORTS
96 AxErr axNetworkInterfaceOpen(uint32_t interface_status);
97  AXSUN_EXPORTS
105 AxErr axUSBInterfaceOpen(uint32_t interface_status);
106  AXSUN_EXPORTS
115 AxErr axSerialInterfaceOpen(uint32_t interface_status, char* port);
116  AXSUN_EXPORTS
125 AxErr axImagingCntrlEthernet(int16_t number_of_images, uint32_t which_DAQ);
126  AXSUN_EXPORTS
136 AxErr axSetImageSyncSource(AxEdgeSource source, float frequency, uint32_t which_DAQ);
137  AXSUN_EXPORTS
146 AxErr axSetSampleClockSource(AxEdgeSource source, uint32_t which_DAQ);
147  AXSUN_EXPORTS
156 AxErr axSetSweepTriggerSource(AxEdgeSource source, uint32_t which_DAQ);
157  AXSUN_EXPORTS
167 AxErr axSetPipelineMode(AxPipelineMode pipeline_mode, AxChannelMode polarization_mode, uint32_t which_DAQ);
168  AXSUN_EXPORTS
176 AxErr axSetEightBitGain(float gain, uint32_t which_DAQ);
177  AXSUN_EXPORTS
185 AxErr axSetEightBitOffset(float offset, uint32_t which_DAQ);
186  AXSUN_EXPORTS
194 AxErr axSetSubsamplingFactor(uint8_t subsampling_factor, uint32_t which_DAQ);
195  AXSUN_EXPORTS
204 AxErr axGetFPGARegister(const uint32_t regnum, uint16_t* regval, uint32_t which_DAQ);
205  AXSUN_EXPORTS
217 AxErr axGetFPGARegisterRange(const uint32_t start_regnum, const uint32_t end_regnum, uint16_t* regvals, const uint32_t bytes_allocated, uint32_t which_DAQ);
218 
219  AXSUN_EXPORTS
231 AxErr axGetFPGARegisterDefaults(uint32_t elements_allocated, uint16_t* regnums, uint16_t* regvals, uint32_t* elements_returned, uint32_t which_DAQ);
232 
233  AXSUN_EXPORTS
244 AxErr axSetFPGARegisterDefaults(const uint16_t* regnums, const uint16_t* regvals, const uint32_t count, uint32_t which_DAQ);
245  AXSUN_EXPORTS
254 AxErr axSetFPGARegister(const uint32_t regnum, const uint16_t regval, uint32_t which_DAQ);
255  AXSUN_EXPORTS
265 AxErr axSetFPGARegisterMasked(const uint32_t regnum, const uint16_t regval, const uint16_t bitmask, uint32_t which_DAQ);
266  AXSUN_EXPORTS
276 AxErr axSetFPGARegisterSingleBit(const uint32_t regnum, const uint32_t which_bit, const uint32_t value, uint32_t which_DAQ);
277  AXSUN_EXPORTS
287 AxErr axSetFPGARegisterSingleByte(const uint32_t regnum, const uint32_t which_byte, const uint32_t value, uint32_t which_DAQ);
288  AXSUN_EXPORTS
298 AxErr axSetFPGARegisterSingleNibble(const uint32_t regnum, const uint32_t which_nibble, const uint32_t value, uint32_t which_DAQ);
299  AXSUN_EXPORTS
309 AxErr axSetFPGADataArray(const uint32_t regnum, const uint16_t* data_array, const uint32_t number_of_words, uint32_t which_DAQ);
310  AXSUN_EXPORTS
320 AxErr axReadDAQPHYRegister(uint32_t phynum, uint32_t regnum, uint16_t* regval, uint32_t which_DAQ);
321  AXSUN_EXPORTS
330 AxErr axConnectionHeartbeat(uint32_t heartbeat_state, uint32_t which_device);
331  AXSUN_EXPORTS
343 AxErr axDebugCommand(uint32_t command_number, uint32_t value_out, uint32_t* command_in, uint32_t* value_in, uint32_t which_device);
344  AXSUN_EXPORTS
354 AxErr axFirmwareVersion(uint32_t* major, uint32_t* minor, uint32_t* patch, uint32_t which_device);
355  AXSUN_EXPORTS
367 AxErr axFPGAVersion(uint32_t* major, uint32_t* minor, uint32_t* patch, uint32_t* build, uint32_t which_device);
368  AXSUN_EXPORTS
378 AxErr axLibraryVersion(uint32_t* major, uint32_t* minor, uint32_t* patch, uint32_t* build);
379  AXSUN_EXPORTS
387 AxErr axDeviceType(AxDevType * device_type, uint32_t which_device);
388  AXSUN_EXPORTS
396 AxErr axSerialNumber(char * serial_number, uint32_t which_device);
397  AXSUN_EXPORTS
405 AxErr axConnectionType(AxConnectionType * connection_type, uint32_t which_device);
406  AXSUN_EXPORTS
416 AxErr axCountDeviceSettings(uint32_t* float_count, uint32_t* int_count, uint32_t* bool_count, uint32_t which_device);
417  AXSUN_EXPORTS
428 AxErr axGetFloatSetting(uint32_t which_setting, float* setting_value, char * setting_string, uint32_t which_device);
429  AXSUN_EXPORTS
440 AxErr axGetIntSetting(uint32_t which_setting, int32_t* setting_value, char * setting_string, uint32_t which_device);
441  AXSUN_EXPORTS
452 AxErr axGetBoolSetting(uint32_t which_setting, uint8_t* setting_value, char * setting_string, uint32_t which_device);
453  AXSUN_EXPORTS
467 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);
468  AXSUN_EXPORTS
476  AXSUN_EXPORTS
484 AxErr axSetLaserEmission(uint32_t emission_state, uint32_t which_laser);
485  AXSUN_EXPORTS
492 AxErr axGetLaserEmission(uint32_t* emitting, uint32_t which_laser);
493  AXSUN_EXPORTS
501 AxErr axSetPointerEmission(uint32_t emission_state, uint32_t which_laser);
502  AXSUN_EXPORTS
509 AxErr axGetPointerEmission(uint32_t* emitting, uint32_t which_laser);
510  AXSUN_EXPORTS
519 AxErr axSetClockDelay(uint32_t delay_code, uint32_t which_laser);
520  AXSUN_EXPORTS
528 AxErr axGetClockDelay(uint32_t* delay_code, uint32_t which_laser);
529  AXSUN_EXPORTS
537 AxErr axHomeVDL(uint32_t which_laser);
538  AXSUN_EXPORTS
545 AxErr axStopVDL(uint32_t which_laser);
546  AXSUN_EXPORTS
555 AxErr axMoveRelVDL(float rel_position, float speed, uint32_t which_laser);
556  AXSUN_EXPORTS
565 AxErr axMoveAbsVDL(float abs_position, float speed, uint32_t which_laser);
566  AXSUN_EXPORTS
589 AxErr axGetVDLStatus(float* current_pos, float* target_pos, float* speed,
590  int32_t* error_from_last_home, uint32_t* last_move_time,
591  uint8_t* state, uint8_t* home_switch, uint8_t* limit_switch, uint8_t* VDL_error, uint32_t which_laser);
592  AXSUN_EXPORTS
602 AxErr axGetTECState(AxTECState* TEC_state, uint32_t which_TEC, uint32_t which_laser);
603  AXSUN_EXPORTS
619 AxErr axSetDACTable(uint32_t points, uint32_t speed, uint32_t timer1time, uint32_t timer2time,
620  uint32_t timer1duration, uint32_t timer2duration, uint16_t* volts_currents, uint32_t save_to_flash, uint32_t which_laser);
621  AXSUN_EXPORTS
636 AxErr axGetDACTable(uint32_t* points, uint32_t* speed, uint32_t* timer1time, uint32_t* timer2time,
637  uint32_t* timer1duration, uint32_t* timer2duration, uint16_t* volts_currents, uint32_t which_laser);
638  AXSUN_EXPORTS
647 AxErr axSetDriveConfiguration(uint32_t which_config, uint32_t which_laser);
648  AXSUN_EXPORTS
657 AxErr axGetDriveConfiguration(uint32_t * current_configuration, uint32_t which_laser);
658  AXSUN_EXPORTS
668 
669 #ifdef LabVIEW_CALLBACK
670  AXSUN_EXPORTS
677 AxErr axRegisterLabVIEWCallback(LVUserEventRef* refnumptr);
678 #endif
679 
680 #ifdef __cplusplus
681 } // end extern "C"
682 #endif // __cplusplus
683 
684 #endif /* End header include guard */
685 
axSetFPGARegisterSingleByte
AxErr axSetFPGARegisterSingleByte(const uint32_t regnum, const uint32_t which_byte, const uint32_t value, uint32_t which_DAQ)
Sets (i.e. writes) the low or high byte of an FPGA register, leaving the other byte unchanged.
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).
axRegisterConnectCallback
AxErr axRegisterConnectCallback(AxConnectCallbackFunctionC_t callback_function, void *userData)
Registers a callback function to be executed following a device connection or disconnection event.
LVCMOS
@ LVCMOS
Definition: AxsunOCTControl_LW_C.h:31
EXTERNAL
@ EXTERNAL
Definition: AxsunOCTControl_LW_C.h:28
axOpenAxsunOCTControl
AxErr axOpenAxsunOCTControl(uint32_t open_all_interfaces)
Opens the AxsunOCTControl context for subsequent device communication.
axSetFPGARegisterSingleNibble
AxErr axSetFPGARegisterSingleNibble(const uint32_t regnum, const uint32_t which_nibble, const uint32_t value, uint32_t which_DAQ)
Sets (i.e. writes) one nibble (4 bits) of an FPGA register, leaving the other 12 bits unchanged.
TEC_UNINITIALIZED
@ TEC_UNINITIALIZED
Definition: AxsunOCTControl_LW_C.h:51
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.
axUSBInterfaceOpen
AxErr axUSBInterfaceOpen(uint32_t interface_status)
Opens, resets, or closes the USB interface.
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.
axSerialInterfaceOpen
AxErr axSerialInterfaceOpen(uint32_t interface_status, char *port)
Opens, resets, or closes a RS-232 serial interface on a given port.
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.
USB
@ USB
Definition: AxsunOCTControl_LW_C.h:36
axFirmwareVersion
AxErr axFirmwareVersion(uint32_t *major, uint32_t *minor, uint32_t *patch, uint32_t which_device)
Gets the device firmware version.
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.
LASER
@ LASER
Definition: AxsunOCTControl_LW_C.h:44
axSetEightBitGain
AxErr axSetEightBitGain(float gain, uint32_t which_DAQ)
Set the GAIN term during 16- to 8-bit dynamic range compression.
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.
axSetPointerEmission
AxErr axSetPointerEmission(uint32_t emission_state, uint32_t which_laser)
Enables or disables pointer/aiming laser emission.
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.
AxChannelMode
AxChannelMode
DAQ channel selection modes.
Definition: AxsunCommonEnums.h:211
ETHERNET
@ ETHERNET
Definition: AxsunOCTControl_LW_C.h:39
axCountConnectedDevices
uint32_t axCountConnectedDevices()
Counts the number of devices successfully connected and enumerated by AxsunOCTControl.
RS232_PASSTHROUGH
@ RS232_PASSTHROUGH
Definition: AxsunOCTControl_LW_C.h:37
axRegisterLabVIEWCallback
AxErr axRegisterLabVIEWCallback(LVUserEventRef *refnumptr)
Registers a LabVIEW user event to be executed following a device connection or disconnection event.
ERROR_WENT_OUT_OF_RANGE
@ ERROR_WENT_OUT_OF_RANGE
Definition: AxsunOCTControl_LW_C.h:57
axSetImageSyncSource
AxErr axSetImageSyncSource(AxEdgeSource source, float frequency, uint32_t which_DAQ)
Select the Image_sync source.
axLibraryVersion
AxErr axLibraryVersion(uint32_t *major, uint32_t *minor, uint32_t *patch, uint32_t *build)
Gets the library version.
AxConnectCallbackFunctionC_t
void(__cdecl * AxConnectCallbackFunctionC_t)(void *)
Type defintion for a user-provided function to be called upon connection or disconnection of a device...
Definition: AxsunOCTControl_LW_C.h:61
axGetPointerEmission
AxErr axGetPointerEmission(uint32_t *emitting, uint32_t which_laser)
Gets pointer/aiminglaser emission status.
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).
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.
READY
@ READY
Definition: AxsunOCTControl_LW_C.h:54
axMoveRelVDL
AxErr axMoveRelVDL(float rel_position, float speed, uint32_t which_laser)
Move the VDL relative to its current position.
LVDS
@ LVDS
Definition: AxsunOCTControl_LW_C.h:30
RS232
@ RS232
Definition: AxsunOCTControl_LW_C.h:38
axSerialNumber
AxErr axSerialNumber(char *serial_number, uint32_t which_device)
Gets the device serial number string.
AxEdgeSource
AxEdgeSource
DAQ clock and trigger sources.
Definition: AxsunOCTControl_LW_C.h:27
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 Ether...
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.
AxsunCommonEnums.h
This header file contains enums and other definitions for integrating AxsunOCTCapture....
AxPipelineMode
AxPipelineMode
DAQ pipeline modes.
Definition: AxsunCommonEnums.h:193
axSetSampleClockSource
AxErr axSetSampleClockSource(AxEdgeSource source, uint32_t which_DAQ)
Select the ADC sample clock source.
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.
AxTECState
AxTECState
Laser TEC states.
Definition: AxsunOCTControl_LW_C.h:50
axSetClockDelay
AxErr axSetClockDelay(uint32_t delay_code, uint32_t which_laser)
Sets the electronic K-clock delay.
axGetClockDelay
AxErr axGetClockDelay(uint32_t *delay_code, uint32_t which_laser)
Gets the currently configured electronic K-clock delay.
AxDevType
AxDevType
Definition: AxsunOCTControl_LW_C.h:42
WAITING_IN_RANGE
@ WAITING_IN_RANGE
Definition: AxsunOCTControl_LW_C.h:53
axSetPipelineMode
AxErr axSetPipelineMode(AxPipelineMode pipeline_mode, AxChannelMode polarization_mode, uint32_t which_DAQ)
Select the DAQ's pipeline mode (i.e. bypass mode) and polarization channel configuration.
axCloseAxsunOCTControl
AxErr axCloseAxsunOCTControl()
Closes an AxsunOCTControl context previously opened with axOpenAxsunOCTControl().
axGetLaserEmission
AxErr axGetLaserEmission(uint32_t *emitting, uint32_t which_laser)
Gets swept laser emission status.
axSetFPGARegisterSingleBit
AxErr axSetFPGARegisterSingleBit(const uint32_t regnum, const uint32_t which_bit, const uint32_t value, uint32_t which_DAQ)
Sets or Clears a single bit in a FPGA register.
axConnectionType
AxErr axConnectionType(AxConnectionType *connection_type, uint32_t which_device)
Gets the device connection interface (e.g. USB, Ethernet, RS-232).
axNetworkInterfaceOpen
AxErr axNetworkInterfaceOpen(uint32_t interface_status)
Opens, resets, or closes the Ethernet network interface.
EDAQ
@ EDAQ
Definition: AxsunOCTControl_LW_C.h:46
WARMING_UP
@ WARMING_UP
Definition: AxsunOCTControl_LW_C.h:52
axSetFPGARegisterMasked
AxErr axSetFPGARegisterMasked(const uint32_t regnum, const uint16_t regval, const uint16_t bitmask, uint32_t which_DAQ)
Sets (i.e. writes) FPGA register bits based on a bitmask.
axHomeVDL
AxErr axHomeVDL(uint32_t which_laser)
Starts the VDL home operation.
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 numb...
axFPGAVersion
AxErr axFPGAVersion(uint32_t *major, uint32_t *minor, uint32_t *patch, uint32_t *build, uint32_t which_device)
Gets the device FPGA version.
axGetDriveConfiguration
AxErr axGetDriveConfiguration(uint32_t *current_configuration, uint32_t which_laser)
Gets the currently selected drive configuration.
axMoveAbsVDL
AxErr axMoveAbsVDL(float abs_position, float speed, uint32_t which_laser)
Move the VDL to an absolute position.
AxErr
AxErr
Error codes returned from AxsunOCTCapture or AxsunOCTControl_LW functions. Use axGetErrorString() in ...
Definition: AxsunCommonEnums.h:34
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.
CLDAQ
@ CLDAQ
Definition: AxsunOCTControl_LW_C.h:45
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 sc...
axSetSweepTriggerSource
AxErr axSetSweepTriggerSource(AxEdgeSource source, uint32_t which_DAQ)
Select the sweep trigger source.
axStopVDL
AxErr axStopVDL(uint32_t which_laser)
Stops any VDL operation (e.g. move or home) currently in progress.
axDeviceType
AxErr axDeviceType(AxDevType *device_type, uint32_t which_device)
Gets the device type (e.g. Laser, EDAQ).
INTERNAL
@ INTERNAL
Definition: AxsunOCTControl_LW_C.h:29
axSetLaserEmission
AxErr axSetLaserEmission(uint32_t emission_state, uint32_t which_laser)
Enables or disables swept laser emission.
axSetDriveConfiguration
AxErr axSetDriveConfiguration(uint32_t which_config, uint32_t which_laser)
Selects a pre-programmed laser drive configuration.
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.
AxConnectionType
AxConnectionType
Definition: AxsunOCTControl_LW_C.h:34
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 save_to_flash, uint32_t which_laser)
Sets the DAC table.
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,...
axGetErrorExplained
void axGetErrorExplained(AxErr errornum, char *error_string)
Gets a string which explains an error code in a more verbose fashion.
axSetSubsamplingFactor
AxErr axSetSubsamplingFactor(uint8_t subsampling_factor, uint32_t which_DAQ)
Set the A-line subsampling factor.
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.
ERROR_NEVER_GOT_TO_READY
@ ERROR_NEVER_GOT_TO_READY
Definition: AxsunOCTControl_LW_C.h:56
NOT_INSTALLED
@ NOT_INSTALLED
Definition: AxsunOCTControl_LW_C.h:55
axSetEightBitOffset
AxErr axSetEightBitOffset(float offset, uint32_t which_DAQ)
Set the OFFSET term during 16- to 8-bit dynamic range compression.