Wasatch.NET 2.4.14
.NET application driver for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Package Functions | Package Attributes | Properties | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
WasatchNET.SPISpectrometer Class Reference
Inheritance diagram for WasatchNET.SPISpectrometer:
[legend]
Collaboration diagram for WasatchNET.SPISpectrometer:
[legend]

Public Member Functions

override void changeSPITrigger (bool edge, bool firmwareThrow)
 
override void close ()
 
List< byte[]> getEEPROMPages ()
 
override double[] getSpectrum (bool forceNew=false)
 Take a single complete spectrum, including any configured scan averaging, boxcar, dark subtraction, inversion, binning, and optionally relative intensity correction.
 
override bool setLaserPowerPercentage (float perc)
 
bool writeEEPROM (List< byte[]> pages)
 
- Public Member Functions inherited from WasatchNET.Spectrometer
void cancelCurrentAcquisition ()
 
virtual void changeSPITrigger (bool edge, bool firmwareThrow)
 
virtual void close ()
 
double[] correctRamanIntensity (double[] spectrum)
 Performs SRM correction on the given spectrum using the ROI and coefficients on EEPROM. Non-ROI pixels are not corrected. If ROI or relative intensity coefficients appear invalid, original spectrum is returned.
 
void dontCache (Opcodes op)
 
bool eraseStorage ()
 
void flushReaders ()
 
ushort getDAC_UNUSED ()
 
virtual ushort[] getFrame ()
 
virtual double[] getSpectrum (bool forceNew=false)
 Take a single complete spectrum, including any configured scan averaging, boxcar, dark subtraction, inversion, binning, and optionally relative intensity correction.
 
byte[] getStorage (UInt16 page)
 
UntetheredCaptureStatus getUntetheredCaptureStatus ()
 
bool haveCache (Opcodes op)
 
virtual bool loadFromJSON (string pathname)
 
virtual bool reconnect ()
 
virtual void regenerateWavelengths ()
 
bool resetFPGA ()
 
bool sendFeedback (UInt16 sequence)
 
bool sendSWTrigger ()
 
bool setDFUMode ()
 Put the ARM microcontroller into DFU mode for firmware update.
 
virtual bool setLaserPowerPercentage (float perc)
 
void useCache (Opcodes op)
 
void close ()
 
double[] getSpectrum (bool forceNew)
 Take a single complete spectrum, including any configured scan averaging, boxcar and dark subtraction.
 
bool reconnect ()
 
void regenerateWavelengths ()
 
bool setDFUMode ()
 Put the ARM microcontroller into DFU mode for firmware update.
 
bool setLaserPowerPercentage (float perc)
 Set laser power to the specified percentage.
 

Protected Member Functions

override double[] getSpectrumRaw (bool skipTrigger=false)
 just the bytes, ma'am
 
- Protected Member Functions inherited from WasatchNET.Spectrometer
void correctBadPixels (ref double[] spectrum)
 If a spectrometer has bad_pixels configured in the EEPROM, then average over them in the driver.
 
virtual double[] getAreaScanLightweight ()
 
virtual double[] getSpectrumRaw (bool skipTrigger=false)
 just the bytes, ma'am
 

Package Functions

override bool open ()
 
 SPISpectrometer (UsbRegistry usbReg, int index=0)
 
- Package Functions inherited from WasatchNET.Spectrometer
byte[] getCmd (Opcodes opcode, int len, ushort wIndex=0, int fullLen=0)
 Execute a request-response control transaction using the given opcode.
 
byte[] getCmd2 (Opcodes opcode, int len, ushort wIndex=0, int fakeBufferLengthARM=0)
 Execute a request-response transfer with a "second-tier" request.
 
virtual bool open ()
 
bool sendCmd (Opcodes opcode, ushort wValue=0, ushort wIndex=0, byte[] buf=null)
 send a single control transfer command (response not checked)
 
bool sendCmd2 (Opcodes opcode, ushort wIndex=0, byte[] buf=null)
 send a single 2nd-tier control transfer command (response not checked)
 
 Spectrometer (UsbRegistry usbReg)
 

Package Attributes

MpsseDevice mpsse
 
int specIndex
 
SpiDevice spi
 
- Package Attributes inherited from WasatchNET.Spectrometer
Dictionary< Opcodes, byte > cmd = OpcodeHelper.getInstance().getDict()
 
bool shuttingDown = false
 
SpectrometerUptime uptime
 

Properties

override bool batteryCharging [get]
 
override float batteryPercentage [get]
 
override uint boxcarHalfWidth [get, set]
 Perform post-acquisition high-frequency smoothing by averaging together "n" pixels to either side of each acquired pixel; zero to disable (default).
 
override float detectorGain [get, set]
 Maps to an FPGA register inside the spectrometer used to scale pixels read from the ADC to optimize dynamic range.
 
override float detectorGainOdd [get, set]
 (InGaAs-only) Companion property to detectorGain, which on InGaAs detectors applies only to even-numbered pixels.
 
override short detectorOffset [get, set]
 Maps to an FPGA register inside the spectrometer used to offset the pixels (dark baseline) read from the ADC to optimize dynamic range.
 
override short detectorOffsetOdd [get, set]
 (InGaAs-only) Companion property to detectorOffset, which on InGaAs detectors applies only to even-numbered pixels.
 
override bool detectorTECEnabled [get, set]
 
override float detectorTECSetpointDegC [get, set]
 
override ushort detectorTECSetpointRaw [get, set]
 
override float detectorTemperatureDegC [get]
 
override float excitationWavelengthNM [get]
 
override string firmwareRevision [get]
 
override string fpgaRevision [get]
 
override bool hasLaser [get]
 
override bool highGainModeEnabled [get, set]
 
override uint integrationTimeMS [get, set]
 Current integration time in milliseconds.
 
override bool isARM [get]
 
override bool isInGaAs [get]
 
override bool laserEnabled [get, set]
 Whether the laser has been REQUESTED TO FIRE by the software and firmware.
 
override bool laserInterlockEnabled [get]
 True if the laser can fire (interlock circuit is CLOSED), false if the laser cannot fire (interlock circuit is OPEN).

 
override UInt64 laserModulationPeriod [get]
 When defining the laser modulation duty cycle, the length (period) of the duty cycle in microsec.
 
override LaserPowerResolution laserPowerResolution [get]
 
