#pragma once #if !defined(DppApi_H) #define DppApi_H //-------------------------------------------------------------------------------------- // @doc DppApi // // Amptek _ DPP API Function Prototypes // // @module _ DppApi Introduction | Interface to the DPP Application functions. // // The DP4/PX4/DP5 Digital Pulse Processor API (DppApi) is the Application // Programming Interface Library for Amptek DP4, PX4 and DP5 Digital // Pulse Processors (DPPs). // // Copyright (c)2005, 2007, 2009 Amptek, All Rights Reserved // // @devnote Application programs invoke DppApi functions to establish // communication with DPP, control its operation, and retrieve data. // DppApi is distributed in two forms, as an object link library (.LIB) // or Dynamic Link Library (.DLL). The application executable programs (.EXE) // are created by linking the application code with one of these libraries // statically or dynamically (see Microsoft documentation about program linking). // The applications can be developed in C, Visual Basic or many other languages. // // @devnote Version: v20050729_1423 // // @head3 _ DppApi Introduction | // @index struct func | DppApi // //-------------------------------------------------------------------------------------- #include "stdafx.h" // @struct DPP_CONFIG_SETTINGS | DPP Configuration Settings Storage Type typedef struct _DPP_CONFIG_SETTINGS { //MCA Properties byte AcqMode; // @field acquisition mode 0=MCA,1=MCS byte MCSTimebase; // @field MCS timebase value (0-15) see CAcqMode byte MCAChannels; // @field number of channels 4=256,3=512,2=1024,1=2048,0=4096,5=8192 byte BufferSelect; // @field Holds Buffer Sel A&B,Buffer Sel Hardware,see DPPBufferSelect byte TTLGate; // @field gate input settings, determines events included/excluded from spectrum, see DPPGate byte SlowThreshold; // @field Slow ch threshold, Events w/amp lower not added to spectrum long PresetTime; // @field var holds preset time, used in usb long PresetCount; // @field preset count in selected channels, ch are set in SCA8 long SCA[8]; // @field SCA values, LL, UL, and Enable are stored together //Shaping Properties byte TimeToPeak; // @field TimeToPeak register setting byte Decimation; // @field decimation setting for pulse shaping byte FlatTop; // @field flatop register setting byte PUREnable; // @field pile-up rejection enabled byte FastThreshold; // @field Fast Ch Threshold, events w/fch amp below this are rejected byte RTDSlow; // @field Risetime Discrimination slow threshold byte RTDOn; // @field Turns RTD on, and sets the amplitude and timing thresholds byte RTDFast; // @field RTD Time Threshold,Events w/HWHM wider than this are rejected byte BLR; // @field Baseline Restoration, see udBLR.Value notes for values byte BaselineOn; // @field use autobaseline during detector reset //Gain PZ Properties byte CoarseGain; // @field stores current coarse gain value long FineGain; // @field stores current fine gain value long PoleZero; // @field pole zero adjust value long InputOffset; // @field input offset byte InputPolarity; // @field use InvertEnable during detector reset byte DetReset; // @field detector reset lockout period //Power Properties long TEC; // @field TEC temperature setting (displayed in Kelvin) byte HVEnabled; // @field high voltage setting enable long HV; // @field high voltage setting value byte PreampPower; // @field preamp power select value (5v or 8.5v) //Misc Properties byte AnalogOut; // @field dac enabled and DAC output type,(stobed peak,shaped pulse,dec inp,fast ch) byte OutputOffset; // @field Output DAC offset, -64…+63,(signed)(D7-D1) (-500mV to +492mV) byte AuxOut; // @field Aux output type byte AudibleCounter; // @field audio volume setting } DPP_CONFIG_SETTINGS, *LP_DPP_CONFIG_SETTINGS; // @struct DPP_STATUS | DPP Status Storage Type typedef struct _DPP_STATUS { // Identification double FPGA; // @field FPGA double Firmware; // @field firmware revision double SerialNumber; // @field unit serial number byte StatDevInd; // @field device indicator from status block (0=dp4,1=px4) // Configuration byte BootStatus; // @field boot status byte (PwrBtnConfig,SwConfigRcvd,McaEnabled) byte PwrBtnConfig; // @field dpp has loaded config from power button byte SwConfigRcvd; // @field software has sent valid config to unit since startup // Tuning byte SetFastThreshDone; // @field DPP tune fast thresh has successfully done byte SetSlowThreshDone; // @field DPP tune slow thresh has successfully done (NOT USED) byte SetInputOffsetDone; // @field DPP tune input offset has successfully done // Monitors double BoardTemp; // @field board temperature monitor value double HVMonitor; // @field high voltage monitor value double TECMonitor; // @field TEC temperature monitor value (displayed in Kelvin) // Acquisition Parameters double FastCount; // @field fast channel count double SlowCount; // @field slow channel count double AccumulationTime; // @field real time duration of present data acquisition interval // Acquisition Mode byte StatMcaEnabled; // @field mca enabled status, high during acq, preset time resets flag byte MCSDone; // @field MCS done flag 1=finished, 0=not finished byte PresetCountExpired; // @field indicates presets counts have been reached } DPP_STATUS, *LP_DPP_STATUS; // @struct DPP_BOOT_STATUS | DPP Boot Options Status Storage Type typedef struct _DPP_BOOT_OPTIONS { USHORT BootFlags; // @field Boot flags (MSB currently unused) USHORT HVDACSet; // @field HV DAC setting (not used in PX4 mode) USHORT TECDACSet; // @field TEC DAC setting (not used in PX4 mode) USHORT InputOffsetTuning; // @field Input offset DAC setting (not used in PX4 mode) USHORT uCTempCal; // @field uC temp cal USHORT SpectrumOffset; // @field Spectrum offset } DPP_BOOT_OPTIONS, *LP_DPP_BOOT_OPTIONS; // ================================================================================= // === DppApi Constructor Functions ================================================ // ================================================================================= // @doc CONSTRUCT // // @module DppApi Constructor Functions | Opens the DPP Application functions. // // DppApi Constructor Functions create, initialize and close the DppApi. Opening the // DppApi with OpenDppApi creates and initializes an instance of the DppApi. The // DppApi instance manages and stores DPP data, configurations, and controls // communication. // // Copyright (c)2005, 2007 Amptek, All Rights Reserved // // @devnote All other DppApi functions need the DppApi to be opened before being // called. When all DppApi operations are completed and before the application // is closed, the DppApi must be closed with CloseDppApi. // // @head3 DppApi Constructor Functions | // @index func | CONSTRUCT //-------------------------------------------------------------------------------------- // @func Creates and initializes an instance of the DppApi. // @rdesc Returns an object pointer handle to the DppApi. void * __stdcall OpenDppApi(); // @func Closes the current instance of the DppApi. void __stdcall CloseDppApi( void * objptr) // @parm Pointer to the DppApi. ; // ================================================================================= // === USB Manager Functions ======================================================= // ================================================================================= // @doc USB // // @module USB Manager Functions | USB Manager Functions provide USB device control. // // USB Manager Functions provide USB device control. All USB communications to the // DPP require that the USB device be open for the corresponding DPP. When a USB // device is opened with OpenUSBDevice communications are opened to the DPP. All // USB functions are handled within the DppApi. // // Copyright (c)2005, 2007 Amptek, All Rights Reserved // // @devnote Once all USB operations are completed and before the DppApi is closed // the USB device should be closed with CloseUSBDevice. The number of USB device // connections can be monitored with MonitorUSBDppDevices. If a device has been // disconnected, MonitorUSBDppDevices will indicate the number of devices has // decreased and appropriate action can be taken. // // @head3 USB Manager Functions | // @index func | USB //-------------------------------------------------------------------------------------- // @func Opens the USB current device for communications. // @rdesc Returns the number of Amptek USB devices detected. int __stdcall OpenUSBDevice( void * objptr) // @parm Pointer to the DppApi. ; // @func Opens the USB selected device for communications. // @rdesc Returns the number of Amptek USB devices detected. int __stdcall OpenUSBDeviceEx( void * objptr, // @parm Pointer to the DppApi. long Device) // @parm selected USB DPP device ; // @func Closes the USB current device for communications. void __stdcall CloseUSBDevice( void * objptr) // @parm Pointer to the DppApi. ; // @func Monitors the USB current device to determine if connected and communicating. // @rdesc Returns the number of Amptek USB devices detected. int __stdcall MonitorUSBDppDevices( void * objptr) // @parm Pointer to the DppApi. ; // @func Get device information (serial number and type) for the selected usb device. // @rdesc Returns the type Amptek USB device detected. // // Amptek DPP USB devices // // DPPNONE = 0x0 // none // // DPPDP4 = 0x1 // DP4 // // DPPPX4 = 0x2 // PX4 // // DPPDP4EMUL = 0x3 // DP5 with DP4 Emulation // // DPPPX4EMUL = 0x4 // DP5 with PX4 Emulation (Same as DPPDP5) // // DPPDP5 = 0x4 // DP5 with PX4 Emulation // // int __stdcall GetUSBDppDeviceInfo( void * objptr, // @parm Pointer to the DppApi. long Device, // @parm selected USB DPP device long *lSerialNumber) // @parm serial number of device ; // ================================================================================= // === Configuration Transfer Functions ============================================ // ================================================================================= // @doc CONFIG // // @module Configuration Transfer Functions | Configuration Transfer Functions // provide device configuration services. // // Configuration Transfer Functions sets and transfers configurations to and // from the current DPP, the DppApi and selected Amptek DPP configuration files. // // Copyright (c)2005, 2007 Amptek, All Rights Reserved // // @devnote The DppApi and the current DPP must be configured before data // acquisition operations can begin. // // @head3 Configuration Transfer Functions | // @index func | CONFIG //-------------------------------------------------------------------------------------- // @func Loads the stored configuration from the DPP USB into the DppApi. void __stdcall GetConfigFromDpp( void * objptr) // @parm Pointer to the DppApi. ; // @func Sends the current configuration from the DppApi to the DPP USB. void __stdcall SendConfigToDpp( void * objptr) // @parm Pointer to the DppApi. ; // @func Loads the stored configuration read from the DPP (stored in a byte block) into the DppApi. void __stdcall GetConfigFromBuffer( void * objptr, // @parm Pointer to the DppApi. UCHAR ConfigBuffer[], // configuration buffer read from the dpp stored in a byte block byte DPPDeviceType) // the current device type (default is 1=DP4) ; // @func Sends the current configuration from the DppApi to a configuration buffer. void __stdcall SendConfigToBuffer( void * objptr, // @parm Pointer to the DppApi. UCHAR ConfigBuffer[], // dppapi configuration stored in a byte block long *Preset) // preset setting ; // @func Loads a configuration from a DPP configuration file into the DppApi. // @devnote DPP Device Type (1=DP4,2=PX4,3=DP5(DP4 Emulation),4=DP5(Px4 Emulation)) // If no device type or an invalid device type is selected, DPPDeviceType defaults to PX4. void __stdcall GetConfigFromFile( void * objptr, // @parm Pointer to the DppApi. LPWSTR pszFilename, // @parm Dpp configuration filename. LONG cSize, // @parm Character buffer size. byte DPPDeviceType) // @parm DPP Device Type ; // @func Sends the current configuration from the DppApi to a DPP configuration file. void __stdcall SaveConfigToFile( void * objptr, // @parm Pointer to the DppApi. LPWSTR pszFilename, // @parm Dpp configuration filename. LONG cSize) // @parm Character buffer size. ; // @func Creates display formatted copy of the current DppApi configuration. void __stdcall GetConfigString( void * objptr, // @parm Pointer to the DppApi. LPWSTR pszConfig, // @parm Configuration display string. LONG cSize) // @parm Character buffer size. ; // @func Copies selected configuration to a DPP_CONFIG_SETTINGS structure. // @devnote If UpdateCurrent is selected, the configuration is copied from the // current DppApi configuration settings. If UpdateCurrent is not selected, // the last temporary configuration storage is used. void __stdcall GetTempConfigSettings( void * objptr, // @parm Pointer to the DppApi. DPP_CONFIG_SETTINGS *CfgSet, // @parm Configuration settings. BOOLEAN CurrentUpdate) // @parm Current settings update. ; // @func Copies the selected settings from a DPP_CONFIG_SETTINGS data structure. // @devnote If UpdateCurrent is selected, the temporary configuration is also copied // to the current DppApi configuration settings. Current DppApi configuration settings // can be used to configure the DPP or be saved to a configuration file for storage. void __stdcall SetTempConfigSettings( void * objptr, // @parm Pointer to the DppApi. DPP_CONFIG_SETTINGS *CfgSet, // @parm Configuration settings. BOOLEAN CurrentUpdate) // @parm Current settings update. ; // @func Creates a display formatted copy of the temporary DppApi configuration. void __stdcall GetTempConfigString( void * objptr, // @parm Pointer to the DppApi. LPWSTR pszConfig, // @parm Configuration display string. LONG cSize) // @parm Character buffer size. ; // @func Gets FPGA 80MHz Clock Mode for DP5 only, returns true if is a DP5 and in 80MHz Mode. // @devnote The FPGA 80MHz Clock Mode indicator is set when a DPP status command is issued // and a DPP device is attached or when SetFPGAClockDefault sets this value. The DP5 FPGA 80MHz // Clock Mode must be set to correctly interpret DP5 configuration file settings. // long __stdcall Get80MHzMode( void * objptr) // @parm Pointer to the DppApi. ; // @func Sets FPGA 80MHz Clock Mode indicator for DP5 only // @devnote The DP5 FPGA 80MHz Clock Mode indicator must be set to correctly interpret // DP5 configuration file settings. The FPGA 80MHz Clock indicator is set when a // DPP status command is issued and a DPP device is attached or when SetFPGAClockDefault // sets this value. SetFPGAClockDefault is needed when editing DP5 configuration files without // a DP5 device. // void __stdcall SetFPGAClockDefault( void * objptr, // @parm Pointer to the DppApi. BOOLEAN b80MHzMode, // @parm 80MHz Mode indicator. byte DPPDeviceType) // @parm DPP Device Type. ; // ================================================================================= // === Status Indicator Functions ================================================== // ================================================================================= // @doc STATUS // // @module Status Indicator Functions | Status Indicator Functions monitor and // display DPP device information. // // Status information is read as a block of data and is converted into display values. // Status information includes device identification, spectrum accumulation status, // monitors, and boot status. // // Copyright (c)2005, 2007 Amptek, All Rights Reserved // // @head3 Status Indicator Functions | // @index func | STATUS //-------------------------------------------------------------------------------------- // @func Gets a copy of the current status and stores the data in a string. // @devnote A spectrum buffer (A or B) is selected to determine which group // of Spectrum Accumulation Status information to return. void __stdcall GetStatusString( void * objptr, // @parm Pointer to the DppApi. BOOLEAN isBufferA, // @parm Spectrum data buffer selector. LPWSTR pszStatus, // @parm Status character string. LONG cSize) // @parm Character buffer size. ; // @func Gets a copy of the current status and stores the data in a string. // @devnote A spectrum buffer (A or B) is selected to determine which group // of Spectrum Accumulation Status information to return. void __stdcall GetStatusStringFromBuffer( void * objptr, // @parm Pointer to the DppApi. BOOLEAN isBufferA, // @parm Spectrum data buffer selector. LPWSTR pszStatus, // @parm Status character string. LONG cSize, // @parm Character buffer size. UCHAR Status[]) // @parm Status buffer. ; // @func Requests the current DPP device and spectrum status raw data. // @devnote A spectrum buffer (A or B) is selected to determine which group // of Spectrum Accumulation Status information to return. void __stdcall GetStatusBuffer( void * objptr, // @parm Pointer to the DppApi. BOOLEAN isBufferA, // @parm Spectrum data buffer selector. UCHAR Status[]) // @parm Status buffer. ; // @func Returns the current DPP device and spectrum status data in a status structure. // @devnote A spectrum buffer (A or B) is selected to determine which group // of Spectrum Accumulation Status information to return. void __stdcall GetStatusStruct( void * objptr, // @parm Pointer to the DppApi. BOOLEAN isBufferA, // @parm Spectrum data buffer selector. DPP_STATUS *StatusStruct) // @parm Status structure. ; /////////////////////////////////////////////////////////////////////////////// // GetBootOptionsStruct - get the bott option settings of usb device, return in a boot options structure void __stdcall GetBootOptionsStruct(void * objptr, BOOLEAN isBufferA, DPP_BOOT_OPTIONS *BootOptionsStruct); // @func Returns the current DPP device and spectrum status data in a status structure. // @devnote A spectrum buffer (A or B) is selected to determine which group // of Spectrum Accumulation Status information to return. void __stdcall GetStatusStructFromBuffer( void * objptr, // @parm Pointer to the DppApi. BOOLEAN isBufferA, // @parm Spectrum data buffer selector. DPP_STATUS *StatusStruct, // @parm Status structure. UCHAR Status[]) // @parm Status buffer. ; // @func Processes raw status data and stores the status data in the DppApi. // @devnote The raw status data is read from the DPP by calling GetStatusBuffer. // ProcessStatusBuffer is used to update the DppApi to the current DPP status // without requesting status display information. void __stdcall ProcessStatusBuffer( void * objptr, // @parm Pointer to the DppApi. UCHAR Status[]) // @parm Status buffer. ; // @func Processes raw status data, stores the status data in the DppApi, // and returns a status display string. // @devnote The raw status data is read from the DPP by calling GetStatusBuffer. // DisplayStatusBuffer is used to update the DppApi to the current DPP status // and request status display information. void __stdcall DisplayStatusBuffer( void * objptr, // @parm Pointer to the DppApi. UCHAR Status[], // @parm Status buffer. LPWSTR pszStatus, // @parm Status character string. LONG cSize) // @parm Character buffer size. ; // @func Creates a MCA acquisition file string that includes all // configuration and status settings. // @devnote This function formats the additional information for MCA // spectrum file storage. This settings string is appended to the end of // the DPP MCA spectrum file after the spectrum data section. This // information is used by the Amptek acquisition software. void __stdcall CreateMCAFileDPPSettings( void * objptr, // @parm Pointer to the DppApi. LPWSTR pszSettings, // @parm DPP devices settings. LONG cSize) // @parm Character buffer size. ; // ================================================================================= // === Data Acquisition Functions ================================================== // ================================================================================= // @doc DATAACQ // // @module Data Acquisition Functions | Control data acquisition. // // Spectrum information is read as a block of data and is converted into // histogram ready display values. // // Copyright (c)2005, 2007 Amptek, All Rights Reserved // // @head3 Data Acquisition Functions | // @index func | DATAACQ //-------------------------------------------------------------------------------------- // @func Get the USB DPP spectrum data. // @rdesc Returns the number of spectrum channels. int __stdcall GetDppData( void * objptr, // @parm Pointer to the DppApi. long DataBuffer[]) // @parm Holds the DPP spectrum data. ; // @func Clears the USB DPP spectrum data. void __stdcall ClearDppData( void * objptr, // @parm Pointer to the DppApi. BOOLEAN isBufferA) // @parm Spectrum data buffer selector. ; // @func Pauses the USB DPP spectrum data. void __stdcall PauseDppData( void * objptr, // @parm Pointer to the DppApi. BOOLEAN boolPauseData) // @parm Pause the spectrum data. ; // @func Process the USB DPP spectrum data. // @rdesc Returns the number of spectrum channels. int __stdcall ProcessDppData( void * objptr, // @parm Pointer to the DppApi. long DataBuffer[], // @parm Holds the DPP spectrum data. UCHAR RawData[], // @parm Holds pre-processed spectra data. UINT ByteCount) // @parm Holds pre-processed spectra data byte count. ; // ================================================================================= // === Configuration Helper Functions ============================================== // ================================================================================= // @doc CFGHELPER // // @module Configuration Helper Functions | help in the display, control and // conversion of DPP configuration data. // // All of the configuration settings have underlying support classes. // Configuration Helper Functions tap some of the functionality of the underlying // classes. The goal is to reduce the amount of support coding necessary to a minimum. // // Copyright (c)2005, 2007 Amptek, All Rights Reserved // // @head3 Configuration Helper Functions | // @index func | CFGHELPER //-------------------------------------------------------------------------------------- // @func Creates an up-down spin control value from a coarse gain display string. void __stdcall GetCoarseGainSpinFromText( void * objptr, // @parm Pointer to the DppApi. byte *Spin, // @parm Up-down spin control setting. LPWSTR pszCoarseGain) // @parm Coarse gain value string. ; // @func Creates a coarse gain display string from a selected up-down spin control value. void __stdcall GetCoarseGainTextFromSpin( void * objptr, // @parm Pointer to the DppApi. byte Spin, // @parm Up-down spin control setting. LPWSTR pszCoarseGain, // @parm Coarse gain value string. LONG cSize) // @parm Character buffer size. ; // @func Creates an output offset display string from a selected up-down spin control value. void __stdcall GetOutputOffsetTextFromSpin( void * objptr, // @parm Pointer to the DppApi. byte Spin, // @parm Up-down spin control setting. LPWSTR pszOffset, // @parm Output offset value string. LONG cSize) // @parm Character buffer size. ; // @func Creates an up-down spin control value from an output offset display string. void __stdcall GetOutputOffsetSpinFromText( void * objptr, // @parm Pointer to the DppApi. byte *Spin, // @parm Up-down spin control setting. LPWSTR pszOffset)// @parm Output offset value string. ; // @func Creates a preset time display string from a preset time value. void __stdcall GetPresetTimeStringFromVal( void * objptr, // @parm Pointer to the DppApi. long lPresetTime, // @parm Preset time in tenths of a second. LPWSTR pszPresetTime, // @parm Preset time display string. LONG cSize) // @parm Character buffer size. ; // @func Calculates a preset time value from a preset time display string. void __stdcall GetPresetTimeValFromString( void * objptr, // @parm Pointer to the DppApi. long *lPresetTime, // @parm Preset time in tenths of a second. LPWSTR pszPresetTime) // @parm Preset time display string. ; // @func Creates slow threshold percent and channel display strings from an up-down spin control value. void __stdcall GetSlowThreshStringsFromSpin( void * objptr, // @parm Pointer to the DppApi. byte Spin, // @parm Up-down spin control setting. LPWSTR pszPercent, // @parm Slow threshold percent display string. LONG cSizePer, // @parm Size of the percent character buffer. LPWSTR pszChannels, // @parm Slow threshold channel position display string. LONG cSizeChan) // @parm Size of the channel character buffer. ; // @func Calculates the up-down spin control value for a given slow threshold percent value. void __stdcall GetSlowThreshSpinFromPercent( void * objptr, // @parm Pointer to the DppApi. double dblPercent, // @parm Slow threshold percent of full energy scale. byte *Spin) // @parm Up-down spin control setting. ; // @func Calculates the up-down spin control value for a given slow threshold channel value. void __stdcall GetSlowThreshSpinFromChannel( void * objptr, // @parm Pointer to the DppApi. double dblChannel, // @parm Slow threshold spectrum channel. byte *Spin) // @parm Up-down spin control setting. ; // @func Calculates the time-to-peak and decimation values from an up-down spin control value. void __stdcall GetTimeToPeakDecimationFromSpin( void * objptr, // @parm Pointer to the DppApi. byte *TimeToPeak, // @parm Time-to-peak value. byte *Decimation, // @parm Decimation value. byte Spin) // @parm Up-down spin control setting. ; // @func Converts a time-to-peak value to an up-down spin control setting. // @devnote When a time-to-peak value is known it may be necessary to remotely // set an up-down spin control. GetTimeToPeakSpinFromValues uses a time-to-peak // value a known decimation value to calculate the correct control setting. void __stdcall GetTimeToPeakSpinFromValues( void * objptr, // @parm Pointer to the DppApi. byte TimeToPeak, // @parm Time-to-peak value. byte Decimation, // @parm Decimation value. byte *Spin) // @parm Up-down spin control setting. ; // ================================================================================= // === PX4 Text Functions ========================================================== // ================================================================================= // @doc PX4TEXT // // @module PX4 Text Functions | Sets and reads text stored in the PX4. // // PX4 Text Functions works for PX4 with FPGA/Firmware Version 3.13 and above. // // Copyright (c)2005, 2007 Amptek, All Rights Reserved // // @head3 PX4 Text Functions | // @index func | PX4TEXT //-------------------------------------------------------------------------------------- // @func Sets the PX4 stored text. void __stdcall SetPX4Text( void * objptr, // @parm Pointer to the DppApi. LPWSTR pszPX4Text) // @parm PX4 text string. ; // @func Gets the PX4 stored text. void __stdcall GetPX4Text( void * objptr, // @parm Pointer to the DppApi. LPWSTR pszPX4Text, // @parm PX4 text string. LONG cSize) // @parm Character buffer size. ; // ================================================================================= // === DP5 Text Functions ========================================================== // ================================================================================= // @doc DP5TEXT // // @module DP5 Text Functions | Sets and reads text stored in the DP5. // // DP5 Text Functions works for DP5 only. // // Copyright (c)2005, 2009 Amptek, All Rights Reserved // // @head3 DP5 Text Functions | // @index func | DP5TEXT //-------------------------------------------------------------------------------------- // @func Sets the DP5 stored text. void __stdcall SetDP5Text( void * objptr, // @parm Pointer to the DppApi. LPWSTR pszDP5Text) // @parm DP5 text string. ; // @func Gets the DP5 stored text. void __stdcall GetDP5Text( void * objptr, // @parm Pointer to the DppApi. LPWSTR pszDP5Text, // @parm DP5 text string. LONG cSize) // @parm Character buffer size. ; // ================================================================================= // === DPP Tune Functions ========================================================== // ================================================================================= // @doc DPPTUNE // // @module DPP Tune Functions | Tunes the fast threshold (DP4/PX4/DP5) and // input offset (PX4/DP5 only). // // PX4 with FPGA/Firmware greater than Version 3.13 or DP4 with FPGA/Firmware greater // than Version 4.00 required. // // @devnote The source must be removed to auto tune the fast threshold. Status flags // are provided to indicate a tuning function successful completion. (See DPP_STATUS.) // // Copyright (c)2005-2009 Amptek, All Rights Reserved // // @head3 DPP Tune Functions | // @index func | DPPTUNE //-------------------------------------------------------------------------------------- // @func Tunes the fast threshold. // // @devnote The source must be removed before tuning the fast threshold. // // The status flag SetFastThreshDone is set (=TRUE) if the fast threshold tuning // was successful. If the fast threshold tuning was successful, the configuration // must be read back using GetConfigFromDpp to update the DppApi copy of // the configuration. // void __stdcall TuneFastThreshold( void * objptr) // @parm Pointer to the DppApi. ; // @func Sets initial values for PX4 input offset tuning. (PX4 only.) void __stdcall TuneInputOffsetInit( void * objptr) // @parm Pointer to the DppApi. ; // @func Tunes the input offset. (PX4/DP5 only.) // @devnote Input Offset MUST be properly set before running TuneInputOffset. // The initial input offset setting is based on the current input polarity and // polezero configuration settings. The TuneInputOffsetInit function checks // these values and sets the initial input offset value. // // The status flag SetInputOffsetDone is set (=TRUE) if the input offset tuning // was successful. If the input offset tuning was successful, the configuration // must be read back using GetConfigFromDpp to update the DppApi copy of // the configuration. // // (See the DppApi Reference and the PX4/DP5 Hardware Description for details.) // // Possible input offset tune start settings: // // SET TO -2.048V (= 0000) IF THE Input Polarity is NEGATIVE(-) and PoleZero > 0 // // SET TO -0.100V (= 1948) IF THE Input Polarity is NEGATIVE(-) and PoleZero = 0 // // SET TO +0.100V (= 2148) IF THE Input Polarity is POSITIVE(+) and PoleZero = 0 // // SET TO +2.042V (= 4090) IF THE Input Polarity is POSITIVE(+) and PoleZero > 0 // // void __stdcall TuneInputOffset( void * objptr) // @parm Pointer to the DppApi. ; // ================================================================================= // === DPP USB Additional Functions ================================================ // ================================================================================= // @doc DPPUSBADDFUNC // // @module DPP USB Additional Functions | Send Dpp USB Vendor Request (DP4/PX4/DP5). // // @devnote Additonal functions are available through Dpp USB Vendor Requests. // This is an advanced function and is not supported. See DP4/PX4/DP5 user manuals for // Vendor Request function details. // // Copyright (c)2005-2009 Amptek, All Rights Reserved // // @head3 DPP USB Additional Functions | // @index func | DPPUSBADDFUNC //-------------------------------------------------------------------------------------- // @func Sends a generic DPP Vendor Request to the default usb device. // // @devnote The function SendDppVendorRequest is determined by the Request parameter. // See DP4/PX4/DP5 user manuals for Vendor Request function details. // // Boot Option Vendor Requests: // // BootOptSetBootFlags = 0x92 //Set DP5 boot options // // BootOptSetPC5HV = 0x93 //Set PC5 HV // // BootOptPC5TECTemp = 0x94 //Set PC5 TEC temperature // // BootOptDP5InputOffset = 0x95 //Set DP5 input offset // // BootOptSetDP5uCtrADC = 0x96 //Set DP5 microcontroller ADC/Temperature calibration (RESERVED) // // BootOptSetDP5SpectrumOffset = 0x97 //Set DP5 spectrum offset // // void __stdcall SendDppVendorRequest( void * objptr, // @parm Pointer to the DppApi. int Request, // @parm Vendor request. int Value) // @parm Vendor request value. ; // ================================================================================= // === DppApi Setup Notes ============================================== // ================================================================================= // @doc DppApiSU // // @module DppApi Setup Notes | Additional setup notes. // // Application programs invoke DppApi functions to establish DPP communications, // control DPP operations, and retrieve spectrum data. The DppApi is distributed // with an import library (.LIB), and a dynamic link library (.DLL) and a type // library (.TLB). // // Applications can be developed with the DppApi in C, Visual Basic and many other // programming languages. // // The C language representation of DppApi functions are defined in the DppApi.h // header file. These files are provided with the DppApi libraries. The USB // drivers provided with your Amptek DPP must be installed and the usbdrvd.dll // must be accessible to the DppApi in order to function properly. // // Copyright (c)2005, 2007 Amptek, All Rights Reserved // // @head3 DppApi Setup Notes | // @index func | DppApiSU //-------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////// // PX4 Diode Calibration Functions /////////////////////////////////////////////////////////////////////////////// // SendDiodeCal - Sends a specified diode cal value to the default usb device // internal use only !!!! void __stdcall SendDiodeCalVal(void * objptr, int DCalVal); // GetDiodeCalVal - Gets the diode cal monitor value. This value is created during // status message processing. Status block must be processed before reading. void __stdcall GetDiodeCalVal(void * objptr, double *DblCalVal); #endif // !defined(DppApi_H)