Control library for M833 The list of files: - M833.dll - InstrumentManipulator_M833.dll - sls_si_ctrl_bk.dll - SpUsb01.dll - SpUsb01.cnf - SLS_SI_Calc.dll - libgfl211.dll - SpUSB.ini - InstrumentCfg_M833.xml Import libraries: For Delphi: - M833_i.pas For C++: - M833_i.h - M833.lib The control library MSA833.dll contains the following functions. function M833_Init(hAppWnd: HWND; hIcon: DWORD; bDemo: BOOL = False): BOOL; stdcall; The function M833_Init initializes instrument control module. It should be invoked before using all other functions from this library. Parameters hAppWnd - the window handle of the main window of the application. hIcon - the icon handle of the application bDemo - if the parameter is True then instrument control module is started in demo mode, without an instrument. If the function succeeds, the return value is True. If the function fails, the return value is False. procedure M833_Final; stdcall; The function M833_Final finalizes instrument control module. It should be invoked when the application is closing. procedure M833_ShowWnd; stdcall; The function M833_ShowWnd shows the instrument control window. function M833_ResetGrating: BOOL; stdcall; The function M833_ResetGrating sets the grating in initial position. If the function succeeds, the return value is True. If the function fails, the return value is False. function M833_SetWL(wl: double; bReset: BOOL; iGr: integer): BOOL; stdcall; The function M833_SetWL sets the required wavelength. Parameters wl - the wavelength in nanometers; bReset - if value is True then - before to set the required wavelength the grating is set to initial position. iGr - the index of grating (for instrument with several gratings). The parameter id used for grating selecting. if iGr equal to -1 then wavelength is set for current grating. If the function succeeds, the return value is True. If the function fails, the return value is False. function M833_GetWL: double; stdcall; The function M266_GetWL returns a current wavelength. function M833_GetStatus: DWORD; stdcall; The function M833_GetStatus is used to check the status of instrument during a control operation(new wavelength setting) is performed. It can return one of the following constants: STATUS_READY - the instrument is ready to perform next control operation (new wavelength setting) STATUS_EXECUTE - the control operation is executed STATUS_ERROR - some error is occurred at executing time This function should be invoked by cycle after start new control operation. function M833_IsValidWL(wl: double): BOOL; stdcall; The function M833_IsValidWL can be used to check wavelength value. Parameter wl - wavelength in nanometers. If the wavelength value is in permissible wavelength range then the return value is True. If the wavelength value is out of permissible wavelength range then the return value is False. function M833_SetSlitWidth(slitID: DWORD; width: double; bReset: BOOL): BOOL; stdcall; The function M833_SetSlitWidth sets new width of slit. Parameters: slitID - slit identifier. It can take one of following constants: ID_ENTRANCE_SLIT_1 = 1 ID_EXIT_SLIT_1 =2 ID_ENTRANCE_SLIT_2 = 3 ID_EXIT_SLIT_2 =4 width - slit width in micrometers. bReset - if value is True then - before to set the required slit width the slit is set to initial position. If the function succeeds, the return value is True. If the function fails, the return value is False. function M833_GetSlitWidth(slitID: DWORD): double; stdcall; The function M833_GetSlitWidth returns the current value of slit width. Parameters: slitID - slit identifier. It can take one of following constants: ID_ENTRANCE_SLIT_1 = 1 ID_EXIT_SLIT_1 =2 ID_ENTRANCE_SLIT_2 = 3 ID_EXIT_SLIT_2 =4 function M833_SetMirror(mirrorID : DWORD; dwPos: DWORD): BOOL; stdcall; The function M833_SetMirror sets the mirror position. Parameters: mirrorID - mirror identifier. It can take one of following constants: ID_ENTRANCE_MIRROR_1 =1 ID_EXIT_MIRROR_2 =2 The parameter dwPos can take one of the following constants: MRP_AXIAL - the mirror position for axial port; MRP_LATERAL - the mirror position for lateral port. If the function succeeds, the return value is True. If the function fails, the return value is False. function M833_GetMirror(mirrorID : DWORD): DWORD; stdcall; The function M833_GetMirror is used to check current mirror position. Parameters: mirrorID - mirror identifier. It can take one of following constants: ID_ENTRANCE_MIRROR_1 =1 ID_EXIT_MIRROR_2 =2 It can return one of the following constants: MRP_AXIAL - the mirror position for axial port MRP_LATERAL - the mirror position for lateral port function M833_SetFilter(FilterID : DWORD; iPos: integer): BOOL; stdcall; The function M833_SetFilter sets the filter position. Parameters: filterID - filter identifier. It can take one of following constants: ID_FILTER_1 = 1 ID_FILTER_2 = 2 The parameter iPos - index of filter on the filter wheel. If the function succeeds, the return value is True. If the function fails, the return value is False. function M833_GetFilter(FilterID: DWORD): DWORD; stdcall; The function M833_GetFilter returns an index of selected filter on the filter wheel Parameters: filterID - filter identifier. It can take one of following constants: ID_FILTER_1 = 1 ID_FILTER_2 = 2 If the function succeeds, the return value is more than -1. If the function fails, the return value is -1 function M833_ShutterOpen (shuttered : DWORD): BOOL; stdcall; The function M833_ShutterOpen sets the shutter in open position. Parameters: shutterID - shutter identifier. It can take one of following constants: ID_SHUTTER_1 = 1 ID_SHUTTER_2 = 2 If the function succeeds, the return value is True. If the function fails, the return value is False. function M833_ShutterClose (shuttered : DWORD): BOOL; stdcall; The function M833_ShutterClose sets the shutter in close position. Parameters: shutterID - shutter identifier. It can take one of following constants: ID_SHUTTER_1 = 1 ID_SHUTTER_2 = 2 If the function succeeds, the return value is True. If the function fails, the return value is False. function M833_SetActiveGrating(nIndGrating : integer) : BOOL; stdcall; The function M833_SetActiveGrating is used to set active grating index. Parameters nIndGrating - grating index (can get values 0, 1, 2) If the function succeeds, the return value is True. If the function fails, the return value is False. function M833_GetActiveGrating : integer; stdcall; The function M833_GetActiveGrating is used to get active grating index. Function return active grating index function M833_GetGratingCount : integer; stdcall; The function M833_GetGratingCount is used to get grating count in instrument. Function return grating count in instrument function M833_GetGratingPrm(nIndGrating : integer; var dGrooves, dMaxWL, dMinWL : double) : BOOL; stdcall; The function M833_GetGratingPrm is used to get grating parameters. Parameters nIndGrating - grating index, which params you want get dGrooves - grooves count for grating with index nIndGrating (return parameter) dMaxWL - max wavelength for grating with index nIndGrating (return parameter) dMinWL - min wavelength for grating with index nIndGrating (return parameter) If the function succeeds, the return value is True. If the function fails, the return value is False. function M833_GetDispersion: double; stdcall; The function M833_GetDispersion returns the current dispersion value. function M833_GetPixelClbr(dbCentrWL: double; iCentrPixel : integer; dbPxlWidth: double; iPixel : integer; var pxlWL : double): BOOL; stdcall; The function M833_GetPixelClbr is used to calculate the wavelength of requested pixel on CCD-line. Parameters dbCentrWL - the central wavelength in nanometers iCentrPixel - the index of central pixel on CCD-line dbPxlWidth - the pixel width of CCD-line in micrometer iPixel - the index of requested pixel pxlWL - the wavelength for requested pixel (calculated value) in nanometers. If the function succeeds, the return value is True. If the function fails, the return value is False. function M833_GetCalibration(dbCentrWL : double; iCentrPixel : integer; dbPxlWidth : double; nNumPixels: integer; pClbrArr : pointer): BOOL; stdcall; The function M833_GetCalibration is used to calibrate CCD-line by wavelengths. Parameters dbCentrWL - the central wavelength in nanometers iCentrPixel - the index of central pixel on CCD-line dbPxlWidth - the pixel width of CCD-line in micrometer nNumPixels - the number of pixels (length) of CCD-line pClbrArr - the pointer to array of wavelength calibration (calculated value). Each array item represents a wavelength for corresponding pixel of CCD-line. The array item with index 0 correspond to first pixel on CCD-line. The type of array is double. The length equal to parameter nNumPixels. If the function succeeds, the return value is True. If the function fails, the return value is False.