override float laserTemperatureDegC [get]
 convert the raw laser temperature reading into degrees centigrade
 
override ushort laserTemperatureRaw [get]
 Synonym for primaryADC.
 
override byte laserTemperatureSetpointRaw [get]
 FACTORY ONLY.
 
override ushort secondaryADC [get]
 This is provided for spectrometers with a secondary ADC connected to an external laser, photodiode or what-have-you. Attempts to read it on spectrometers where it has not been configured can result in indeterminate behavior; therefore, hasSecondaryADC is provided to allow callers to selectively enable this function if they believe they are using supported hardware.
 
override string serialNumber [get]
 spectrometer serial number
 
override TRIGGER_SOURCE triggerSource [get, set]
 Whether acquisitions are triggered "internally" (via the ACQUIRE opcode sent by software) or "externally" (via an electrical signal wired to the accessory connector).
 
- Properties inherited from WasatchNET.Spectrometer
virtual bool accessoryEnabled [get, set]
 Determines whether or not the Gen1.5 accessory connector's features can be used.
 
int acquireCount = 0 [get, protected set]
 Allows application to track how many ACQUIRE_SPECTRUM commands have been sent to the spectrometer (including throwaways and retries).
 
uint? acquisitionTimeoutMS [get, set]
 Convenience accessor to set an explicit acquisition timeout.

 
uint acquisitionTimeoutRelativeMS [set]
 Allows the NEXT acquisition timeout to be set relative to "now" as an offiset in milliseconds.
 
DateTime? acquisitionTimeoutTimestamp = null [get, set]
 Allows the NEXT acquisition timeout to be set to an explicit objective future timestamp.
 
ushort actualFrames [get]
 How many frames have been read since last power cycle (has overflow)
 
uint actualIntegrationTimeUS [get]
 Return integration time + clock-out time (and laser pulse time if externally triggered).
 
ushort adcRaw [get]
 
virtual bool areaScanEnabled [get, set]
 Configure detector for 2D image mode.
 
bool autoTrigger [get, set]
 Whether the driver should automatically send a software trigger on calls to getSpectrum() when triggerSource is set to INTERNAL. (defaults true)
 
virtual bool batteryCharging [get]
 
virtual float batteryPercentage [get]
 
uint batteryStateRaw [get]
 
virtual uint boxcarHalfWidth [get, set]
 Perform post-acquisition high-frequency smoothing by averaging together "n" pixels to either side of each acquired pixel; zero to disable (default).
 
virtual bool continuousAcquisitionEnable [get, set]
 After the first trigger is received, no further triggers are required; spectrometer will enter free-running mode.
 
virtual byte continuousFrames [get, set]
 When not using "continous acquisitions" with external triggers, how many spectra to acquire per trigger event.
 
virtual double[] dark [get, set]
 Perform automatic dark subtraction by setting this property to an acquired dark spectrum; leave "null" to disable.
 
virtual float detectorGain [get, set]
 Maps to an FPGA register inside the spectrometer used to scale pixels read from the ADC to optimize dynamic range.
 
virtual float detectorGainOdd [get, set]
 (InGaAs-only) Companion property to detectorGain, which on InGaAs detectors applies only to even-numbered pixels.
 
virtual short detectorOffset [get, set]
 Maps to an FPGA register inside the spectrometer used to offset the pixels (dark baseline) read from the ADC to optimize dynamic range.
 
virtual short detectorOffsetOdd [get, set]
 (InGaAs-only) Companion property to detectorOffset, which on InGaAs detectors applies only to even-numbered pixels.
 
ushort detectorSensingThreshold [get, set]
 
bool detectorSensingThresholdEnabled [get, set]
 
virtual UInt16 detectorStartLine [get, set]
 
virtual UInt16 detectorStopLine [get, set]
 
virtual bool detectorTECEnabled [get, set]
 
virtual float detectorTECSetpointDegC [get, set]
 
virtual ushort detectorTECSetpointRaw [get, set]
 
double detectorTemperatureCacheTimeMS = 1000 [get, set]
 
virtual float detectorTemperatureDegC [get]
 
virtual ushort detectorTemperatureRaw [get]
 
EEPROM eeprom [get, protected set]
 configuration settings stored in the spectrometer's EEPROM
 
bool errorOnTimeout = true [get, set]
 Whether an ERROR should be logged on a timeout event (default true)
 
virtual float excitationWavelengthNM [get, set]
 
FeatureIdentification featureIdentification [get, set]
 metadata inferred from the spectrometer's USB PID
 
virtual string firmwareRevision [get]
 
FPGAOptions fpgaOptions [get, private set]
 set of compilation options used to compile the FPGA firmware in this spectrometer
 
virtual string fpgaRevision [get]
 
FRAM fram [get, protected set]
 
virtual bool hasLaser [get]
 
bool hasMarker [get, set]
 Some spectrometers send a start-of-frame marker in the first pixel of the spectrum.
 
bool hasSecondaryADC = false [get, set]
 This should be replaced with an FGPACompilationFlag or EEPROM field at some point.
 
virtual bool highGainModeEnabled [get, set]
 
HORIZONTAL_BINNING horizontalBinning [get, set]
 
string id [get]
 couples serial number with channel position
 
virtual uint integrationTimeMS [get, set]
 Current integration time in milliseconds.
 
virtual bool isARM [get]
 
bool isGen15 [get]
 Whether the spectrometer uses a "Gen 1.5" accessory connector.
 
virtual bool isInGaAs [get]
 
bool isOCT = false [get, protected set]
 Optical Coherence Tomography (OCT) spectrometers differ from "standard" spectrometers in several respects, such as producing both 2D and 3D imagery.
 
bool isSiG [get]
 
bool isSPI = false [get, protected set]
 Whether the spectrometer uses Serial Peripheral Interface (as opposed to USB for instance).
 
bool isStroker = false [get, protected set]
 Stroker is a legacy board firmware with older PID (not 0x1000, 0x2000 or 0x4000), doesn't conform to Feature Identification Device (FID) Protocol, and lacking an EEPROM.
 
virtual bool lampEnabled [get, set]
 Whether the lamp attached via Gen 1.5 attachment has been requested to be turned on by the software and firmware.
 
virtual bool laserEnabled [get, set]
 Whether the laser has been REQUESTED TO FIRE by the software and firmware.
 
