Description: Sets the NCL integration time in milliseconds Parameters:
Itime The integration time to be input in milliseconds Result: 0 An invalid request
!0 A valid request Definitions:
Delphi
Function setNCLITime(Itime:Integer):Integer; safecall; Microsoft IDL
[id(0x00000018)]
HRESULT setNCLITime(
[in] long ITime,
[out, retval] long* ValidRequest); Visual Basic Sample Code
Private Sub ITimeSetBtn_Click() Dim newITime As Long
‘ set the NCL ITime
If SpectraSense_COM.setNCLITime(newITime) = 0 Then MsgBox (“Error : unable to set ITime”)
End If
Delphi Sample Code
var newITime : Integer; // set the NCL ITime
if SpectraSenseServer.setNCLITime(newITime) = 0 then ShowMessage(‘Error : unable to set ITime’);
SpectraSense Software Developer’s Kit User’s Guide 121
setNCLMathParams
This function is used to set up the real time mathematical treatment of the data as it is being collected. This function only works with scanning spectral acquisition. To set up the mathematical treatment of time based acquisition, first set up a routine in SpectraSense and then use the LoadRoutine function to input the parameters.
Description: This function sets up the real-time processing parameters Parameters: FileOp 0 Channel 1 Channel/Ref 2 Channel – Ref 3 Absorbance 4 Reflectance 5 Transitance 6 All Channels
FileOpCn Channel to operated on 1,2, or 3
FileName The name of the file to be used as a reference LoadRefFileParams 0 No !0 Yes LoadRefFileSilent 0 No !0 Yes SourceCompensate 0 No !0 Yes
CompCh The number of the channel used for source compensation; 1, 2, or 3 DarkSubtract0 No
!0 Yes
Result: 0 An invalid request !0 A valid request
Definitions: Delphi
Function setNCLMathParams( FileOp: Integer; FileOpCh: Integer; FileName: OleVariant; LoadRefFileParams: Integer; LoadRefFileSilent: Integer; SourceCompensate: Integer; CompCh: Integer; DarkSubtract: Integer; ): Integer; safecall; Microsoft IDL [id(0x00000038)] HRESULT setNCLMathParams(
[in] long FileOp, [in] long FileOpCh, [in] VARIANT FileName, [in] long LoadRefFileParams, [in] long LoadRefFileSilent, [in] long SourceCompensate, [in] long CompCh,
[in] long DarkSubtract,
SpectraSense Software Developer’s Kit User’s Guide 123
Visual Basic Example Code
Dim FileOpType As Long ‘ 0 = ch ‘ 1 = ch / ref ‘ 2 = ch - ref ‘ 3 = absorbance, log(ref/ch) ‘ 4 = Reftectance, 100 * (ch / ref) ‘ 5 = Transmittance, 100 * (ch / ref) ‘ 6 = all channels
Dim FileOpCh As Long ‘ the number of the channel to use (1,2 or 3) Dim newFileName As String ‘ the file name of ref, pass “ if not used Dim FileVar As Variant ‘ the file name of ref, pass “ if not used Dim FileLower As String
Dim FileParams As Long ‘ 0 = just load the file data
‘ <> 0 (use 1) = load the ref file scan params, if possible Dim QuietFileLoad As Long ‘ 0 = verbose load
‘ 1 = silent load
Dim SourceComp As Long ‘ 0 = no source compensation
‘ <> 0 (use 1) source compensation (ch above = FileOpCh / CompCh) Dim CompCh As Long ‘ the number of the channel to use (1,2, or 3)
Dim DarkSub As Long ‘ 0 = do not take a dark reading
‘ <> 0 (use 1) take a dark reading and subtract it from the raw readings
FileParams = NCLRTLoadRefParamsChk.Value FileVar = “C:foodata.arc_data
QuietFileLoad = NCLRTRefSilentLoadChk.Value
If SpectraSense_COM.setNCLMathParams(FileOpType, FileOpCh, _
FileVar, FileParams, QuietFileLoad, _ SourceComp, CompCh, _
DarkSub) _ = 0 Then ‘ a 0 result is it failed
MsgBox (“Failed to set NCL Math Parameters!”) End If
Delphi Example Code
var FileOpType : integer; // 0 = ch // 1 = ch / ref // 2 = ch - ref // 3 = absorbance, log(ref/ch) // 4 = Reftectance, 100 * (ch / ref) // 5 = Transmittance, 100 * (ch / ref) // 6 = all channels
FileOpCh : integer; // the number of the channel to use (1,2 or 3) newFileName : string; // the file name of ref, pass “ if not used FileVar : OLEVariant; // the file name of ref, pass “ if not used FileParams : integer; // 0 = just load the file data
// <> 0 (use 1) = load the ref file scan params, if possible QuietFileLoad : integer; // 0 = verbose load
// 1 = silent load
SourceComp : integer; // 0 = no source compensation
// <> 0 (use 1) source compensation (ch above = FileOpCh / CompCh) CompCh : integer; // the number of the channel to use (1,2, or 3)
DarkSub : integer; // 0 = do not take a dark reading
// <> 0 (use 1) take a dark reading and subtract it from the raw readings
begin
if SpectraSenseServer.setNCLMathParams(FileOpType,FileOpCh,
FileVar,FilePArams,QuietFileLoad, SourceComp,CompCh,
DarkSub) = 0 // a 0 result is it failed then showmessage(‘Failed to set NCL Math Parameters!’);
setNCLOutputLine
Description: Sets the state of a specific NCL output line Parameters:
Line_Num Valid line number (1- 4)
LineState 0 Not set
!0 Set
Results 0 An invalid request
!0 A valid request Definitions:
Delphi
Function setNCLOutputLine( Line_Num; Integer; LineState: Integer ): Integer; safecall; Microsoft IDL
Visual Basic Sample Code
If SpectraSense_COM.setNCLOutputLine(1, 0) = 0 Then MsgBox (“Failed to set output line 1”)
End If
Delphi Sample Code
// turn on output line 1
if SpectraSenseServer.setNCLOutputLine(1,1) = 0 then showmessage(‘Failed to set output Line 1’);
SpectraSense Software Developer’s Kit User’s Guide 125
setNCLScanParams
This function will input scan parameters of a scanning single channel acquisition. Create a time based acquisition routine in SpectraSense and use the function LoadRoutine for time based acquisitions. Description: Input the scanning parameters for a spectral based scanning acquisition Parameters:
Mono1Start The starting wavelength for monochromator 1 (uses current spectral units) Mono1Stop The ending wavelength for monochromator 1
Mono1Inc The increment in spectral units between data points Mono2Start The starting wavelength for monochromator 2 Mono2Stop The ending wavelength for monochromator 2
BackwardsExcite Scans the monochromator used for excitation from high to low wavelength ReadsPerPoint The number of readouts averaged at each position. Valid options are 1, 3, 10 NumCycles The number of times each scan will be taken
IntervalBetweenCycles: The time between the end of one scan and the start of the next in msec. FilenameFormat 0 Post Fixed increment
1 Pre Fixed increment 2 Signal averaged
3 SPC multifile (Valid only with Grams enabled software) 4 Time Stamped
Result: 0 An invalid request !0 A valid request
Definitions: Delphi
Function setNCLScanParams( Mono1Start: Double; Mono1Stop: Double; Mono1Inc: Double; Mono2Start: Double; Mono2Stop: Double; Mono2Inc: Double; BackwardsExcite: Integer; ReadsPerPoint: Integer; NumCycles: Integer; IntervalBetweenCycles: Integer; FileNameFormat: Integer; ): Integer; safecall; Microsoft IDL [id(0x00000037)] HRESULT setNCLScanParams(
[in] double Mono1Start, [in] double Mono1Stop, [in] double Mono1Inc, [in] double Mono2Start, [in] double Mono2Stop, [in] double Mono2Inc, [in] long BackwardsExcite, [in] long ReadsPerPoint, [in] long NumCycles,
[in] long IntervalBetweenCycles, [in] long FileNameFormat, [out, retval] long* ValidRequest); Visual Basic Sample Code
Dim Mono1Start As Double Dim Mono1Stop As Double Dim Mono1Inc As Double
SpectraSense Software Developer’s Kit User’s Guide 127 ReadPerPoint = 1 ‘ This can not have a zero value. Only 1, 3, and 10 are valid NumCycles = 2 ‘ This can not have a zero value
IntervalBetweenCycles = 10000 ‘ Entering 0 here will cause the spectrometer to
FileNameFormat = 1 ‘ the start position and immediately start the next cycle.
‘With the above values, monochromator 1 will scan between 500 and 600(nm) with a ‘5nm increment between data points. The second monochromator will go to 300nm at the
‘the beginning of the scan and stay there. Only one integration will be taken at each point. ‘Two cycles(spectra)will be acquired with a 10 second delay between the end of the first ‘and the start of the second. The two files will be named “whatever01.___” and “whatever02.___” if SpectaSense_COM.setNCLScanParams( mono1Start,Mono1Stop,Mono1Inc,Mono2Start,Mono2Stop,
mono2Inc,BackwardsExcite,ReadsPerPoint,NumCycles, IntervalBetweenCycles,FileNameFormat) <>0 then Label2.Caption = “Set up parameters loaded!”
End if
‘The same function could be written as:
If SpectraSense_COM.setNCLScanParams(500,600,5,300,0,0,0,1,2,10000,1)<>0 then MsgBox (“Set up Parameters”)
End if
Delphi Example Code
Var Mono1Start: Integer; Mono1Stop:Integer; Mono1Inc: Integer; Mono2Start: Integer; Mono2Stop: Integer; Mono2Inc: Integer; BackwardsExcite: Integer
ReadPerPoint: Integer; \\ This can not have a zero value NumCycles: Integer; \\ This can not have a zero value IntervalBetweenCycles: Integer;
FileNameFormat: Integer;
// load the scan parameters
if spectraSenseServer.setCCDMathParams( AreaOp,AreaOpNum,FileOp,
varFileName,CosmicCorrect, DarkSubtract,SoftwareBin) = 0 // a zero result is failed
setNCLScanType
This function is used to set up spectral scanning parameters using the NCL and a single channel detector. Time based acquisition in not yet implemented in this function. For time based acquisition first create a routine in SpectraSense and save it. Then use the LoadRoutine function to set up the acquisition parameters.
Description: Sets up the type of single channel acquisition to be taken. Parameters:
Scan_Value 0 No scan defined
1 Time Based (Not implemented) 2 Scan Mono1 Only
3 Scan Mono2 Only
4 Synchronized scan of mono1 and mono2
5 Excitation/emission scan: scan mono1 step mono2 after each scan 6 Excitation/emission scan: scan mono2 step mono1 after each scan Result: 0 an invalid request
!0 a valid request Definitions:
Delphi
Function setNCLScanType( Scan_Value: Integer ): Integer; safecall; Microsoft IDL
[id(0x00000035)]
HRESULT setNCLScanType(
[in] long Scan_Value,
[out, retval] long* ValidRequest); Visual Basic Sample Code
If SpectraSense_COM.setNCLScanType(2)<>0 then
Label2.Caption = “You’re set up to scan just monochromator 1” End if
SpectraSense Software Developer’s Kit User’s Guide 129
setNCLShutterPosition
Description: Opens or closes the specified shutter. This function is valid only with an NCL shutter and will not work with a CCD Parameters:
ShutterNum The number of the shutter that is being controlled
Open 0 close
1 open
Result 0 An invalid request
!0 A valid request Note:Not valid with CCD shutters
Definitions: Delphi
Function setNCLShutterPosition( shutternum: Integer; Open: Integer): Integer; safecall; Microsoft IDL
[id(0x00000042)]
HRESULT setNCLShutterPosition(
[in] long ShutterNum, [in] long Open, [out, retval] long*
ValidResult); Visual Basic Sample Code
Dim ShutterNum As Long Dim MoveShutter As Long
If SpectraSense_COM.setNCLShutterPosition(ShutterNum, MoveShutter) = 0 Then MsgBox (“Error : unable to set shutter position”)
End If
Delphi Sample Code
var ShutterNum : integer; var MoveShutter: integer; // set the CCD ITime
if SpectraSenseServer.setNCLShutterPosition(Sutternumber, Moveshutter) = 0 then showmessage(‘Error : unable to set shutter position);