AxsunOCTControl_LW  0.9.2.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 2018 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 
35 typedef enum {
36  HORIZONTAL = 0,
37  VERTICAL = 1,
38  DIVERSE = 2
40 
41 typedef enum {
42  NONE = 0,
43  USB = 1,
45  RS232 = 3,
46  ETHERNET = 4
48 
49 typedef enum {
50  UNDEFINED = 0,
51  LASER = 40,
52  CLDAQ = 41,
53  EDAQ = 42
54 } AxDevType;
55 
57 typedef enum {
59  WARMING_UP = 1,
61  READY = 3,
65 } AxTECState;
66 
68 typedef void(__cdecl *AxConnectCallbackFunctionC_t)(void*);
69  EXPORT
77 void axGetErrorString(AxErr errornum, char* error_string);
78  EXPORT
88 AxErr axOpenAxsunOCTControl(uint32_t open_all_interfaces);
89  EXPORT
95  EXPORT
103 AxErr axNetworkInterfaceOpen(uint32_t interface_status);
104  EXPORT
112 AxErr axUSBInterfaceOpen(uint32_t interface_status);
113  EXPORT
122 AxErr axSerialInterfaceOpen(uint32_t interface_status, char* port);
123  EXPORT
132 AxErr axImagingCntrlEthernet(int16_t number_of_images, uint32_t which_DAQ);
133  EXPORT
143 AxErr axSetImageSyncSource(AxEdgeSource source, float frequency, uint32_t which_DAQ);
144  EXPORT
153 AxErr axSetSampleClockSource(AxEdgeSource source, uint32_t which_DAQ);
154  EXPORT
163 AxErr axSetSweepTriggerSource(AxEdgeSource source, uint32_t which_DAQ);
164  EXPORT
173 AxErr axSetPipelineMode(AxPipelineMode pipeline_mode, uint32_t which_DAQ);
174  EXPORT
182 AxErr axSetPolarizationMode(AxPolarizationMode polarization_mode, uint32_t which_DAQ);
183  EXPORT
191 AxErr axSetEightBitGain(float gain, uint32_t which_DAQ);
192  EXPORT
200 AxErr axSetEightBitOffset(float offset, uint32_t which_DAQ);
201  EXPORT
209 AxErr axSetSubsamplingFactor(uint8_t subsampling_factor, uint32_t which_DAQ);
210  EXPORT
219 AxErr axGetFPGARegister(const uint32_t regnum, uint16_t* regval, uint32_t which_DAQ);
220  EXPORT
232 AxErr axGetFPGARegisterRange(const uint32_t start_regnum, const uint32_t end_regnum, uint16_t* regvals, const uint32_t bytes_allocated, uint32_t which_DAQ);
233 
234  EXPORT
246 AxErr axGetFPGARegisterDefaults(uint32_t elements_allocated, uint16_t* regnums, uint16_t* regvals, uint32_t* elements_returned, uint32_t which_DAQ);
247 
248  EXPORT
259 AxErr axSetFPGARegisterDefaults(const uint16_t* regnums, const uint16_t* regvals, const uint32_t count, uint32_t which_DAQ);
260  EXPORT
269 AxErr axSetFPGARegister(const uint32_t regnum, const uint16_t regval, uint32_t which_DAQ);
270  EXPORT
280 AxErr axSetFPGARegisterSingleBit(const uint32_t regnum, const uint32_t bitnum, const uint32_t value, uint32_t which_DAQ);
281  EXPORT
291 AxErr axSetFPGADataArray(const uint32_t regnum, const uint16_t* data_array, const uint32_t number_of_words, uint32_t which_DAQ);
292  EXPORT
302 AxErr axReadDAQPHYRegister(uint32_t phynum, uint32_t regnum, uint16_t* regval, uint32_t which_DAQ);
303  EXPORT
312 AxErr axConnectionHeartbeat(uint32_t heartbeat_state, uint32_t which_device);
313  EXPORT
325 AxErr axDebugCommand(uint32_t command_number, uint32_t value_out, uint32_t* command_in, uint32_t* value_in, uint32_t which_device);
326  EXPORT
336 AxErr axFirmwareVersion(uint32_t* major, uint32_t* minor, uint32_t* patch, uint32_t which_device);
337  EXPORT
349 AxErr axFPGAVersion(uint32_t* major, uint32_t* minor, uint32_t* patch, uint32_t* build, uint32_t which_device);
350  EXPORT
360 AxErr axLibraryVersion(uint32_t* major, uint32_t* minor, uint32_t* patch, uint32_t* build);
361  EXPORT
369 AxErr axDeviceType(AxDevType * device_type, uint32_t which_device);
370  EXPORT
378 AxErr axSerialNumber(char * serial_number, uint32_t which_device);
379  EXPORT
387 AxErr axConnectionType(AxConnectionType * connection_type, uint32_t which_device);
388  EXPORT
398 AxErr axCountDeviceSettings(uint32_t* float_count, uint32_t* int_count, uint32_t* bool_count, uint32_t which_device);
399  EXPORT
410 AxErr axGetFloatSetting(uint32_t which_setting, float* setting_value, char * setting_string, uint32_t which_device);
411  EXPORT
422 AxErr axGetIntSetting(uint32_t which_setting, int32_t* setting_value, char * setting_string, uint32_t which_device);
423  EXPORT
434 AxErr axGetBoolSetting(uint32_t which_setting, uint8_t* setting_value, char * setting_string, uint32_t which_device);
435  EXPORT
449 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);
450  EXPORT
457 uint32_t axCountConnectedDevices();
458  EXPORT
466 AxErr axSetLaserEmission(uint32_t emission_state, uint32_t which_laser);
467  EXPORT
474  AxErr axGetLaserEmission(uint32_t* emitting, uint32_t which_laser);
475  EXPORT
484 AxErr axSetClockDelay(uint32_t delay_code, uint32_t which_laser);
485  EXPORT
493 AxErr axGetClockDelay(uint32_t* delay_code, uint32_t which_laser);
494  EXPORT
502 AxErr axHomeVDL(uint32_t which_laser);
503  EXPORT
510 AxErr axStopVDL(uint32_t which_laser);
511  EXPORT
520 AxErr axMoveRelVDL(float rel_position, float speed, uint32_t which_laser);
521  EXPORT
530 AxErr axMoveAbsVDL(float abs_position, float speed, uint32_t which_laser);
531  EXPORT
554 AxErr axGetVDLStatus(float* current_pos, float* target_pos, float* speed,
555  int32_t* error_from_last_home, uint32_t* last_move_time,
556  uint8_t* state, uint8_t* home_switch, uint8_t* limit_switch, uint8_t* VDL_error, uint32_t which_laser);
557  EXPORT
567 AxErr axGetTECState(AxTECState* TEC_state, uint32_t which_TEC, uint32_t which_laser);
568  EXPORT
584 AxErr axSetDACTable(uint32_t points, uint32_t speed, uint32_t timer1time, uint32_t timer2time,
585  uint32_t timer1duration, uint32_t timer2duration, uint16_t* volts_currents, uint32_t which_laser);
586  EXPORT
602 AxErr axGetDACTable(uint32_t* points, uint32_t* speed, uint32_t* timer1time, uint32_t* timer2time,
603  uint32_t* timer1duration, uint32_t* timer2duration, uint16_t* volts_currents, uint32_t which_laser);
604  EXPORT
613 AxErr axSetDriveConfiguration(uint32_t which_config, uint32_t which_laser);
614  EXPORT
623 AxErr axGetDriveConfiguration(uint32_t * current_configuration, uint32_t which_laser);
624  EXPORT
633 AxErr axRegisterConnectCallback(AxConnectCallbackFunctionC_t callback_function, void * userData);
634 
635 #ifdef LabVIEW_CALLBACK
636  EXPORT
643 AxErr axRegisterLabVIEWCallback(LVUserEventRef* refnumptr);
644 #endif
645 
646 #ifdef __cplusplus
647 } // end extern "C"
648 #endif // __cplusplus
649 
650 #endif /* End header include guard */
651 
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.
AxErr axSetImageSyncSource(AxEdgeSource source, float frequency, uint32_t which_DAQ)
Select the Image_sync source.
AxErr axNetworkInterfaceOpen(uint32_t interface_status)
Opens, resets, or closes the Ethernet network interface.
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:68
Definition: AxsunOCTControl_LW_C.h:61
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...
Definition: AxsunOCTControl_LW_C.h:30
AxErr axSetLaserEmission(uint32_t emission_state, uint32_t which_laser)
Enables or disables laser emission.
AxErr axSetDriveConfiguration(uint32_t which_config, uint32_t which_laser)
Selects a pre-programmed laser drive configuration.
AxErr axMoveAbsVDL(float abs_position, float speed, uint32_t which_laser)
Move the VDL to an absolute position.
AxErr axLibraryVersion(uint32_t *major, uint32_t *minor, uint32_t *patch, uint32_t *build)
Gets the library version.
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.
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.
Definition: AxsunOCTControl_LW_C.h:38
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.
AxErr axReadDAQPHYRegister(uint32_t phynum, uint32_t regnum, uint16_t *regval, uint32_t which_DAQ)
Reads the current value in a DAQ PHY register.
AxConnectionType
Definition: AxsunOCTControl_LW_C.h:41
AxErr axGetClockDelay(uint32_t *delay_code, uint32_t which_laser)
Gets the currently configured electronic K-clock delay.
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...
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.
AxErr axSetSampleClockSource(AxEdgeSource source, uint32_t which_DAQ)
Select the ADC sample clock source.
Definition: AxsunOCTControl_LW_C.h:63
AxErr axSetEightBitOffset(float offset, uint32_t which_DAQ)
Set the OFFSET term during 16- to 8-bit dynamic range compression.
AxErr axSetClockDelay(uint32_t delay_code, uint32_t which_laser)
Sets the electronic K-clock delay.
Definition: AxsunOCTControl_LW_C.h:29
void axGetErrorString(AxErr errornum, char *error_string)
Gets a string which explains an error code in a more verbose fashion.
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.
AxDevType
Definition: AxsunOCTControl_LW_C.h:49
Definition: AxsunOCTControl_LW_C.h:52
AxErr
Error codes returned from AxsunOCTCapture or AxsunOCTControl_LW functions. Use axGetErrorString() for...
Definition: AxsunCommonEnums.h:23
Definition: AxsunOCTControl_LW_C.h:59
AxErr axCloseAxsunOCTControl()
Closes an AxsunOCTControl context previously opened with axOpenAxsunOCTControl().
AxErr axOpenAxsunOCTControl(uint32_t open_all_interfaces)
Opens the AxsunOCTControl context for subsequent device communication.
Definition: AxsunOCTControl_LW_C.h:62
AxErr axSetSweepTriggerSource(AxEdgeSource source, uint32_t which_DAQ)
Select the sweep trigger source.
Definition: AxsunOCTControl_LW_C.h:31
AxErr axStopVDL(uint32_t which_laser)
Stops any VDL operation (e.g. move or home) currently in progress.
AxPolarizationMode
DAQ polarization modes.
Definition: AxsunOCTControl_LW_C.h:35
AxErr axHomeVDL(uint32_t which_laser)
Starts the VDL home operation.
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...
AxErr axGetDriveConfiguration(uint32_t *current_configuration, uint32_t which_laser)
Gets the currently selected drive configuration.
AxErr axSetEightBitGain(float gain, uint32_t which_DAQ)
Set the GAIN term during 16- to 8-bit dynamic range compression.
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,...
AxErr axSetSubsamplingFactor(uint8_t subsampling_factor, uint32_t which_DAQ)
Set the A-line subsampling factor.
AxErr axDeviceType(AxDevType *device_type, uint32_t which_device)
Gets the device type (e.g. Laser, EDAQ).
Definition: AxsunOCTControl_LW_C.h:44
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.
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.
Definition: AxsunOCTControl_LW_C.h:58
AxErr axRegisterLabVIEWCallback(LVUserEventRef *refnumptr)
Registers a LabVIEW user event to be executed following a device connection or disconnection event.
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.
Definition: AxsunOCTControl_LW_C.h:28
AxErr axSetPipelineMode(AxPipelineMode pipeline_mode, uint32_t which_DAQ)
Select the DAQ's pipeline mode (i.e. bypass mode).
This header file contains enums and other definitions for integrating AxsunOCTCapture....
uint32_t axCountConnectedDevices()
Counts the number of devices successfully connected and enumerated by AxsunOCTControl.
AxErr axRegisterConnectCallback(AxConnectCallbackFunctionC_t callback_function, void *userData)
Registers a callback function to be executed following a device connection or disconnection event.
Definition: AxsunOCTControl_LW_C.h:51
Definition: AxsunOCTControl_LW_C.h:37
AxErr axGetFPGARegister(const uint32_t regnum, uint16_t *regval, uint32_t which_DAQ)
Gets (i.e. reads) the current value in a FPGA register.
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).
AxErr axUSBInterfaceOpen(uint32_t interface_status)
Opens, resets, or closes the USB interface.
AxErr axGetTECState(AxTECState *TEC_state, uint32_t which_TEC, uint32_t which_laser)
Gets the current state of a Laser Thermo-Electric Cooler (TEC).
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.
AxErr axSerialInterfaceOpen(uint32_t interface_status, char *port)
Opens, resets, or closes a RS-232 serial interface on a given port.
AxErr axMoveRelVDL(float rel_position, float speed, uint32_t which_laser)
Move the VDL relative to its current position.
AxTECState
Laser TEC states.
Definition: AxsunOCTControl_LW_C.h:57
Definition: AxsunOCTControl_LW_C.h:60
Definition: AxsunOCTControl_LW_C.h:64
AxErr axSerialNumber(char *serial_number, uint32_t which_device)
Gets the device serial number string.
AxEdgeSource
DAQ clock and trigger sources.
Definition: AxsunOCTControl_LW_C.h:27
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.
AxErr axFirmwareVersion(uint32_t *major, uint32_t *minor, uint32_t *patch, uint32_t which_device)
Gets the device firmware version.
Definition: AxsunOCTControl_LW_C.h:36
Definition: AxsunOCTControl_LW_C.h:45
Definition: AxsunOCTControl_LW_C.h:43
AxErr axGetLaserEmission(uint32_t *emitting, uint32_t which_laser)
Gets laser emission status.
AxPipelineMode
DAQ pipeline modes.
Definition: AxsunCommonEnums.h:166
Definition: AxsunOCTControl_LW_C.h:53
AxErr axSetPolarizationMode(AxPolarizationMode polarization_mode, uint32_t which_DAQ)
Select the DAQ's polarization channel configuration.
AxErr axConnectionType(AxConnectionType *connection_type, uint32_t which_device)
Gets the device connection interface (e.g. USB, Ethernet, RS-232).
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.
Definition: AxsunOCTControl_LW_C.h:46
AxErr axFPGAVersion(uint32_t *major, uint32_t *minor, uint32_t *patch, uint32_t *build, uint32_t which_device)
Gets the device FPGA version.