virtual bool laserFiring [get]
 Whether the laser is ACTUALLY FIRING, according to the laser driver and laser interlock board.
 
virtual bool laserInterlockEnabled [get]
 True if the laser can fire (interlock circuit is CLOSED), false if the laser cannot fire (interlock circuit is OPEN).

 
UInt64 laserModulationDuration [get, set]
 If you only want the laser to be modulated for a portion of each acquisition (rare), how long in microseconds should the laser be modulated during each integration.
 
bool laserModulationEnabled [get, set]
 
bool laserModulationLinkedToIntegrationTime [get, set]
 
virtual UInt64 laserModulationPeriod [get, set]
 When defining the laser modulation duty cycle, the length (period) of the duty cycle in microsec.
 
UInt64 laserModulationPulseDelay [get, set]
 If you want the laser modulation to start part-way through an acquisition, this defines the delay in microseconds from the beginning of the integration until laser modulation begins.
 
virtual UInt64 laserModulationPulseWidth [get, set]
 When defining the laser modulation duty cycle, the length (width) of the period during which the laser is enabled.
 
virtual LaserPowerResolution laserPowerResolution = LaserPowerResolution.LASER_POWER_RESOLUTION_1000 [get, set]
 
virtual float laserPowerSetpointMW [get, set]
 Use this to set the laser output power in milliWatts.
 
bool laserRampingEnabled [get, set]
 disabled to deconflict area scan
 
virtual float laserTemperatureDegC [get]
 convert the raw laser temperature reading into degrees centigrade
 
virtual ushort laserTemperatureRaw [get]
 Synonym for primaryADC.
 
virtual byte laserTemperatureSetpointRaw [get, set]
 FACTORY ONLY.
 
double[] lastSpectrum [get, protected set]
 Useful if you lost the results of getSpectrum, or if you want to peek into ongoing multi-acquisition tasks like scan averaging or optimization.
 
uint lineLength [get]
 
int linesPerFrame [get, protected set]
 
string model [get]
 spectrometer model
 
bool multiChannelSelected [get, set]
 Multichannel convenience accessor (default false)
 
bool optActualIntegrationTime [get]
 
bool optAreaScan [get]
 Whether area scan mode is supported.
 
bool optCFSelect [get]
 Internal firmware name for the highGainModeEnabled feature available on InGaAs detectors.
 
FPGA_DATA_HEADER optDataHeaderTag [get]
 
bool optHorizontalBinning [get]
 
FPGA_INTEG_TIME_RES optIntegrationTimeResolution [get]
 
FPGA_LASER_CONTROL optLaserControl [get]
 
FPGA_LASER_TYPE optLaserType [get]
 
double[] pixelAxis [get]
 convenience accesor for pixel axis (lazy-loaded), for parallelism with wavelengths and wavenumbers
 
uint pixels [get, protected set]
 how many pixels does the spectrometer have (spectrum length)
 
ushort primaryADC [get]
 
bool ramanIntensityCorrectionEnabled [get, set]
 Whether to correct the y-axis using SRM-derived correction factors, stored as coefficients on the spectrometer.
 
virtual double[] reference [get, set]
 Simplify reference-based techniques (absorbance, reflectance, transmission etc) by allowing a reference to be stored with the Spectrometer, similar to dark.

 
virtual uint scanAveraging [get, set]
 How many acquisitions to average together (0 or 1 for no averaging). (default 1)
 
bool scanAveragingIsContinuous [get, set]
 Whether the "scanAveraging" property should automatically configure continuousAcquisitionEnable and continuousFrames. (default false)
 
virtual ushort secondaryADC [get]
 This is provided for spectrometers with a secondary ADC connected to an external laser, photodiode or what-have-you. Attempts to read it on spectrometers where it has not been configured can result in indeterminate behavior; therefore, hasSecondaryADC is provided to allow callers to selectively enable this function if they believe they are using supported hardware.
 
byte selectedADC [get, set]
 
virtual string serialNumber [get]
 spectrometer serial number
 
int shiftedMarkerCount = 0 [get, private set]
 For spectrometer firmware providing "start of spectrum markers", provides a count of how many INCORRECT markers were found in the MOST RECENT spectrum.
 
int spectrumCount = 0 [get, protected set]
 Allows application to track how many successful (non-null) calls have been made to getSpectrum (whether averaged or otherwise).
 
bool throwawayADCRead = true [get, set]
 Whether the driver should automatically perform a throwaway ADC read when changing the selected ADC. (defaults true)
 
bool throwawayAfterIntegrationTime [get, set]
 Whether the driver should automatically generate a throwaway "stability" measurement after changing integration time. (defaults false)
 
uint triggerDelay [get, set]
 A configurable delay from when an inbound trigger signal is received by the spectrometer, until the triggered acquisition actually starts.
 
EXTERNAL_TRIGGER_OUTPUT triggerOutput [get, set]
 
virtual TRIGGER_SOURCE triggerSource [get, set]
 Whether acquisitions are triggered "internally" (via the ACQUIRE opcode sent by software) or "externally" (via an electrical signal wired to the accessory connector).
 
string uniqueKey [get, set]
 
bool untetheredAcquisitionEnabled = false [get, set]
 Untethered operation requires an argument to ACQUIRE, and polls before reading spectrum.
 
bool useReadoutMutex [get, set]
 Whether to synchronize all spectral reads with a class-level (static) mutex.

 
double[] wavelengths [get, protected set]
 pre-populated array of wavelengths (nm) by pixel, generated from eeprom.wavecalCoeffs
 
double[] wavenumbers [get, protected set]
 pre-populated array of Raman shifts in wavenumber (1/cm) by pixel, generated from wavelengths[] and excitationNM
 
- Properties inherited from WasatchNET.ISpectrometer
bool accessoryEnabled [get, set]
 Determines whether or not the Gen1.5 accessory connector's features can be used.
 
ushort actualFrames [get]
 How many frames have been read since last power cycle (has overflow)
 
uint actualIntegrationTimeUS [get]
 Return integration time + clock-out time (and laser pulse time if externally triggered).
 
bool areaScanEnabled [get, set]
 Configure detector for 2D image mode.
 
bool batteryCharging [get]
 
float batteryPercentage [get]
 
uint batteryStateRaw [get]
 
