|
Wasatch.VCPP 1.0.19
Visual C++ driver for Wasatch Photonics spectrometers
|
Declaration of the flattened C API exported by WasatchVCPP.dll. More...
#include <vector>#include <string>#include <map>Go to the source code of this file.
Classes | |
| class | WasatchVCPP::Proxy::Spectrometer |
| A proxy customer-facing class providing an object-oriented / STL-based interface to command and control an individual Spectrometer. More... | |
| class | WasatchVCPP::Proxy::Driver |
| A proxy customer-facing class providing an object-oriented / STL-based interface to command and control the WasatchVCPP library. More... | |
Namespaces | |
| namespace | WasatchVCPP |
| Namespace encapsulating the internal implementation of WasatchVCPP; customers would not normally access these classes or objects directly. | |
| namespace | WasatchVCPP::Proxy |
| provides object-oriented Driver and Spectrometer C++ classes on the client (caller) side | |
Functions | |
| DLL_API int | wp_set_logfile_path (const char *pathname, int len) |
| Sets a pathname for WasatchVCPP to write a debug logfile. More... | |
| DLL_API int | wp_set_log_level (int level) |
| Sets driver log level. More... | |
| DLL_API int | wp_log_debug (const char *msg, int len) |
| Allows calling code (and wrappers) to inject lines into the library's log. More... | |
| DLL_API int | wp_get_library_version (char *value, int len) |
| Obtains the version number of the WasatchVCPP library itself. More... | |
| DLL_API int | wp_get_vignetted_spectrum_length (int specIndex) |
| DLL_API int | wp_apply_raman_intensity_factors (int specIndex, double *spectrum, int spectrum_len, double *factors, int factors_len, int start_pixel, int end_pixel) |
| DLL_API int | wp_has_srm_calibration (int specIndex) |
| DLL_API int | wp_get_raman_intensity_factors (int specIndex, double *factors, int factorsLen) |
| DLL_API int | wp_open_all_spectrometers () |
| Connects to and initializes all enumerated USB spectrometers. More... | |
| DLL_API int | wp_get_number_of_spectrometers () |
| Returns number of spectrometers previously opened. More... | |
| DLL_API int | wp_close_all_spectrometers () |
| Closes all connected spectrometers. More... | |
| DLL_API int | wp_close_spectrometer (int specIndex) |
| Closes the specified spectrometer. More... | |
| DLL_API void | wp_destroy_driver () |
| Permanently releases all objects from memory. More... | |
| DLL_API int | wp_get_eeprom_field_count (int specIndex) |
| This is provided so the caller can correctly size the 'names' and 'values' arrays for a call to wp_get_eeprom(). More... | |
| DLL_API int | wp_get_eeprom_field_name (int specIndex, int index, char *value, int len) |
| Obtain the nth ordered EEPROM field name. More... | |
| DLL_API int | wp_get_eeprom (int specIndex, const char **names, const char **values, int len) |
| Read a table of all EEPROM fields, as strings. More... | |
| DLL_API int | wp_get_eeprom_page (int specIndex, int page, unsigned char *buf, int len) |
| Read one page of the EEPROM in raw binary form. More... | |
| DLL_API int | wp_write_eeprom_page (int specIndex, int pageIndex, unsigned char *data, int dataLen) |
| DLL_API int | wp_get_eeprom_field (int specIndex, const char *name, char *value, int len) |
| Read one stringified EEPROM field by name. More... | |
| DLL_API int | wp_get_pixels (int specIndex) |
| Returns the number of pixels in the selected spectrometer.o. More... | |
| DLL_API int | wp_get_model (int specIndex, char *value, int len) |
| Get the selected spectrometer's model. More... | |
| DLL_API int | wp_get_serial_number (int specIndex, char *value, int len) |
| Get the selected spectrometer's serial number. More... | |
| DLL_API int | wp_get_wavelengths (int specIndex, double *wavelengths, int len) |
| Get the selected spectrometer's calibrated wavelength x-axis in nanometers. More... | |
| DLL_API int | wp_get_wavelengths_float (int specIndex, float *wavelengths, int len) |
| Get the selected spectrometer's calibrated wavelength x-axis in nanometers as float. More... | |
| DLL_API int | wp_get_wavenumbers (int specIndex, double *wavenumbers, int len) |
| Get the selected spectrometer's calibrated x-axis in wavenumbers (1/cm) More... | |
| DLL_API int | wp_get_wavenumbers_float (int specIndex, float *wavenumbers, int len) |
| Get the selected spectrometer's calibrated x-axis in wavenumbers (1/cm) as float. More... | |
| DLL_API int | wp_get_spectrum (int specIndex, double *spectrum, int len) |
| Read one spectrum from the selected spectrometer. More... | |
| DLL_API int | wp_get_spectrum_float (int specIndex, float *spectrum, int len) |
| Read one spectrum from the selected spectrometer as float. More... | |
| DLL_API int | wp_cancel_operation (int specIndex, int blocking) |
| If an acquisition is currently in progress, cancel it. More... | |
| DLL_API int | wp_set_max_timeout_ms (int specIndex, int maxTimeoutMS) |
| Configure the maximum internal timeout when waiting on blocking USB operations. More... | |
| DLL_API int | wp_get_max_timeout_ms (int specIndex) |
| Get the maximum internal timeout when waiting on blocking USB operations. More... | |
| DLL_API int | wp_set_integration_time_ms (int specIndex, unsigned long ms) |
| Set the spectrometer's integration time in milliseconds. More... | |
| DLL_API int | wp_set_laser_enable (int specIndex, int value) |
| Turns the laser on or off. More... | |
| DLL_API int | wp_set_laser_power_perc (int specIndex, float percent) |
| Sets laser power as a percentage of max power. More... | |
| DLL_API int | wp_set_laser_power_mW (int specIndex, float power) |
| Sets laser power as a mW value. More... | |
| DLL_API int | wp_set_detector_gain (int specIndex, float value) |
| Set detector gain. More... | |
| DLL_API int | wp_set_detector_gain_odd (int specIndex, float value) |
| On InGaAs spectrometers, configures the gain for odd-numbered pixels. More... | |
| DLL_API int | wp_set_detector_offset (int specIndex, int value) |
| Set detector offset. More... | |
| DLL_API int | wp_set_detector_offset_odd (int specIndex, int value) |
| On InGaAs spectrometers, configures the offset for odd-numbered pixels. More... | |
| DLL_API int | wp_set_detector_tec_enable (int specIndex, int value) |
| Turn the detector TEC on or off. More... | |
| DLL_API int | wp_set_detector_tec_setpoint_deg_c (int specIndex, int value) |
| Set the detector TEC setpoint. More... | |
| DLL_API int | wp_set_high_gain_mode_enable (int specIndex, int value) |
| Enable or disable "high gain" mode on InGaAs detectors. More... | |
| DLL_API int | wp_get_firmware_version (int specIndex, char *value, int len) |
| Get the firmware version of the microcontroller (FX2 or ARM). More... | |
| DLL_API int | wp_get_fpga_version (int specIndex, char *value, int len) |
| Get the version of the FPGA. More... | |
| DLL_API float | wp_get_detector_temperature_deg_c (int specIndex) |
| Get the detector temperature. More... | |
| DLL_API long | wp_get_integration_time_ms (int specIndex) |
| Get the curent integration time. More... | |
| DLL_API int | wp_get_laser_enable (int specIndex) |
| Reports whether laser is currently enabled (firing, or configured to do so). More... | |
| DLL_API float | wp_get_detector_gain (int specIndex) |
| Get the current detector gain (on InGaAs, even pixels only). More... | |
| DLL_API float | wp_get_detector_gain_odd (int specIndex) |
| Get the current detector gain for odd InGaAs pixels. More... | |
| DLL_API int | wp_get_detector_offset (int specIndex) |
| Get the current detector offset (on InGaAs, even pixels only). More... | |
| DLL_API int | wp_get_detector_offset_odd (int specIndex) |
| Get the current detector offset for odd InGaAs pixels. More... | |
| DLL_API int | wp_get_detector_tec_enable (int specIndex) |
| Reports whether the detector TEC is enabled. More... | |
| DLL_API int | wp_get_detector_tec_setpoint_deg_c (int specIndex) |
| Get the current detector TEC setpoint in degrees Celsius. More... | |
| DLL_API int | wp_get_high_gain_mode_enable (int specIndex) |
| Reports whether "high-gain mode" is currently enabled on InGaAs detectors. More... | |
| DLL_API int | wp_send_control_msg (int specIndex, unsigned char bRequest, unsigned int wValue, unsigned int wIndex, unsigned char *data, int len) |
| Provide direct access to writing spectrometer opcodes via USB setup packets (endpoint 0 control. More... | |
| DLL_API int | wp_read_control_msg (int specIndex, unsigned char bRequest, unsigned int wIndex, unsigned char *data, int len) |
| Provide direct access to reading spectrometer opcodes via USB setup packets (endpoint 0 control. More... | |
Declaration of the flattened C API exported by WasatchVCPP.dll.
It uses legacy C native types (no STL templates or C++ language features) to avoid ABI problems when calling the DLL from code which was compiled in a different compiler (even a different version of Visual Studio).
Calling code can use these functions directly, or they can use the higher-level WasatchVCPP::Proxy classes defined in WasatchVCPPProxy.h/cpp.
Although the majority of WasatchVCPP is written in C++ and uses a variety of internal classes, those classes and objects cannot be accessed through the DLL ABI barrier. This file is the only part of the DLL that customers can actually "see" and "talk to."
This file is still under development; many spectrometer functions have not yet been added.
| DLL_API int wp_cancel_operation | ( | int | specIndex, |
| int | blocking | ||
| ) |
If an acquisition is currently in progress, cancel it.
Note that while this function will return instantly, the current operation is guaranteed to complete within the currently configured "maximum timeout" as set through wp_set_max_timeout_ms.
| specIndex | (Input) which spectrometer |
| block | (Input) whether the function should block until the current operation completes (0 for non-blocking, non-zero for blocking) |
| DLL_API int wp_close_all_spectrometers | ( | ) |
Closes all connected spectrometers.
| DLL_API int wp_close_spectrometer | ( | int | specIndex | ) |
Closes the specified spectrometer.
| specIndex | (Input) which spectrometer |
| DLL_API void wp_destroy_driver | ( | ) |
Permanently releases all objects from memory.
It is recommended to close and restart the application be after calling this function, before wp_open_all_spectrometers can be called again.
| DLL_API float wp_get_detector_gain | ( | int | specIndex | ) |
Get the current detector gain (on InGaAs, even pixels only).
| specIndex | (Input) which spectrometer |
| DLL_API float wp_get_detector_gain_odd | ( | int | specIndex | ) |
Get the current detector gain for odd InGaAs pixels.
| specIndex | (Input) which spectrometer |
| DLL_API int wp_get_detector_offset | ( | int | specIndex | ) |
Get the current detector offset (on InGaAs, even pixels only).
| specIndex | (Input) which spectrometer |
| DLL_API int wp_get_detector_offset_odd | ( | int | specIndex | ) |
Get the current detector offset for odd InGaAs pixels.
| specIndex | (Input) which spectrometer |
| DLL_API int wp_get_detector_tec_enable | ( | int | specIndex | ) |
Reports whether the detector TEC is enabled.
| specIndex | (Input) which spectrometer |
| DLL_API int wp_get_detector_tec_setpoint_deg_c | ( | int | specIndex | ) |
Get the current detector TEC setpoint in degrees Celsius.
| specIndex | (Input) which spectrometer |
| DLL_API float wp_get_detector_temperature_deg_c | ( | int | specIndex | ) |
Get the detector temperature.
| specIndex | (Input) which spectrometer |
| DLL_API int wp_get_eeprom | ( | int | specIndex, |
| const char ** | names, | ||
| const char ** | values, | ||
| int | len | ||
| ) |
Read a table of all EEPROM fields, as strings.
This is provided as a fast-and-simple way to expose the entire EEPROM to the caller in one function call. It would be nice if we could return the actual EEPROM object with all the fields parsed into native types, but you can't send objects across the ABI. It would be nice if we could send a std::map of name-value pairs, but you can't send templates across the ABI. So we get...this.
Note this doesn't actually copy any data...all it does is copy the current pointer location of each EEPROM field name and stringified value from the EEPROM::stringified map. Currently, there is no use-case where those strings are changed after the spectrometer is instantiated, partly because we're not yet supporting "EEPROM write".
Therefore these character pointers SHOULD be valid until the spectrometers are closed and their EEPROM objects destroyed. However, it would probably be a good idea for calling code to make copies of these values if it wants to persist them. (This is what WasatchVCPP::Proxy does, instantiating each field into a new map<string, string> immediately after calling this function.)
A "full" API implementation could probably include native-type accessors (and settors!) for every field in the EEPROM; I've already added such "convenience accessors" for pixels, model and serialNumber due to their relative importance when testing spectroscopy applications. However, that's a lot of typing and testing, and this will do for now.
| specIndex | (Input) which spectrometer |
| names | (Output) a pre-allocated array of character pointers to hold field names |
| values | (Output) a pre-allocated array of character pointers to hold field values |
| len | (Input) number of elements in names and values arrays |
| DLL_API int wp_get_eeprom_field | ( | int | specIndex, |
| const char * | name, | ||
| char * | value, | ||
| int | len | ||
| ) |
Read one stringified EEPROM field by name.
If you don't want to call wp_get_eeprom and only want one or two fields and you already know their names, this can be easier than reading the whole table.
| specIndex | (Input) which spectrometer |
| name | (Input) case-insensitive name of the desired EEPROM field |
| value | (Output) a pre-allocated character array to hold the value |
| len | (Input) length of pre-allocated array |
| DLL_API int wp_get_eeprom_field_count | ( | int | specIndex | ) |
This is provided so the caller can correctly size the 'names' and 'values' arrays for a call to wp_get_eeprom().
| specIndex | (Input) which spectrometer |
| DLL_API int wp_get_eeprom_field_name | ( | int | specIndex, |
| int | index, | ||
| char * | value, | ||
| int | len | ||
| ) |
Obtain the nth ordered EEPROM field name.
| specIndex | (Input) which spectrometer |
| index | (Input) which field (1...wp_get_eeprom_field_count) |
| value | (Output) allocated character buffer of 'len' bytes |
| len | (Input) size of allocated value buffer |
| DLL_API int wp_get_eeprom_page | ( | int | specIndex, |
| int | page, | ||
| unsigned char * | buf, | ||
| int | len | ||
| ) |
Read one page of the EEPROM in raw binary form.
| specIndex | (Input) which spectrometer |
| page | (Input) which page (0-7) |
| buf | (Output) pre-allocated array of bytes to hold the page |
| len | (Input) size of allocated buffer (should be 64) |
| DLL_API int wp_get_firmware_version | ( | int | specIndex, |
| char * | value, | ||
| int | len | ||
| ) |
Get the firmware version of the microcontroller (FX2 or ARM).
| specIndex | (Input) which spectrometer |
| value | (Output) pre-allocated character array |
| len | (Input) allocated size (should be 16+) |
| DLL_API int wp_get_fpga_version | ( | int | specIndex, |
| char * | value, | ||
| int | len | ||
| ) |
Get the version of the FPGA.
| specIndex | (Input) which spectrometer |
| value | (Output) pre-allocated character array |
| len | (Input) allocated size (should be 16+) |
| DLL_API int wp_get_high_gain_mode_enable | ( | int | specIndex | ) |
Reports whether "high-gain mode" is currently enabled on InGaAs detectors.
| specIndex | (Input) which spectrometer |
| DLL_API long wp_get_integration_time_ms | ( | int | specIndex | ) |
Get the curent integration time.
| specIndex | (Input) which spectrometer |
| DLL_API int wp_get_laser_enable | ( | int | specIndex | ) |
Reports whether laser is currently enabled (firing, or configured to do so).
| specIndex | (Input) which spectrometer |
| DLL_API int wp_get_library_version | ( | char * | value, |
| int | len | ||
| ) |
Obtains the version number of the WasatchVCPP library itself.
| value | (Output) pre-allocated string to receive the value |
| len | (Input) length of allocated buffer (16 recommended) |
| DLL_API int wp_get_max_timeout_ms | ( | int | specIndex | ) |
Get the maximum internal timeout when waiting on blocking USB operations.
| specIndex | (Input) which spectrometer |
| DLL_API int wp_get_model | ( | int | specIndex, |
| char * | value, | ||
| int | len | ||
| ) |
Get the selected spectrometer's model.
| specIndex | (Input) which spectrometer |
| value | (Output) pre-allocated buffer of 'len' bytes (33 recommended) |
| len | (Input) allocated length of 'value' |
| DLL_API int wp_get_number_of_spectrometers | ( | ) |
Returns number of spectrometers previously opened.
Assumes that wp_open_all_spectrometers has already been called. Does not open or re-open anything; no state is changed. (convenience function)
| DLL_API int wp_get_pixels | ( | int | specIndex | ) |
Returns the number of pixels in the selected spectrometer.o.
This is critical for correctly sizing arrays sent to other functions like get_spectrum or get_wavelengths.
| specIndex | (Input) which spectrometer |
| DLL_API int wp_get_serial_number | ( | int | specIndex, |
| char * | value, | ||
| int | len | ||
| ) |
Get the selected spectrometer's serial number.
| value | (Output) pre-allocated buffer of 'len' bytes (33 recommended) |
| len | (Input) allocated length of 'value' |
| DLL_API int wp_get_spectrum | ( | int | specIndex, |
| double * | spectrum, | ||
| int | len | ||
| ) |
Read one spectrum from the selected spectrometer.
This sends an "ACQUIRE" command, waits for "integration time" to pass, then performs a blocking read from the bulk endpoint.
| specIndex | (Input) which spectrometer |
| spectrum | (Output) pre-allocated buffer of 'len' doubles |
| len | (Input) allocated length of 'xAxis' (should match 'pixels') |
| DLL_API int wp_get_spectrum_float | ( | int | specIndex, |
| float * | spectrum, | ||
| int | len | ||
| ) |
Read one spectrum from the selected spectrometer as float.
This sends an "ACQUIRE" command, waits for "integration time" to pass, then performs a blocking read from the bulk endpoint.
| specIndex | (Input) which spectrometer |
| spectrum | (Output) pre-allocated buffer of 'len' floats |
| len | (Input) allocated length of 'xAxis' (should match 'pixels') |
| DLL_API int wp_get_wavelengths | ( | int | specIndex, |
| double * | wavelengths, | ||
| int | len | ||
| ) |
Get the selected spectrometer's calibrated wavelength x-axis in nanometers.
| specIndex | (Input) which spectrometer |
| wavelengths | (Output) pre-allocated buffer of 'len' doubles |
| len | (Input) allocated length of 'wavelengths' (should match 'pixels') |
| DLL_API int wp_get_wavelengths_float | ( | int | specIndex, |
| float * | wavelengths, | ||
| int | len | ||
| ) |
Get the selected spectrometer's calibrated wavelength x-axis in nanometers as float.
| specIndex | (Input) which spectrometer |
| wavelengths | (Output) pre-allocated buffer of 'len' floats |
| len | (Input) allocated length of 'wavelengths' (should match 'pixels') |
| DLL_API int wp_get_wavenumbers | ( | int | specIndex, |
| double * | wavenumbers, | ||
| int | len | ||
| ) |
Get the selected spectrometer's calibrated x-axis in wavenumbers (1/cm)
| specIndex | (Input) which spectrometer |
| wavenumbers | (Output) pre-allocated buffer of 'len' doubles |
| len | (Input) allocated length of 'wavenumbers' (should match 'pixels') |
| DLL_API int wp_get_wavenumbers_float | ( | int | specIndex, |
| float * | wavenumbers, | ||
| int | len | ||
| ) |
Get the selected spectrometer's calibrated x-axis in wavenumbers (1/cm) as float.
| specIndex | (Input) which spectrometer |
| wavenumbers | (Output) pre-allocated buffer of 'len' floats |
| len | (Input) allocated length of 'wavenumbers' (should match 'pixels') |
| DLL_API int wp_log_debug | ( | const char * | msg, |
| int | len | ||
| ) |
Allows calling code (and wrappers) to inject lines into the library's log.
| msg | (Input) null-terminated C string |
| len | (Input) length of string |
| DLL_API int wp_open_all_spectrometers | ( | ) |
Connects to and initializes all enumerated USB spectrometers.
This is normally the first function called against the library. It is normally called only once per application session.
It does quite a lot of work:
After calling this function, the driver is fully configured and ready to control all connected spectrometers.
| DLL_API int wp_read_control_msg | ( | int | specIndex, |
| unsigned char | bRequest, | ||
| unsigned int | wIndex, | ||
| unsigned char * | data, | ||
| int | len | ||
| ) |
Provide direct access to reading spectrometer opcodes via USB setup packets (endpoint 0 control.
If a particular spectrometer feature documented in ENG-0001 is not yet suppoted by the library, or if you need to test an experimental / un- released feature against beta firmware, you can do so with this function.
| specIndex | (Input) which spectrometer |
| bRequest | (Input) control packet request (uint8_t) |
| wIndex | (Input) control packet wIndex (uint16_t) |
| data | (Output) pre-allocated buffer to hold response (uint8_t[]) |
| len | (Input) number of bytes to read (data should be sized accordingly) |
| DLL_API int wp_send_control_msg | ( | int | specIndex, |
| unsigned char | bRequest, | ||
| unsigned int | wValue, | ||
| unsigned int | wIndex, | ||
| unsigned char * | data, | ||
| int | len | ||
| ) |
Provide direct access to writing spectrometer opcodes via USB setup packets (endpoint 0 control.
If a particular spectrometer feature documented in ENG-0001 is not yet suppoted by the library, or if you need to test an experimental / un- released feature against beta firmware, you can do so with this function.
| specIndex | (Input) which spectrometer |
| bRequest | (Input) control packet request (uint8_t) |
| wValue | (Input) control packet wValue (uint16_t) |
| wIndex | (Input) control packet wIndex (uint16_t) |
| data | (Input) control packet payload (uint8_t[]) |
| len | (Input) length of control packet payload |
| DLL_API int wp_set_detector_gain | ( | int | specIndex, |
| float | value | ||
| ) |
Set detector gain.
This should not be done casually by the user; detector gain is normally optimized for a given detector series, and rarely varies significantly from component to component. In the event that detector gain calibration is required, it is done at the factory, and the calibrated value is stored in the EEPROM ("detectorGain").
There is a lot which can be said about this attribute, which may be fleshed-out here at a later date. The internal data format is somewhat odd, essentially a signed bfloat16 (see WasatchNET documentation on FunkyFloat). For historical reasons, many spectrometers are tuned to a default gain of 1.9 (0x01e6). It is a valid question why the calibrated gain is stored on the spectrometer (in the EEPROM) yet needs to be applied from software over USB.
| specIndex | (Input) which spectrometer |
| value | (Input) desired gain (e.g. 1.9) |
| DLL_API int wp_set_detector_gain_odd | ( | int | specIndex, |
| float | value | ||
| ) |
On InGaAs spectrometers, configures the gain for odd-numbered pixels.
Hamamatsu InGaAs detectors use two interleaved arrays of photodiodes, where one array controls even-numbered pixels and the other array controls the odd-numbered. This means that with regard to gain and noise characteristics, all even pixels are electrically related, and all odd pixels are electrically related, but the two sets may behave differently from one another. Therefore, NIR spectrometers support independent gain and offset calibration for the two pixels sets.
| specIndex | (Input) which spectrometer |
| value | (Input) desired gain (positive or negative) |
| DLL_API int wp_set_detector_offset | ( | int | specIndex, |
| int | value | ||
| ) |
Set detector offset.
| specIndex | (Input) which spectrometer |
| value | (Input) desired offset (positive or negative) |
| DLL_API int wp_set_detector_offset_odd | ( | int | specIndex, |
| int | value | ||
| ) |
On InGaAs spectrometers, configures the offset for odd-numbered pixels.
| specIndex | (Input) which spectrometer |
| value | (Input) desired offset (positive or negative) |
| DLL_API int wp_set_detector_tec_enable | ( | int | specIndex, |
| int | value | ||
| ) |
Turn the detector TEC on or off.
| specIndex | (Input) which spectrometer |
| value | (Input) zero for off, non-zero for on |
| DLL_API int wp_set_detector_tec_setpoint_deg_c | ( | int | specIndex, |
| int | value | ||
| ) |
Set the detector TEC setpoint.
| specIndex | (Input) which spectrometer |
| value | (Input) desired temperature in degrees Celsius |
| DLL_API int wp_set_high_gain_mode_enable | ( | int | specIndex, |
| int | value | ||
| ) |
Enable or disable "high gain" mode on InGaAs detectors.
| specIndex | (Input) which spectrometer |
| value | (Input) zero to disable, non-zero to enable |
| DLL_API int wp_set_integration_time_ms | ( | int | specIndex, |
| unsigned long | ms | ||
| ) |
Set the spectrometer's integration time in milliseconds.
| specIndex | (Input) which spectrometer |
| DLL_API int wp_set_laser_enable | ( | int | specIndex, |
| int | value | ||
| ) |
Turns the laser on or off.
| specIndex | (Input) which spectrometer |
| value | (Input) whether laser should be off (zero) or on (non-zero) |
| DLL_API int wp_set_laser_power_mW | ( | int | specIndex, |
| float | power | ||
| ) |
Sets laser power as a mW value.
| power | (Input) mW power to set laser |
| DLL_API int wp_set_laser_power_perc | ( | int | specIndex, |
| float | percent | ||
| ) |
Sets laser power as a percentage of max power.
| percent | (Input) percent of max power |
| DLL_API int wp_set_log_level | ( | int | level | ) |
Sets driver log level.
| level | (Input) one of the WP_LOG_LEVEL macros |
| DLL_API int wp_set_logfile_path | ( | const char * | pathname, |
| int | len | ||
| ) |
Sets a pathname for WasatchVCPP to write a debug logfile.
| pathname | (Input) a valid pathname (need not exist, will be overwritten if found) |
| len | (Input) length of pathname |
| DLL_API int wp_set_max_timeout_ms | ( | int | specIndex, |
| int | maxTimeoutMS | ||
| ) |
Configure the maximum internal timeout when waiting on blocking USB operations.
Note this value can be less than integration time. If a configured integration time is longer than the maximum timeout, then the "wait" on the requested spectrum will be performed through a series of individual reads, each no longer than the configured maximum timeout.
That is, if maxTimeoutMS is 1000, and a 5sec integration is requested, The library will loop through five 1sec blocking reads before the spectrum is expected to return. (The library will internally wait even longer than that, to account for USB latency and other timing delays, but no individual blocking read will wait longer than the configured maximum.)
This value also represents the longest that wp_cancel_operation(true) should block.
This function essentially configures the maximum window before a call to wp_cancel_operation will be expected to take effect.
| specIndex | (Input) which spectrometer |
| maxTimeoutMS | (Input) maximum timeout in milliseconds (default 1000; probably should not be < 200) |