uint boxcarHalfWidth [get, set]
 Perform post-acquisition high-frequency smoothing by averaging together "n" pixels to either side of each acquired pixel; zero to disable (default).
 
bool continuousAcquisitionEnable [get, set]
 After the first trigger is received, no further triggers are required; spectrometer will enter free-running mode.
 
byte continuousFrames [get, set]
 When not using "continous acquisitions" with external triggers, how many spectra to acquire per trigger event.
 
double[] dark [get, set]
 Perform automatic dark subtraction by setting this property to an acquired dark spectrum; leave "null" to disable.
 
float detectorGain [get, set]
 Maps to an FPGA register inside the spectrometer used to scale pixels read from the ADC to optimize dynamic range.
 
float detectorGainOdd [get, set]
 (InGaAs-only) Companion property to detectorGain, which on InGaAs detectors applies only to even-numbered pixels.
 
short detectorOffset [get, set]
 Maps to an FPGA register inside the spectrometer used to offset the pixels (dark baseline) read from the ADC to optimize dynamic range.
 
short detectorOffsetOdd [get, set]
 (InGaAs-only) Companion property to detectorOffset, which on InGaAs detectors applies only to even-numbered pixels.
 
ushort detectorSensingThreshold [get, set]
 
bool detectorSensingThresholdEnabled [get, set]
 
bool detectorTECEnabled [get, set]
 
float detectorTECSetpointDegC [get, set]
 
ushort detectorTECSetpointRaw [get, set]
 
double detectorTemperatureCacheTimeMS [get, set]
 
float detectorTemperatureDegC [get]
 
ushort detectorTemperatureRaw [get]
 
EEPROM eeprom [get]
 configuration settings stored in the spectrometer's EEPROM
 
float excitationWavelengthNM [get, set]
 
FeatureIdentification featureIdentification [get]
 metadata inferred from the spectrometer's USB PID
 
string firmwareRevision [get]
 
FPGAOptions fpgaOptions [get]
 set of compilation options used to compile the FPGA firmware in this spectrometer
 
string fpgaRevision [get]
 
bool hasLaser [get]
 
bool hasSecondaryADC [get, set]
 This should be replaced with an FGPACompilationFlag or EEPROM field at some point.
 
bool highGainModeEnabled [get, set]
 
uint integrationTimeMS [get, set]
 Current integration time in milliseconds.
 
bool isARM [get]
 
bool isGen15 [get]
 
bool isInGaAs [get]
 
bool isSiG [get]
 
bool isSPI [get]
 
bool lampEnabled [get, set]
 Whether the lamp attached via Gen 1.5 attachment has been requested to be turned on by the software and firmware.
 
bool laserEnabled [get, set]
 Whether the laser has been REQUESTED TO FIRE by the software and firmware.
 
bool laserFiring [get]
 Whether the laser is ACTUALLY FIRING, according to the laser driver and laser interlock board.
 
bool laserInterlockEnabled [get]
 True if the laser can fire (interlock circuit is CLOSED), false if the laser cannot fire (interlock circuit is OPEN).

 
UInt64 laserModulationDuration [get, set]
 If you only want the laser to be modulated for a portion of each acquisition (rare), how long in microseconds should the laser be modulated during each integration.
 
bool laserModulationEnabled [get, set]
 
bool laserModulationLinkedToIntegrationTime [get, set]
 
UInt64 laserModulationPeriod [get, set]
 When defining the laser modulation duty cycle, the length (period) of the duty cycle in microsec.
 
UInt64 laserModulationPulseDelay [get, set]
 If you want the laser modulation to start part-way through an acquisition, this defines the delay in microseconds from the beginning of the integration until laser modulation begins.
 
UInt64 laserModulationPulseWidth [get, set]
 When defining the laser modulation duty cycle, the length (width) of the period during which the laser is enabled.
 
Spectrometer.LaserPowerResolution laserPowerResolution [get, set]
 
bool laserRampingEnabled [get, set]
 
float laserTemperatureDegC [get]
 convert the raw laser temperature reading into degrees centigrade
 
ushort laserTemperatureRaw [get]
 Synonym for primaryADC.
 
byte laserTemperatureSetpointRaw [get, set]
 FACTORY ONLY.
 
uint lineLength [get]
 
string model [get]
 spectrometer model
 
bool optActualIntegrationTime [get]
 
bool optAreaScan [get]
 Whether area scan mode is supported.
 
bool optCFSelect [get]
 Internal firmware name for the highGainModeEnabled feature available on InGaAs detectors.
 
FPGA_DATA_HEADER optDataHeaderTag [get]
 
bool optHorizontalBinning [get]
 
FPGA_INTEG_TIME_RES optIntegrationTimeResolution [get]
 
FPGA_LASER_CONTROL optLaserControl [get]
 
FPGA_LASER_TYPE optLaserType [get]
 
uint pixels [get]
 how many pixels does the spectrometer have (spectrum length)
 
ushort primaryADC [get]
 
bool ramanIntensityCorrectionEnabled [get, set]
 
uint scanAveraging [get, set]
 How many acquisitions to average together (zero for no averaging)
 
ushort secondaryADC [get]
 This is provided for spectrometers with a secondary ADC connected to an external laser, photodiode or what-have-you. Attempts to read it on spectrometers where it has not been configured can result in indeterminate behavior; therefore, hasSecondaryADC is provided to allow callers to selectively enable this function if they believe they are using supported hardware.
 
string serialNumber [get]
 spectrometer serial number
 
uint triggerDelay [get, set]
 A configurable delay from when an inbound trigger signal is received by the spectrometer, until the triggered acquisition actually starts.
 
EXTERNAL_TRIGGER_OUTPUT triggerOutput [get, set]
 
TRIGGER_SOURCE triggerSource [get, set]
 Whether acquisitions are triggered "internally" (via the ACQUIRE opcode sent by software) or "externally" (via an electrical signal wired to the accessory connector).
 
double[] wavelengths [get]
 pre-populated array of wavelengths (nm) by pixel, generated from eeprom.wavecalCoeffs
 
double[] wavenumbers [get]
 pre-populated array of Raman shifts in wavenumber (1/cm) by pixel, generated from wavelengths[] and excitationNM
 

Static Private Member Functions

static byte Calc_CRC_8 (byte[] DataArray, int Length)
 
static byte[] padding (int size)
 
static byte[] wrapCommand (byte command, byte[] payload, int padding=0)
 

Private Attributes

bool edgeTrigger
 
bool firmwareThrowaway
 

Static Private Attributes

const byte ALTERNATE_LASER = 0x3D
 
const byte CCD_AREA_SCAN = 0x3C
 
const byte CCD_EXTERNAL_TRIGGER = 0x37
 
const byte CCD_GAIN = 0x14
 
const byte CCD_OFFSET = 0x13
 
const byte CCD_TEMP_CONTROL = 0x38
 
const byte CCD_THRESHOLD = 0x1B
 
const byte CCD_THRESHOLD_SENSE = 0x36
 
const byte CONTINUOUS_READ_CCD = 0x35
 
const byte EEPROM_OPS = 0xB0
 
const byte END_CMD = 0x3E
 
const byte EXTERNAL_OUT_TRIGGER_SRC = 0x3A
 
const byte FPGA_CONFIG_REGISTER = 0x12
 
const byte FPGA_STATUS = 0x1C
 
const byte FRAMES_TO_ACQUIRE = 0x1A
 
const byte GET_ACTUAL_FRAME_COUNT = 0x20
 
const byte GET_ACTUAL_INTEGRATION_TIME = 0x1F
 
const byte GET_CCD_TEMP = 0x49
 
const byte GET_FPGA_REV = 0x10
 
const byte GET_INTEGRATION_TIME = 0x11
 
const byte GET_PIXEL_COUNT = 0x15
 
const byte HORIZ_BINNING = 0x27
 
const byte LASER_MOD_DURATION = 0x17
 
const byte LASER_MOD_LINKED_INT_TIME = 0x39
 
const byte LASER_MOD_PERIOD = 0x19
 
const byte LASER_MOD_PULSE_DELAY = 0x18
 
const byte LASER_MOD_PULSE_WIDTH = 0x1E
 
const byte LASER_MODULATION = 0x33
 
const byte LASER_ON = 0x34
 
const byte LASER_POWER_RAMP = 0x3B
 
const byte LASER_TEMP = 0x1D
 
const byte LASER_TEMP_SET_POINT = 0x16
 
const byte LASER_TRANSITION_1 = 0x21
 
const byte LASER_TRANSITION_2 = 0x22
 
const byte LASER_TRANSITION_3 = 0x23
 
const byte LASER_TRANSITION_4 = 0x24
 
const byte LASER_TRANSITION_5 = 0x25
 
const byte LASER_TRANSITION_6 = 0x26
 
const byte LAST_PIXEL_CRC16 = 0x3F
 
const byte PREP_FPGA = 0x30
 
const byte READ_EEPROM_BUFFER = 0x31
 
const byte RESET_FPGA = 0x0B
 
const byte SELECT_USB_FS = 0x32
 
const byte SET_CCD_GAIN = 0x94
 
const byte SET_CCD_OFFSET = 0x93
 
const byte SET_INTEGRATION_TIME = 0x91
 
const byte SET_SETTINGS = 0x92
 
const int STANDARD_PADDING = 40
 
const byte START_CMD = 0x3C
 
const byte TRIGGER_DELAY = 0x28
 
const byte WRITE_EEPROM_BUFFER = 0xB1
 

Additional Inherited Members

- Public Types inherited from WasatchNET.Spectrometer
enum  LaserPowerResolution { LASER_POWER_RESOLUTION_100 , LASER_POWER_RESOLUTION_1000 , LASER_POWER_RESOLUTION_MANUAL }
 When setting laser power as a percentage (see setLaserPowerPercentage), this enum determines the possible resolution (granularity) of the selectable power. More...
 
enum  UntetheredCaptureStatus {
  IDLE = 0 , DARK = 1 , WARMUP = 2 , SAMPLE = 3 ,
  PROCESSING = 4 , ERROR = 5
}
 
- Public Attributes inherited from WasatchNET.Spectrometer
int acquisitionMaxRetries = 2
 If a call to Spectrometer.getSpectrum() fails, how many internal (within WasatchNET) retries should be attempted (includes re-sending an ACQUIRE opcode).
 
int delayAfterBulkEndpointErrorMS = 100
 If there is an error reading one of the bulk endpoints, pause this many milliseconds in hopes of the bus resetting itself (does not automatically retry).
 
bool fastAreaScan = false
 
float lastDetectorTemperatureDegC = UNINITIALIZED_TEMPERATURE_DEG_C
 A cached value of the last-measured detector temperature. This is automatically updated following spectral reads if readTemperatureAfterSpectrum is set.
 
int multiChannelPosition = -1
 If the spectrometer is deployed in a multi-channel configuration, this provides a place to store an integral position in the Spectrometer object. (defaults to -1, an invalid position)
 
bool readTemperatureAfterSpectrum = false
 If enabled, Wasatch.NET will automatically read the detector temperature following every successful call to getSpectrum(). That temperature can then be read from lastDetectorTemperatureDegC, without inducing any spectrometer communications.
 
- Static Public Attributes inherited from WasatchNET.Spectrometer
const byte DEVICE_TO_HOST = 0xc0
 
const byte HOST_TO_DEVICE = 0x40
 
const int LEGACY_VERTICAL_PIXELS = 70
 for Stroker Area Scan
 
const ushort SPECTRUM_START_MARKER = 0xffff
 
const float UNINITIALIZED_TEMPERATURE_DEG_C = -999
 
- Protected Attributes inherited from WasatchNET.Spectrometer
bool accessoryEnabled_ = false
 
object acquisitionLock = new object()
 synchronizes getSpectrum, integrationTimeMS, scanAveraging, dark and boxcarHalfWidth
 
object adcLock = new object()
 
bool areaScanEnabled_ = false
 
uint boxcarHalfWidth_
 
bool currentAcquisitionCancelled
 
double[] dark_
 
bool detectorTECEnabled_
 
float detectorTECSetpointDegC_ = UNINITIALIZED_TEMPERATURE_DEG_C
 
ushort detectorTECSetpointRaw_
 
uint integrationTimeMS_
 
bool lampEnabled_ = false
 
bool laserEnabled_
 
bool laserHasFired_
 
UInt64 laserModulationPeriod_
 
UInt64 laserModulationPulseWidth_
 
float laserPowerSetpointMW_ = 0
 
byte laserTemperatureSetpointRaw_
 
Logger logger = Logger.getInstance()
 
double[] reference_
 
uint scanAveraging_ = 1
 
TRIGGER_SOURCE triggerSource_ = TRIGGER_SOURCE.INTERNAL
 

Constructor & Destructor Documentation

◆ SPISpectrometer()

WasatchNET.SPISpectrometer.SPISpectrometer ( UsbRegistry  usbReg,
int  index = 0 
)
inlinepackage

Member Function Documentation

◆ Calc_CRC_8()

static byte WasatchNET.SPISpectrometer.Calc_CRC_8 ( byte[]  DataArray,
int  Length 
)
inlinestaticprivate

◆ changeSPITrigger()

override void WasatchNET.SPISpectrometer.changeSPITrigger ( bool  edge,
bool  firmwareThrow 
)
inlinevirtual

Reimplemented from WasatchNET.Spectrometer.

◆ close()

override void WasatchNET.SPISpectrometer.close ( )
inlinevirtual

Reimplemented from WasatchNET.Spectrometer.

◆ getEEPROMPages()

List< byte[]> WasatchNET.SPISpectrometer.getEEPROMPages ( )
inline

◆ getSpectrum()

override double[] WasatchNET.SPISpectrometer.getSpectrum ( bool  forceNew = false)
inlinevirtual

Take a single complete spectrum, including any configured scan averaging, boxcar, dark subtraction, inversion, binning, and optionally relative intensity correction.

Parameters
forceNewnot used in base class (provided for specialized subclasses)
Returns
The acquired spectrum as an array of doubles

Reimplemented from WasatchNET.Spectrometer.

◆ getSpectrumRaw()

override double[] WasatchNET.SPISpectrometer.getSpectrumRaw ( bool  skipTrigger = false)
inlineprotectedvirtual

just the bytes, ma'am

Parameters
skipTriggerallows getSpectrum to suppress SW triggers when scanAveraging, on scans after the first, if scanAveragingIsContinuous

Reimplemented from WasatchNET.Spectrometer.

◆ open()

override bool WasatchNET.SPISpectrometer.open ( )
inlinepackagevirtual

Reimplemented from WasatchNET.Spectrometer.

◆ padding()

static byte[] WasatchNET.SPISpectrometer.padding ( int  size)
inlinestaticprivate

◆ setLaserPowerPercentage()

override bool WasatchNET.SPISpectrometer.setLaserPowerPercentage ( float  perc)
inlinevirtual
Parameters
perca normalized floating-point percentage from 0.0 to 1.0 (100%)

Not implemented as a property because it truly isn't; it's a complex combination of actual spectrometer properties.

Technically you don't need to call this function at all, and can set the laserModulationPulseWidth, laserModulationPulsePeriod and laserModulationEnabled properties directly if you wish.

Alternately, you can use the laserPowerSetpointMW property to set laser power in mW, provided a suitable laser power calibration is loaded onto the EEPROM.

Reimplemented from WasatchNET.Spectrometer.

◆ wrapCommand()

static byte[] WasatchNET.SPISpectrometer.wrapCommand ( byte  command,
byte[]  payload,
int  padding = 0 
)
inlinestaticprivate

◆ writeEEPROM()

bool WasatchNET.SPISpectrometer.writeEEPROM ( List< byte[]>  pages)
inline

Member Data Documentation

◆ ALTERNATE_LASER

const byte WasatchNET.SPISpectrometer.ALTERNATE_LASER = 0x3D
staticprivate

◆ CCD_AREA_SCAN

const byte WasatchNET.SPISpectrometer.CCD_AREA_SCAN = 0x3C
staticprivate

◆ CCD_EXTERNAL_TRIGGER

const byte WasatchNET.SPISpectrometer.CCD_EXTERNAL_TRIGGER = 0x37
staticprivate

◆ CCD_GAIN

const byte WasatchNET.SPISpectrometer.CCD_GAIN = 0x14
staticprivate

◆ CCD_OFFSET

const byte WasatchNET.SPISpectrometer.CCD_OFFSET = 0x13
staticprivate

◆ CCD_TEMP_CONTROL

const byte WasatchNET.SPISpectrometer.CCD_TEMP_CONTROL = 0x38
staticprivate

◆ CCD_THRESHOLD

const byte WasatchNET.SPISpectrometer.CCD_THRESHOLD = 0x1B
staticprivate

◆ CCD_THRESHOLD_SENSE

const byte WasatchNET.SPISpectrometer.CCD_THRESHOLD_SENSE = 0x36
staticprivate

◆ CONTINUOUS_READ_CCD

const byte WasatchNET.SPISpectrometer.CONTINUOUS_READ_CCD = 0x35
staticprivate

◆ edgeTrigger

bool WasatchNET.SPISpectrometer.edgeTrigger
private

◆ EEPROM_OPS

const byte WasatchNET.SPISpectrometer.EEPROM_OPS = 0xB0
staticprivate

◆ END_CMD

const byte WasatchNET.SPISpectrometer.END_CMD = 0x3E
staticprivate

◆ EXTERNAL_OUT_TRIGGER_SRC

const byte WasatchNET.SPISpectrometer.EXTERNAL_OUT_TRIGGER_SRC = 0x3A
staticprivate

◆ firmwareThrowaway

bool WasatchNET.SPISpectrometer.firmwareThrowaway
private

◆ FPGA_CONFIG_REGISTER

const byte WasatchNET.SPISpectrometer.FPGA_CONFIG_REGISTER = 0x12
staticprivate

◆ FPGA_STATUS

const byte WasatchNET.SPISpectrometer.FPGA_STATUS = 0x1C
staticprivate

◆ FRAMES_TO_ACQUIRE

const byte WasatchNET.SPISpectrometer.FRAMES_TO_ACQUIRE = 0x1A
staticprivate

◆ GET_ACTUAL_FRAME_COUNT

const byte WasatchNET.SPISpectrometer.GET_ACTUAL_FRAME_COUNT = 0x20
staticprivate

◆ GET_ACTUAL_INTEGRATION_TIME

const byte WasatchNET.SPISpectrometer.GET_ACTUAL_INTEGRATION_TIME = 0x1F
staticprivate

◆ GET_CCD_TEMP

const byte WasatchNET.SPISpectrometer.GET_CCD_TEMP = 0x49
staticprivate

◆ GET_FPGA_REV

const byte WasatchNET.SPISpectrometer.GET_FPGA_REV = 0x10
staticprivate

◆ GET_INTEGRATION_TIME

const byte WasatchNET.SPISpectrometer.GET_INTEGRATION_TIME = 0x11
staticprivate

◆ GET_PIXEL_COUNT

const byte WasatchNET.SPISpectrometer.GET_PIXEL_COUNT = 0x15
staticprivate

◆ HORIZ_BINNING

const byte WasatchNET.SPISpectrometer.HORIZ_BINNING = 0x27
staticprivate

◆ LASER_MOD_DURATION

const byte WasatchNET.SPISpectrometer.LASER_MOD_DURATION = 0x17
staticprivate

◆ LASER_MOD_LINKED_INT_TIME

const byte WasatchNET.SPISpectrometer.LASER_MOD_LINKED_INT_TIME = 0x39
staticprivate

◆ LASER_MOD_PERIOD

const byte WasatchNET.SPISpectrometer.LASER_MOD_PERIOD = 0x19
staticprivate

◆ LASER_MOD_PULSE_DELAY

const byte WasatchNET.SPISpectrometer.LASER_MOD_PULSE_DELAY = 0x18
staticprivate

◆ LASER_MOD_PULSE_WIDTH

const byte WasatchNET.SPISpectrometer.LASER_MOD_PULSE_WIDTH = 0x1E
staticprivate

◆ LASER_MODULATION

const byte WasatchNET.SPISpectrometer.LASER_MODULATION = 0x33
staticprivate

◆ LASER_ON

const byte WasatchNET.SPISpectrometer.LASER_ON = 0x34
staticprivate

◆ LASER_POWER_RAMP

const byte WasatchNET.SPISpectrometer.LASER_POWER_RAMP = 0x3B
staticprivate

◆ LASER_TEMP

const byte WasatchNET.SPISpectrometer.LASER_TEMP = 0x1D
staticprivate

◆ LASER_TEMP_SET_POINT

const byte WasatchNET.SPISpectrometer.LASER_TEMP_SET_POINT = 0x16
staticprivate

◆ LASER_TRANSITION_1

const byte WasatchNET.SPISpectrometer.LASER_TRANSITION_1 = 0x21
staticprivate

◆ LASER_TRANSITION_2

const byte WasatchNET.SPISpectrometer.LASER_TRANSITION_2 = 0x22
staticprivate

◆ LASER_TRANSITION_3

const byte WasatchNET.SPISpectrometer.LASER_TRANSITION_3 = 0x23
staticprivate

◆ LASER_TRANSITION_4

const byte WasatchNET.SPISpectrometer.LASER_TRANSITION_4 = 0x24
staticprivate

◆ LASER_TRANSITION_5

const byte WasatchNET.SPISpectrometer.LASER_TRANSITION_5 = 0x25
staticprivate

◆ LASER_TRANSITION_6

const byte WasatchNET.SPISpectrometer.LASER_TRANSITION_6 = 0x26
staticprivate

◆ LAST_PIXEL_CRC16

const byte WasatchNET.SPISpectrometer.LAST_PIXEL_CRC16 = 0x3F
staticprivate

◆ mpsse

MpsseDevice WasatchNET.SPISpectrometer.mpsse
package

◆ PREP_FPGA

const byte WasatchNET.SPISpectrometer.PREP_FPGA = 0x30
staticprivate

◆ READ_EEPROM_BUFFER

const byte WasatchNET.SPISpectrometer.READ_EEPROM_BUFFER = 0x31
staticprivate

◆ RESET_FPGA

const byte WasatchNET.SPISpectrometer.RESET_FPGA = 0x0B
staticprivate

◆ SELECT_USB_FS

const byte WasatchNET.SPISpectrometer.SELECT_USB_FS = 0x32
staticprivate

◆ SET_CCD_GAIN

const byte WasatchNET.SPISpectrometer.SET_CCD_GAIN = 0x94
staticprivate

◆ SET_CCD_OFFSET

const byte WasatchNET.SPISpectrometer.SET_CCD_OFFSET = 0x93
staticprivate

◆ SET_INTEGRATION_TIME

const byte WasatchNET.SPISpectrometer.SET_INTEGRATION_TIME = 0x91
staticprivate

◆ SET_SETTINGS

const byte WasatchNET.SPISpectrometer.SET_SETTINGS = 0x92
staticprivate

◆ specIndex

int WasatchNET.SPISpectrometer.specIndex
package

◆ spi

SpiDevice WasatchNET.SPISpectrometer.spi
package

◆ STANDARD_PADDING

const int WasatchNET.SPISpectrometer.STANDARD_PADDING = 40
staticprivate

◆ START_CMD

const byte WasatchNET.SPISpectrometer.START_CMD = 0x3C
staticprivate

◆ TRIGGER_DELAY

const byte WasatchNET.SPISpectrometer.TRIGGER_DELAY = 0x28
staticprivate

◆ WRITE_EEPROM_BUFFER

const byte WasatchNET.SPISpectrometer.WRITE_EEPROM_BUFFER = 0xB1
staticprivate

Property Documentation

◆ batteryCharging

override bool WasatchNET.SPISpectrometer.batteryCharging
get

◆ batteryPercentage

override float WasatchNET.SPISpectrometer.batteryPercentage
get

◆ boxcarHalfWidth

override uint WasatchNET.SPISpectrometer.boxcarHalfWidth
getset

Perform post-acquisition high-frequency smoothing by averaging together "n" pixels to either side of each acquired pixel; zero to disable (default).

Implements WasatchNET.ISpectrometer.

◆ detectorGain

override float WasatchNET.SPISpectrometer.detectorGain
getset

Maps to an FPGA register inside the spectrometer used to scale pixels read from the ADC to optimize dynamic range.

Not normally changed by customer code. Values are normally read from the EEPROM and written back to the spectrometer's FPGA by the driver at initialization.

Altering this value may degrade spectrometer performance.

Implements WasatchNET.ISpectrometer.

◆ detectorGainOdd

override float WasatchNET.SPISpectrometer.detectorGainOdd
getset

(InGaAs-only) Companion property to detectorGain, which on InGaAs detectors applies only to even-numbered pixels.

Implements WasatchNET.ISpectrometer.

◆ detectorOffset

override short WasatchNET.SPISpectrometer.detectorOffset
getset

Maps to an FPGA register inside the spectrometer used to offset the pixels (dark baseline) read from the ADC to optimize dynamic range.

Not normally changed by customer code. Values are normally read from the EEPROM and written back to the spectrometer's FPGA by the driver at initialization.

Altering this value may degrade spectrometer performance.

Implements WasatchNET.ISpectrometer.

◆ detectorOffsetOdd

override short WasatchNET.SPISpectrometer.detectorOffsetOdd
getset

(InGaAs-only) Companion property to detectorOffset, which on InGaAs detectors applies only to even-numbered pixels.

Implements WasatchNET.ISpectrometer.

◆ detectorTECEnabled

override bool WasatchNET.SPISpectrometer.detectorTECEnabled
getset

◆ detectorTECSetpointDegC

override float WasatchNET.SPISpectrometer.detectorTECSetpointDegC
getset

◆ detectorTECSetpointRaw

override ushort WasatchNET.SPISpectrometer.detectorTECSetpointRaw
getset

◆ detectorTemperatureDegC

override float WasatchNET.SPISpectrometer.detectorTemperatureDegC
get

◆ excitationWavelengthNM

override float WasatchNET.SPISpectrometer.excitationWavelengthNM
get

◆ firmwareRevision

override string WasatchNET.SPISpectrometer.firmwareRevision
get

◆ fpgaRevision

override string WasatchNET.SPISpectrometer.fpgaRevision
get

◆ hasLaser

override bool WasatchNET.SPISpectrometer.hasLaser
get

◆ highGainModeEnabled

override bool WasatchNET.SPISpectrometer.highGainModeEnabled
getset

◆ integrationTimeMS

override uint WasatchNET.SPISpectrometer.integrationTimeMS
getset

Current integration time in milliseconds.

Implements WasatchNET.ISpectrometer.

◆ isARM

override bool WasatchNET.SPISpectrometer.isARM
get

◆ isInGaAs

override bool WasatchNET.SPISpectrometer.isInGaAs
get

◆ laserEnabled

override bool WasatchNET.SPISpectrometer.laserEnabled
getset

Whether the laser has been REQUESTED TO FIRE by the software and firmware.

Implements WasatchNET.ISpectrometer.

◆ laserInterlockEnabled

override bool WasatchNET.SPISpectrometer.laserInterlockEnabled
get

True if the laser can fire (interlock circuit is CLOSED), false if the laser cannot fire (interlock circuit is OPEN).

Requires FeatureMask.HAS_INTERLOCK_FEEDBACK.

Implements WasatchNET.ISpectrometer.

◆ laserModulationPeriod

override UInt64 WasatchNET.SPISpectrometer.laserModulationPeriod
get

When defining the laser modulation duty cycle, the length (period) of the duty cycle in microsec.

Warning: Laser modulation commands are normally internally set by the function setLaserPowerPercentage().

     Value is in microseconds, range 40bit.</remarks> 

Implements WasatchNET.ISpectrometer.

◆ laserPowerResolution

override LaserPowerResolution WasatchNET.SPISpectrometer.laserPowerResolution
get

◆ laserTemperatureDegC

override float WasatchNET.SPISpectrometer.laserTemperatureDegC
get

convert the raw laser temperature reading into degrees centigrade

Returns
laser temperature in °C

https://www.ipslasers.com/data-sheets/SM-TO-56-Data-Sheet-IPS.pdf

Laser temperature conversion doesn't use EEPROM coeffs at all. Most Wasatch Raman systems use an IPS Wavelength-Stabilized TO-56 laser, which internally uses a Betatherm 10K3CG3 thermistor.

The official conversion from thermistor resistance (in ohms) to degC is:

1 / ( C1

  • C2 * ln(ohms)
  • C3 * pow(ln(ohms), 3) )

273.15

Where: C1 = 0.00113 C2 = 0.000234 C3 = 8.78e-8

Early Dash / ENLIGHTEN implementations used a simpler curve-fit which yielded nearly identical performance.

Implements WasatchNET.ISpectrometer.

◆ laserTemperatureRaw

override ushort WasatchNET.SPISpectrometer.laserTemperatureRaw
get

Synonym for primaryADC.

selectedADC primaryADC

Implements WasatchNET.ISpectrometer.

◆ laserTemperatureSetpointRaw

override byte WasatchNET.SPISpectrometer.laserTemperatureSetpointRaw
get

FACTORY ONLY.

WARNING: raising this value above 63 will "increase temperature AND volatility", while lowering this value below 63 will "decrease temperature WHILE increasing volatility".

During factory turning of the potentiometer on the laser driver controller board, this function is used to temporarily offset the TEC DAC setpoint from its default power-up value of 63.

End-users should not adjust this value at runtime, as the potentiometer has already been locked-down at a point optimized for laser power stability over temperature; any changes to this value from the default value of 63 will only increase the chances of power instability, including mode-hopping and hysteresis effects.

See RamanSpecCal's LaserTemperatureTest documentation for additional information.

Note that input values will automatically be capped at 7-bit (0, 127), the operative range of the laser TEC DAC.

Also note that although this property includes the word "temperature" because the setpoint relates to and will change the laser's central temperature, you cannot set a specific temperature setpoint in degC, as the final temperature is generated in hardware as a combination of the DAC setpoint value and the physical potentiometer.

Implements WasatchNET.ISpectrometer.

◆ secondaryADC

override ushort WasatchNET.SPISpectrometer.secondaryADC
get

This is provided for spectrometers with a secondary ADC connected to an external laser, photodiode or what-have-you. Attempts to read it on spectrometers where it has not been configured can result in indeterminate behavior; therefore, hasSecondaryADC is provided to allow callers to selectively enable this function if they believe they are using supported hardware.

Implements WasatchNET.ISpectrometer.

◆ serialNumber

override string WasatchNET.SPISpectrometer.serialNumber
get

spectrometer serial number

Implements WasatchNET.ISpectrometer.

◆ triggerSource

override TRIGGER_SOURCE WasatchNET.SPISpectrometer.triggerSource
getset

Whether acquisitions are triggered "internally" (via the ACQUIRE opcode sent by software) or "externally" (via an electrical signal wired to the accessory connector).

Implements WasatchNET.ISpectrometer.


The documentation for this class was generated from the following file: