diff --git a/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/Form1.Designer.cs b/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/Form1.Designer.cs index d3e8ff3..45ab4fd 100644 --- a/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/Form1.Designer.cs +++ b/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/Form1.Designer.cs @@ -39,9 +39,11 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series(); this.groupBox1 = new System.Windows.Forms.GroupBox(); @@ -199,9 +201,9 @@ private void InitializeComponent() this.label4.Location = new System.Drawing.Point(9, 114); this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(157, 20); + this.label4.Size = new System.Drawing.Size(162, 20); this.label4.TabIndex = 6; - this.label4.Text = "Centoid Position [µm]"; + this.label4.Text = "Centroid Position [µm]"; // // textBox_peakIntensitySlit1 // @@ -258,16 +260,28 @@ private void InitializeComponent() chartArea1.AxisY.Title = "Intensity [digits]"; chartArea1.Name = "ChartArea1"; this.chart25um.ChartAreas.Add(chartArea1); + legend1.BorderDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.NotSet; + legend1.LegendStyle = System.Windows.Forms.DataVisualization.Charting.LegendStyle.Column; + legend1.Name = "Legend1"; + legend1.Position.Auto = false; + legend1.Position.Height = 11.79775F; + legend1.Position.Width = 24.06015F; + legend1.Position.X = 74F; + legend1.Position.Y = 8F; + this.chart25um.Legends.Add(legend1); this.chart25um.Location = new System.Drawing.Point(18, 178); this.chart25um.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.chart25um.Name = "chart25um"; series1.ChartArea = "ChartArea1"; series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine; + series1.Legend = "Legend1"; series1.LegendText = "X"; series1.LegendToolTip = "Samples of the 25µm slit in x direction"; series1.Name = "Series1"; series2.ChartArea = "ChartArea1"; series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine; + series2.Legend = "Legend1"; + series2.LegendText = "Y"; series2.Name = "Series2"; this.chart25um.Series.Add(series1); this.chart25um.Series.Add(series2); @@ -288,14 +302,27 @@ private void InitializeComponent() chartArea2.AxisY.Title = "Intensity [digits]"; chartArea2.Name = "ChartArea1"; this.chart5um.ChartAreas.Add(chartArea2); + legend2.BorderDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.NotSet; + legend2.LegendStyle = System.Windows.Forms.DataVisualization.Charting.LegendStyle.Column; + legend2.Name = "Legend1"; + legend2.Position.Auto = false; + legend2.Position.Height = 11.79775F; + legend2.Position.Width = 24.06015F; + legend2.Position.X = 74F; + legend2.Position.Y = 8F; + this.chart5um.Legends.Add(legend2); this.chart5um.Location = new System.Drawing.Point(426, 178); this.chart5um.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.chart5um.Name = "chart5um"; series3.ChartArea = "ChartArea1"; series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine; + series3.Legend = "Legend1"; + series3.LegendText = "X"; series3.Name = "Series1"; series4.ChartArea = "ChartArea1"; series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine; + series4.Legend = "Legend1"; + series4.LegendText = "Y"; series4.Name = "Series2"; this.chart5um.Series.Add(series3); this.chart5um.Series.Add(series4); @@ -403,9 +430,9 @@ private void InitializeComponent() this.label9.Location = new System.Drawing.Point(9, 114); this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(157, 20); + this.label9.Size = new System.Drawing.Size(162, 20); this.label9.TabIndex = 6; - this.label9.Text = "Centoid Position [µm]"; + this.label9.Text = "Centroid Position [µm]"; // // textBox_peakIntensitySlit2 // diff --git a/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/Form1.cs b/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/Form1.cs index 5ccb7f4..ac9d751 100644 --- a/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/Form1.cs +++ b/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/Form1.cs @@ -1,20 +1,22 @@ // Title: BP209 2D Reconstruction C Sharp Example. // Created Date: 2024 - 10 - 12 -// Last modified date: 2024 - 10 - 12 +// Last modified date: 2026 - 01 - 29 // .NET version: 4.8 -// Thorlabs SDK Version: Beam version 9.1.5787.560 +// Thorlabs SDK Version: Beam version 9.3 // Notes: This example is based on the C sharp example which is installed to // C:\Program Files (x86)\IVI Foundation\VISA\WinNT\TLBP2\Examples during software installation. // This example has added the 2D reconstruction algorithm and the reconstructed beam image is displayed. namespace Thorlabs.BP2_CSharpDemo { - using System; + using System; + using System.Data; + using System.Drawing; + using System.Drawing.Imaging; + using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; - using System.Drawing; using Thorlabs.TLBP2.Interop; - using System.Runtime.InteropServices; /// /// Initializes the form @@ -36,16 +38,6 @@ public partial class Form1 : Form /// private Timer scanTimer = null; - /// - /// array of data structures for each slit. - /// - private bp2_slit_data[] bp2SlitData = new bp2_slit_data[4]; - - /// - /// array of calculation structures for each slit. - /// - private bp2_calculations[] bp2Calculations = new bp2_calculations[4]; - /// /// Initializes a new instance of the class. /// @@ -59,9 +51,6 @@ public Form1() // implementation with driver functions this.ConnectToTheFirstDevice(); - // alternative implementation - ////this.connectToTheFirstDeviceByRM(); - if (this.bp2Device != null) { // get the instrument information @@ -89,7 +78,6 @@ public Form1() ushort sampleCount; double sampleResolution; this.status = this.bp2Device.clear_drum_speed_offset(); - this.status = this.bp2Device.set_drum_speed(10.0); this.status = this.bp2Device.set_drum_speed_ex(10.0, out sampleCount, out sampleResolution); // activate the position correction to have the same calculation results as the Thorlabs Beam Application @@ -101,11 +89,15 @@ public Form1() // activate the drum speed correction this.status = this.bp2Device.set_speed_correction(true); - // use the offset for 10Hz to be compatible with the release version 5.0 - this.status = this.bp2Device.set_reference_position(0, 4, 100.0); - this.status = this.bp2Device.set_reference_position(1, 4, -100.0); - this.status = this.bp2Device.set_reference_position(2, 4, 100.0); - this.status = this.bp2Device.set_reference_position(3, 4, -100.0); + // return all position coordinates from -4500 µm to 4500 µm and flip the x scans + this.status = this.bp2Device.setThorlabsBeamCompatibleCoordinateSystem(true); + + // set the calculation area to auto rectangle, and set the clip level to 1% + // which is the same as the software default settings + this.status = this.bp2Device.set_calculation_area(0,true,0.01f,0,0); + this.status = this.bp2Device.set_calculation_area(1,true,0.01f,0,0); + this.status = this.bp2Device.set_calculation_area(2,true,0.01f,0,0); + this.status = this.bp2Device.set_calculation_area(3,true,0.01f,0,0); // poll for a valid scan this.scanTimer = new Timer(); @@ -152,22 +144,6 @@ private void ConnectToTheFirstDevice() } } - /// - /// search for connected devices and connect to the first one. - /// Use the VISA resource manager and simple data types. - /// - private void ConnectToTheFirstDeviceByRM() - { - // get the resource string of the first device - string[] bp2Resources = BP2_ResourceManager.FindRscBP2(); - - if (bp2Resources.Length > 0) - { - // connect to the first device - this.bp2Device = new TLBP2(bp2Resources[0], false, false); - } - } - /// /// poll for a new measurement and fill the structures with the calculation results. /// @@ -177,7 +153,7 @@ private void GetMeasurement() double drumSpeed; try { - if (0 == this.bp2Device.get_drum_speed(out drumSpeed)) + if (0 == this.bp2Device.get_averaged_drum_speed(out drumSpeed)) { this.textBox_drumSpeed.Text = drumSpeed.ToString("f2"); } @@ -200,70 +176,86 @@ private void GetMeasurement() else if ((deviceStatus & 2) == 2) this.toolStripStatusLabel1.Text = "Instrument is ready"; } - - // the gain and drum speed will be corrected during the measurement + double power; - float powerWindowSaturation; - if ((deviceStatus & 1) == 1 && - 0 == this.bp2Device.get_slit_scan_data(this.bp2SlitData, this.bp2Calculations, out power, out powerWindowSaturation, null)) + float powerSaturation; + ushort peakIndex1, peakIndex2,sampleCount1,sampleCount2,centroidIndexSlit1, centroidIndexSlit2; + float peakPositionSlit1, peakPositionSlit2, centroidPositionSlit1, centroidPositionSlit2, peakIntensitySlit1, peakIntensitySlit2; + float darkLevelSlit1, darkLevelSlit2; + + if ((deviceStatus & 1) == 1 && 0 == this.bp2Device.request_scan_data(out power, out powerSaturation, null)) { - this.textBox_peakPositionSlit1.Text = this.bp2Calculations[0].PeakPosition.ToString("f2"); - this.textBox_peakIntensitySlit1.Text = (this.bp2Calculations[0].PeakIntensity * 100.0f / ((float)0x7AFF - this.bp2SlitData[0].SlitDarkLevel)).ToString("f2"); - this.textBox_centroidPositionSlit1.Text = this.bp2Calculations[0].CentroidPos.ToString("f2"); + // get the peak position and centriod position + this.bp2Device.get_slit_peak(0, out peakIndex1, out peakPositionSlit1, out peakIntensitySlit1); + this.bp2Device.get_slit_peak(1, out peakIndex2, out peakPositionSlit2, out peakIntensitySlit2); + this.bp2Device.get_scan_data_information(0, out sampleCount1, out darkLevelSlit1); + this.bp2Device.get_scan_data_information(1, out sampleCount2, out darkLevelSlit2); + this.bp2Device.get_slit_centroid(0, out centroidIndexSlit1,out centroidPositionSlit1); + this.bp2Device.get_slit_centroid(1, out centroidIndexSlit2, out centroidPositionSlit2); + + this.textBox_peakPositionSlit1.Text = peakPositionSlit1.ToString("f2"); + this.textBox_peakIntensitySlit1.Text = (peakIntensitySlit1 * 100.0f / ((float)0x7AFF - darkLevelSlit1)).ToString("f2"); + this.textBox_centroidPositionSlit1.Text = centroidPositionSlit1.ToString("f2"); - this.textBox_peakPositionSlit2.Text = this.bp2Calculations[1].PeakPosition.ToString("f2"); - this.textBox_peakIntensitySlit2.Text = (this.bp2Calculations[1].PeakIntensity * 100.0f / ((float)0x7AFF - this.bp2SlitData[1].SlitDarkLevel)).ToString("f2"); - this.textBox_centroidPositionSlit2.Text = this.bp2Calculations[1].CentroidPos.ToString("f2"); + this.textBox_peakPositionSlit2.Text = peakPositionSlit2.ToString("f2"); + this.textBox_peakIntensitySlit2.Text = (peakIntensitySlit2 * 100.0f / ((float)0x7AFF - darkLevelSlit2)).ToString("f2"); + this.textBox_centroidPositionSlit2.Text = centroidPositionSlit2.ToString("f2"); - this.textBox_powerSaturation.Text = (powerWindowSaturation*100.0).ToString("f2"); + this.textBox_powerSaturation.Text = (powerSaturation*100.0).ToString("f2"); - this.chart25um.Series[0].Points.DataBindXY(bp2SlitData[0].SlitSamplesPositions, bp2SlitData[0].SlitSamplesIntensities); - this.chart25um.Series[1].Points.DataBindXY(bp2SlitData[1].SlitSamplesPositions, bp2SlitData[1].SlitSamplesIntensities); - this.chart5um.Series[0].Points.DataBindXY(bp2SlitData[2].SlitSamplesPositions, bp2SlitData[2].SlitSamplesIntensities); - this.chart5um.Series[1].Points.DataBindXY(bp2SlitData[3].SlitSamplesPositions, bp2SlitData[3].SlitSamplesIntensities); + GetChartAnd2DReconstruction(); - //Calculate and display the 2D reconstruction image - Get2DReconstruction(); } } /// /// Calculate the 2D reconstructed beam intensity distribution and display the image on the WinForm /// - private void Get2DReconstruction() + private void GetChartAnd2DReconstruction() { - double[] sampleIntensitiesX = new double[7500]; - double[] sampleIntensitiesY = new double[7500]; - double[] samplePositionX = new double[7500]; - double[] samplePositionY = new double[7500]; - double[] gaussianFitIntensitiesX = new double[7500]; - double[] gaussianFitIntensitiesY = new double[7500]; - double power; - float powerSaturation; + double[] sampleIntensities25umX = new double[7500]; + double[] sampleIntensities25umY = new double[7500]; + double[] samplePosition25umX = new double[7500]; + double[] samplePosition25umY = new double[7500]; + double[] sampleIntensities5umX = new double[7500]; + double[] sampleIntensities5umY = new double[7500]; + double[] samplePosition5umX = new double[7500]; + double[] samplePosition5umY = new double[7500]; + double[] gaussianFitIntensities25umX = new double[7500]; + double[] gaussianFitIntensities25umY = new double[7500]; float temp; - - //Request the scan data - this.bp2Device.request_scan_data(out power,out powerSaturation,null); + //Get the intensities from the 25um X slit and the 25um Y slit - this.bp2Device.get_sample_intensities(0, sampleIntensitiesX, samplePositionX); - this.bp2Device.get_sample_intensities(1, sampleIntensitiesY, samplePositionY); + this.bp2Device.get_sample_intensities(0, sampleIntensities25umX, samplePosition25umX); + this.bp2Device.get_sample_intensities(1, sampleIntensities25umY, samplePosition25umY); + + //Get the intensities from the 5um X slit and the 5um Y slit + this.bp2Device.get_sample_intensities(2, sampleIntensities5umX, samplePosition5umX); + this.bp2Device.get_sample_intensities(3, sampleIntensities5umY, samplePosition5umY); + + //Chart display + this.chart25um.Series[0].Points.DataBindXY(samplePosition25umX, sampleIntensities25umX); + this.chart25um.Series[1].Points.DataBindXY(samplePosition25umY, sampleIntensities25umY); + this.chart5um.Series[0].Points.DataBindXY(samplePosition5umX, sampleIntensities5umX); + this.chart5um.Series[1].Points.DataBindXY(samplePosition5umY, sampleIntensities5umY); //Get the gaussian fit intensites from the 25um X slit and the 25um Y slit - this.bp2Device.get_slit_gaussian_fit(0, out temp,out temp,out temp,gaussianFitIntensitiesX); - this.bp2Device.get_slit_gaussian_fit(1, out temp, out temp, out temp, gaussianFitIntensitiesY); + this.bp2Device.get_slit_gaussian_fit(0, out temp,out temp,out temp, gaussianFitIntensities25umX); + this.bp2Device.get_slit_gaussian_fit(1, out temp, out temp, out temp, gaussianFitIntensities25umY); //2D reconstruction - double[,] imageData = new double[750, 750]; + int imageSize = 750; + double[,] imageData = new double[imageSize, imageSize]; double imageDataMax = 0; int ixz, iyz; - for (int ix = 0; ix < 750; ix++) + for (int ix = 0; ix < imageSize; ix++) { - for (int iy = 0; iy < 750; iy++) + for (int iy = 0; iy < imageSize; iy++) { //2D reconstruction algorithm - ixz = (750 - ix - 1) * 10; - iyz = (750 - iy - 1) * 10; - imageData[ix, iy] = sampleIntensitiesX[ixz] * gaussianFitIntensitiesX[ixz] * sampleIntensitiesY[iyz] * gaussianFitIntensitiesY[iyz]; + ixz = (imageSize - ix - 1) * 7500 / imageSize; + iyz = (imageSize - iy - 1) * 7500 / imageSize; + imageData[ix, iy] = sampleIntensities25umX[ixz] * gaussianFitIntensities25umX[ixz] * sampleIntensities25umY[iyz] * gaussianFitIntensities25umY[iyz]; //set the negative values to zero if (imageData[ix, iy] < 0) @@ -279,22 +271,29 @@ private void Get2DReconstruction() } //Normalize intensity values and generate the Bitmap image - int imageGrayValue; - Bitmap bitmap = new Bitmap(750, 750); - for (int x = 0; x < 750; x++) + Bitmap bitmap = new Bitmap(imageSize, imageSize, PixelFormat.Format24bppRgb); + BitmapData bmpData = bitmap.LockBits( + new Rectangle(0, 0, imageSize, imageSize),ImageLockMode.WriteOnly,bitmap.PixelFormat); + + int stride = bmpData.Stride; + byte[] pixelData = new byte[stride * imageSize]; + + for (int y = 0; y < imageSize; y++) { - for (int y = 0; y < 750; y++) + for (int x = 0; x < imageSize; x++) { - imageGrayValue = (int)(imageData[x, y] * 255 / imageDataMax); - Color color = Color.FromArgb(imageGrayValue, imageGrayValue, imageGrayValue); - bitmap.SetPixel(x, y, color); + int gray = (int)(imageData[x, y] * 255 / imageDataMax); + gray = Math.Min(255, Math.Max(0, gray)); + int pixelIndex = y * stride + x * 3; + pixelData[pixelIndex + 0] = (byte)gray; + pixelData[pixelIndex + 1] = (byte)gray; + pixelData[pixelIndex + 2] = (byte)gray; } } - // set the bitmap to the Image property + Marshal.Copy(pixelData, 0, bmpData.Scan0, pixelData.Length); + bitmap.UnlockBits(bmpData); this.reconstructionPicture.Image = bitmap; - - } /// /// If a new scan is available, get the data from the instrument and display the calculation results on the form. @@ -329,5 +328,5 @@ private void Form1_FormClosing(object sender, FormClosingEventArgs e) this.bp2Device.Dispose(); } } - } + } } diff --git a/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/Program.cs b/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/Program.cs index b53b3ec..18bd693 100644 --- a/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/Program.cs +++ b/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/Program.cs @@ -1,8 +1,8 @@ // Title: BP209 2D Reconstruction C Sharp Example. // Created Date: 2024 - 10 - 12 -// Last modified date: 2024 - 10 - 12 +// Last modified date: 2026 - 01 - 29 // .NET version: 4.8 -// Thorlabs SDK Version: Beam version 9.1.5787.560 +// Thorlabs SDK Version: Beam version 9.3 // Notes: This example is based on the C sharp example which is installed to // C:\Program Files (x86)\IVI Foundation\VISA\WinNT\TLBP2\Examples during software installation. // This example has added the 2D reconstruction algorithm and the reconstructed beam image is displayed. diff --git a/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/bin/Debug/Thorlabs.TLBP2_64.Interop.xml b/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/bin/Debug/Thorlabs.TLBP2_64.Interop.xml index 7da0c28..ce214e2 100644 --- a/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/bin/Debug/Thorlabs.TLBP2_64.Interop.xml +++ b/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/bin/Debug/Thorlabs.TLBP2_64.Interop.xml @@ -104,6 +104,41 @@ VISA resource string which identifies an instrument. + + + structure to handle the slit data of a measurement + + + + + minimum ellipse diameter in µm + + + + + maximum ellipse diameter in µm + + + + + mean ellipse diameter in µm + + + + + ellipticity in percent + + + + + eccentricity in percent + + + + + ellipse orientation (either 0 degree or 90 degree) + + Class TLBP2 @@ -209,39 +244,108 @@ The value is the IntPtr that represents the handle to the instrument. - + - Gets a list of connected devices. - If this function is called with the parameter "Device_List" as VI_NULL, the function just returns the Device_Count. - The Device_List has to be initialized with Device_Count elements. + This function finds all driver compatible devices attached to the PC and returns the number of found devices. - ViUInt32 deviceCount; - ViStatus err = TLBP2_get_connected_deviced(vi, VI_NULL, &deviceCount); + Note: + (1) The function additionally stores information like system name about the found resources internally. This information can be retrieved with further functions from the class, e.g. <Get Resource Description> and <Get Resource Information>. - BP2_DEVICE* deviceList = (BP2_DEVICE*) malloc(sizeof(BP2_DEVICE)*deviceCount); - err = TLBP2_get_connected_deviced(vi, deviceList, &deviceCount); + (2) To list Ethernet and Bluetooth devices, enable the search for these devices with functions setEnableNetSearch and setEnableBthSearch. - ... + + + The number of connected devices that are supported by this driver. - free(deviceList); + + + This is the error code returned by the function call. For error codes and descriptions see <Error Message>. + + + + + This function gets the resource name string needed to open a device with <Initialize>. + + Notes: + (1) The data provided by this function was updated at the last call of <Find Resources>. - - The initialized list of BP2_DEVICE is filled with the information of the connected devices. If the parameter is VI_NULL, the parameter will be ignored. The list has to be initialized with the number of elements that is given by the Device_Count parameter. Maximal BP2_MAX_DEVICE_COUNT (10) devices can be connected. + + This parameter accepts the index of the device to get the resource descriptor from. + + Notes: + (1) The index is zero based. The maximum index to be used here is one less than the number of devices found by the last call of <Find Resources>. + - - Returns the number of connected devices. + + This parameter returns the resource descriptor. Use this descriptor to specify the device in <Initialize>. + + Notes: + (1) The array must contain at least TLPM_BUFFER_SIZE (256) elements ViChar[256]. - Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. + This is the error code returned by the function call. For error codes and descriptions see <Error Message>. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Connected devices query successful + VI_SUCCESS Successful + VI_ERROR_INV_OBJECT Index specifies an invalid object + + + + + This function gets information about a connected resource. - Vendor Specific Codes + Notes: + (1) The data provided by this function was updated at the last call of <Find Resources>. + + + This parameter accepts the index of the device to get the resource descriptor from. + + Notes: + (1) The index is zero based. The maximum index to be used here is one less than the number of devices found by the last call of <Find Resources>. + + + + This parameter returns the model name of the device. + + Notes: + (1) The array must contain at least TLPM_BUFFER_SIZE (256) elements ViChar[256]. + (2) You may pass VI_NULL if you do not need this parameter. + (3) Serial interfaces over Bluetooth will return the interface name instead of the device model name. + + + This parameter returns the serial number of the device. + + Notes: + (1) The array must contain at least TLPM_BUFFER_SIZE (256) elements ViChar[256]. + (2) You may pass VI_NULL if you do not need this parameter. + (3) The serial number is not available for serial interfaces over Bluetooth. + + + This parameter returns the manufacturer name of the device. + + Notes: + (1) The array must contain at least TLPM_BUFFER_SIZE (256) elements ViChar[256]. + (2) You may pass VI_NULL if you do not need this parameter. + (3) The manufacturer name is not available for serial interfaces over Bluetooth. + + + Returns the information if the device is available. + Devices that are not available are used by other applications. + + Notes: + (1) You may pass VI_NULL if you do not need this parameter. + + + + This is the error code returned by the function call. For error codes and descriptions see <Error Message>. + + Completition Codes ---------------------------------------------------------------- - For error codes and descriptions see <Error Message>. + VI_SUCCESS Successful + VI_ERROR_INV_OBJECT Index specifies an invalid object + @@ -322,6 +426,60 @@ VI_WARN_NSUP_REV_QUERY Instrument revision query not supported + Vendor Specific Codes + ---------------------------------------------------------------- + For error codes and descriptions see <Error Message>. + + + + + This function returns the device identification information. + + + This parameter returns the manufacturer name. + + Notes: + (1) The array must contain at least 256 elements ViChar[256]. + (2) You may pass VI_NULL if you do not need this value. + + + + This parameter returns the device name. + + Notes: + (1) The array must contain at least 256 elements ViChar[256]. + (2) You may pass VI_NULL if you do not need this value. + + + + This parameter returns the device serial number. + + Notes: + (1) The array must contain at least 256 elements ViChar[256]. + (2) You may pass VI_NULL if you do not need this value. + + + + This is the error code returned by the function call. For error codes and descriptions see <Error Message>. + + + + + Gets the version from the cpld inside the instrument. + The cpld version is written during the upload of the firmware. + + + Cpld version of the instrument. + The buffer for the cpld version has to be initialized with minimum 5 bytes. + + + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. + + Completition Codes + ---------------------------------------------------------------- + VI_SUCCESS Get the cpld version. + + Vendor Specific Codes ---------------------------------------------------------------- For error codes and descriptions see <Error Message>. @@ -352,22 +510,35 @@ For error codes and descriptions see <Error Message>. - + - The protected service functions have to be enabled with this function. - Please enter the access code to enable all the service functions. - For users of the instrument who need some of the functions may find the corresponding function in the tree "Configuration Functions". + Gets the number of slits, the used slits, the slit lengths and widths. + + The buffer has to be initialized for maximal BP2_MAX_SLIT_COUNT slits. - - Password to enable the service functions. - The password is only used for Thorlabs internal production and is not available for customers. + + Gets the information if the slit is used. + 0 = slit is not available + 1 = slit is usable + + + Get the length in mm of each of the BP2_MAX_SLIT_COUNT slits. + + + Get the width in ?m of each of the BP2_MAX_SLIT_COUNT slits. + + + Get the orientation of the BP2_MAX_SLIT_COUNT slits. + 0 = X + 1 = Y Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set acces code successful. + VI_SUCCESS Slit parameter query successful + Vendor Specific Codes @@ -375,19 +546,25 @@ For error codes and descriptions see <Error Message>. - + - Get the model name of the slit beam profiler (e.g. "BP209-VIS"). + Gets the offset range to correct the dark level. + + - - To get the instrument name the name buffer has to be initialized with 256 bytes and will be filled with the instrument name by this function. + + Lower bound of the offset range in digits. + + + Upper bound of the offset range in digits. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Get the instrument name. + VI_SUCCESS Offset range query successful + Vendor Specific Codes @@ -395,19 +572,22 @@ For error codes and descriptions see <Error Message>. - + - Sets the instrument name. The service mode has to be enabled to use this function. + Gets the currently used offset values for the slits. - - Instrument name with a maximal length of 10 characters. + + Array of offset value for the slits in digits. + + + Offset value for the power window in digits. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set the instrument name successful. + VI_SUCCESS Start Offset query successful Vendor Specific Codes @@ -415,20 +595,22 @@ For error codes and descriptions see <Error Message>. - + - Gets the serial number from the instrument. + Sets the currently used offset values for the slits. - - Serial number of the instrument. - The buffer for the serial number has to be initialized with 256 bytes. + + Array of offset value for the slits in digits. + + + Array of offset value for the power window in digits. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Get the serial number. + VI_SUCCESS Set Offset operation successful Vendor Specific Codes @@ -436,23 +618,25 @@ For error codes and descriptions see <Error Message>. - + - Sets the serial number in ASCII format. (e.g. M00123456). - Format of the serial number: M + eight numerics + '\0' + Gets the forward bias range the photodiode of the instrument supports. + - The service mode has to be enabled to use this function. - - Sets the serial number. - Maximal 10 Bytes: 9 characters + '\0'. + + Lower bound of the forward bias in digits. + + + Upper bound of the forward bias in digits. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set serial number successful. + VI_SUCCESS FW Bias range query successful + Vendor Specific Codes @@ -460,32 +644,19 @@ For error codes and descriptions see <Error Message>. - + - Gets the duration of the use of the device. - The elapsed time is separated into Years, Months, Days, Hours and Minutes. + Gets the current operating forward bias. - - Get the elapsed years. - - - Get the elapsed months. - - - Get the elapsed days. - - - Get the elapsed hours. - - - Get the elapsed minutes. + + Forward bias in digits. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS query of the elapsed time successful. + VI_SUCCESS Forward bias query successful Vendor Specific Codes @@ -493,17 +664,19 @@ For error codes and descriptions see <Error Message>. - + - Updates the elapsed time in the device. - Should be set periodically but not more than every 10 Minutes to protect the EEPROM of the device. + Sets the current operating forward bias in digits. + + Forward bias in digits. + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS updating of the elapsed time successful. + VI_SUCCESS Set forward bias operation successful Vendor Specific Codes @@ -511,21 +684,22 @@ For error codes and descriptions see <Error Message>. - + - Gets the version from the cpld inside the instrument. - The cpld version is written during the upload of the firmware. + Get the range of the gain the instrument supports. - - Cpld version of the instrument. - The buffer for the cpld version has to be initialized with minimum 5 bytes. + + Lower bound of the gain range. + + + Upper bound of the gain range. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Get the cpld version. + VI_SUCCESS Get gain range operation successful Vendor Specific Codes @@ -533,24 +707,22 @@ For error codes and descriptions see <Error Message>. - + - Gets the wavelength range the instruments supports. - The wavelength range can differ from the instrument model. + Gets the gains for each slit. - - Lower bound of the wavelength range in nm. + + Buffer of BP2_MAX_SLIT_COUNT elements which contains the gain for each slit. - - Upper bound of the wavelength range in nm. + + Get the gain for the power window. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Wavelength range query successful - + VI_SUCCESS Gain query operation successful Vendor Specific Codes @@ -558,23 +730,22 @@ For error codes and descriptions see <Error Message>. - + - Sets the supported wavelength for the instrument in ?m. - The service mode has to be enabled to use this function. + Set the gains for each slit. - - Minimum wavelength in nm. + + Buffer of BP2_MAX_SLIT_COUNT elements which contains the gain for each slit. - - Maximum wavelength in nm. + + Set the gain for the power window. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set Wavelength operation successful + VI_SUCCESS Set gains operation successful Vendor Specific Codes @@ -582,25 +753,22 @@ For error codes and descriptions see <Error Message>. - + - Gets the start offset range the instruments supports. - - + Gets the automatic calculation of the gain. + Manual setting of a gain value will fail when auto gain is activated. - - Lower bound of the offset range in digits. - - - Upper bound of the offset range in digits. + + Get the configuration if automatic calculation of the gain is activated. + VI_ON = auto gain is active + VI_OFF = auto gain is inactive Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Offset range query successful - + VI_SUCCESS Auto gain query operation successful Vendor Specific Codes @@ -608,19 +776,22 @@ For error codes and descriptions see <Error Message>. - + - Gets the programmed start value of the offset where the instrument starts securely. + Sets the automatic calculation of the gain. + The gain will be corrected with every measurement and take effect in the next measurement. + + Manual setting of a gain value will fail when auto gain is activated. - - Start Offset in digits. + + Set the configuration if automatic calculation of the gain has to be activated. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Start Offset query successful + VI_SUCCESS Set auto gain operation successful Vendor Specific Codes @@ -628,20 +799,25 @@ For error codes and descriptions see <Error Message>. - + - Sets the start value for the offset where the instrument starts under every conditions. - The service mode has to be enabled to use this function. + Gets the bandwidth range in kHz the instruments supports. + + default: 16.00 to 2500 kHz - - Offset in digits. Maximal 0xFFFF. + + Lower bound of the bandwith range in kHz. + + + Upper bound of the bandwith range in kHz. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set Offset operation successful + VI_SUCCESS Bandwidth range query successful + Vendor Specific Codes @@ -649,19 +825,19 @@ For error codes and descriptions see <Error Message>. - + - Gets the current operating drum circum in ?m/sqrt(2). + Gets the bandwidth for each slit in kHz. - - Drum Circum in ?m/sqrt(2). + + Buffer which contains the bandwidth in kHz for each of the maximal BP2_MAX_SLIT_COUNT slit. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Drum Circum query successful + VI_SUCCESS Bandwidth query operation successful Vendor Specific Codes @@ -669,20 +845,19 @@ For error codes and descriptions see <Error Message>. - + - Sets the current operating drum circum in ?m/sqrt(2). - The service mode has to be enabled to use this function. + Sets the bandwidth for each slit in kHz. - - Drum Circum in ?m/sqrt(2). + + Buffer which contains the bandwidth in kHz for each of the BP2_MAX_SLIT_COUNT slit. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set Drum Circum operation successful + VI_SUCCESS Set bandwidth operation successful Vendor Specific Codes @@ -690,24 +865,23 @@ For error codes and descriptions see <Error Message>. - + - Gets the forward bias range the photodiode of the instrument supports. - - + Gets the speed range the instruments supports. + Default: 2.0 to 20.0 Hz. - - Lower bound of the forward bias in digits. + + Lower bound of the speed range in drum rotation per second. - - Upper bound of the forward bias in digits. + + Upper bound of the speed range in drum rotation per second. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS FW Bias range query successful + VI_SUCCESS Speed range query successful. @@ -716,19 +890,22 @@ For error codes and descriptions see <Error Message>. - + - Gets the current operating forward bias. + Gets the speed of the drum rotation per second. + The drum speed is calculated from the 156 segments of the elapsed time measurement. - - Forward bias in digits. + + Speed of the drum in rotation per second. + The value is the sum of the 156 elapsed times, divided by 156 and multiplied by 156.25. This value is more stable than the "Get Drum Speed" measurement. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Forward bias query successful + VI_SUCCESS Averaged drum speed query successful + Vendor Specific Codes @@ -736,19 +913,28 @@ For error codes and descriptions see <Error Message>. - + - Sets the current operating forward bias in digits. + Sets the speed of the drum in rotations per seconds. + + The sample count and freqency is changed automatically. - - Forward bias in digits. + + sets the speed of the drum in rotations per seconds. + Range of the speed: 2 to 20 U/sec. + + + Count of samples for a slit. + + + Mean distance in ?m between two samples. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set forward bias operation successful + VI_SUCCESS Set speed operation successful Vendor Specific Codes @@ -756,35 +942,24 @@ For error codes and descriptions see <Error Message>. - + - Gets the number of slits, the used slits, the slit lengths and widths. - - The buffer has to be initialized for maximal BP2_MAX_SLIT_COUNT slits. + Gets the automatic correction of the drum speed. + The target drum speed can be set by the function "set_drum_speed". + The drum speed will be corrected if the measured drum speed differs from the target drum speed by more than 0.5Hz. + The drum speed can increase with higher temperature or during longer measurements. - - Gets the information if the slit is used. - 0 = slit is not available - 1 = slit is usable - - - Get the length in mm of each of the BP2_MAX_SLIT_COUNT slits. - - - Get the width in ?m of each of the BP2_MAX_SLIT_COUNT slits. - - - Get the orientation of the BP2_MAX_SLIT_COUNT slits. - 0 = X - 1 = Y + + Get the configuration if automatic correction of the drum speed is activated. + VI_ON = auto correction is active + VI_OFF = auto correction is inactive Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Slit parameter query successful - + VI_SUCCESS Auto correction query operation successful Vendor Specific Codes @@ -792,36 +967,19 @@ For error codes and descriptions see <Error Message>. - + - Sets the number of slits, the used slits, the slit lengths and widths. - Maximal BP2_MAX_SLIT_COUNT slits can be used. - The service mode has to be enabled to use this function. + With a higher temperature or longer measurements the drum speed can increase. This causes a complession of the beam profile in the calculation results. Then the beam profile may be clipped and the calculation results have false values. To avoid the drift the speed correction can be activated. If the measured drum speed differs from the target drum speed of more than 0.5 Hz the speed will corrected. This has the effect that the centroid moves to a new position if the speed correction is done. The effect depends on the position of the base line and the noise of the signal. - - Sets if the slit has to be used. - - 0 = do not use the slit - 1 = the slit can be used. - - - Set the length in mm of each of the BP2_MAX_SLIT_COUNT slits. - - - Set the width in ?m of each of the BP2_MAX_SLIT_COUNT slits. - - - Set the orientation of the BP2_MAX_SLIT_COUNT slits. - 0 = X - 1 = Y + + Activate the automatic correction of the drum speed. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Slit parameter query successful - + VI_SUCCESS Set correction operation successful Vendor Specific Codes @@ -829,31 +987,22 @@ For error codes and descriptions see <Error Message>. - + - This function returns the sensitivity curve for the photidiode in combination with the nd filter for the power measurement. + Gets the range for the power factor. - - Get the number of valid data. Maximal 20 data can be returned. - - - Get the lowest wavelength in nm. - - - Get the highest wavelength in nm. - - - Get the step in nm between two data. + + Lower bound of the power factor. - - Buffer which contains maximal 20 data. + + Upper bound of the power factor. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS sensor response query successful + VI_SUCCESS Power factor range query successful @@ -862,34 +1011,21 @@ For error codes and descriptions see <Error Message>. - + - Sets sensitivity curve for the photodiode. - The curve for a VIS model differs from a UV model. - The service mode has to be enabled to use this function. + Get the User Power Correction Factor. + This factor takes effect on the calculation of the total power. + Total Power = Measured Power * User Factor. - - Set the number of valid data. Maximal 20 data can be set. - - - Set the lowest wavelength in nm. - - - Set the highest wavelength in nm. - - - Set the step in nm between two data. - - - Buffer which contains maximal 20 data. + + Get the Power Correction Factor. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Setting the sensor response successful - + VI_SUCCESS Power factor query successful Vendor Specific Codes @@ -897,30 +1033,28 @@ For error codes and descriptions see <Error Message>. - + - Gets the date and name of the construction. + Set the User Power Correction Factor. + This factor takes effect on the calculation of the total power. + Total Power = Power calculated from the slit measurement * User Factor. + + To set the user power factor: + 1. measure the power of your light source with an external power meter + 2. set the user power factor to 1.0 and get the Total Power from the slit measurement. + 3. Calculate the power factor. User power factor = external measured power / slit measured power. + - - Year of the construction. - - - Month of the construction. - - - Day of the construction. - - - Name of the assembler. - The buffer can be filled with 8 characters. + + Set the Power Correction Factor. + The power factor can be set in a range from 0.01 to 65.0. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Construction parameter query successful - + VI_SUCCESS Set power factor operation successful Vendor Specific Codes @@ -928,29 +1062,23 @@ For error codes and descriptions see <Error Message>. - + - Sets name and date of the construction. - The service mode has to be enabled to use this function. + Gets the wavelength range the instruments supports. + The wavelength range can differ from the instrument model. - - Get the number of mounted slits. - - - Get the number of mounted slits. - - - Get the number of mounted slits. + + Lower bound of the wavelength range in nm. - - Name of the assembler. The buffer can contain up to 8 characters + '\0'. + + Upper bound of the wavelength range in nm. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Setting the construction parameter successful + VI_SUCCESS Wavelength range query successful @@ -959,35 +1087,19 @@ For error codes and descriptions see <Error Message>. - + - Gets the parameter of the calibration. + Returns the currently used wavelength in nm. - - Year of the calibration. - - - Month of the calibration. - - - Day of the calibration. - - - Minimum size of the firmware buffer is 8 characters. - - - Length of the version buffer minimum 8 characters. - - - Name of the assembler with maximal 8 characters. + + Get the currently used wavelength in nm. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Calibration parameter query successful - + VI_SUCCESS Wavelength query successful Vendor Specific Codes @@ -995,36 +1107,19 @@ For error codes and descriptions see <Error Message>. - + - Sets the parameter of the calibration. - The service mode has to be enabled to use this function. + Set the wavelength in nm. - - Year of the calibration. - - - Month of the calibration. - - - Day of the calibration. - - - Minimum size of the firmware buffer is 8 characters. - - - Minimum size of the firmware buffer is 8 characters. - - - Name of the assembler with maximal 8 characters. + + Set the wavelength in nm for calculations. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Setting the calibration parameter successful - + VI_SUCCESS Set wavelength operation successful Vendor Specific Codes @@ -1032,25 +1127,19 @@ For error codes and descriptions see <Error Message>. - + - Gets the position range of the slits. - - + Returns if the instrument uses a smaller ROI than the slit aperture. - - Lower bound of the slit position in digits. - - - Upper bound of the slit position in digits. + + Get the use of the ROI. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Slit position range query successful - + VI_SUCCESS Use ROI query successful Vendor Specific Codes @@ -1058,19 +1147,19 @@ For error codes and descriptions see <Error Message>. - + - Gets the current operating positions of the slits. + Activates or deactivates the use of the ROI. - - Array of positions with maximal MEAS_WINDOW_COUNT entries. + + Sets the use of the ROI on or off. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Slit positions query successful + VI_SUCCESS Setting the ROI Use successful Vendor Specific Codes @@ -1078,37 +1167,27 @@ For error codes and descriptions see <Error Message>. - + - Sets the current operating slit positions in digits. - These values are used until the device is connected. Unplug the device will reset the positions to the last saved values. - - Default values: - - Slit_Positions[0] = 215; // position of the power window - Slit_Positions[1] = 482; // position of the power dark window - - Slit_Positions[2] = 632; // position of the first slit - Slit_Positions[3] = 898; // position of the first dark window - - Slit_Positions[4] = 1048;// position of the second slit - Slit_Positions[5] = 1315;// position of the second dark window - - Slit_Positions[6] = 1465;// position of the third slit - Slit_Positions[7] = 1732; // position of the third dark window - - Slit_Positions[8] = 1882; // position of the fourth slit - Slit_Positions[9] = 2149; // position of the fourth dark window + Returns the number of scans which are averaged and the used averaging mode. - - Array with positions of the slits. Array has MEAS_WINDOW_COUNT entries. + + Get the number of scans that are averaged. + 1 = No Averaing + 2... 100 the intensities are summed over the scans and averaged. + All Calculations are done on the averaged data. + + + Mode how the scans are averaged. + 0 = Rolling Averaging (The average over the last x measurements is calculated) + 1 = Floating Averaging ( The new scan is added to the averaged scans) Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set slit positions operation successful + VI_SUCCESS Averaging query successful Vendor Specific Codes @@ -1116,20 +1195,27 @@ For error codes and descriptions see <Error Message>. - + - Sets the current operating slit positions in digits and stores them into the eeprom. - The service mode has to be enabled to use this function. + Sets the number of scans which are averaged and the avaraging mode. - - Array with positions of the slits. Array has MEAS_WINDOW_COUNT entries. + + Set the number of scans that are averaged. + 1 = No Averaing + 2... 100 the intensities are summed over the scans and averaged. + All Calculations are done on the averaged data. + + + Mode how the scans are averaged. + 0 = Rolling Averaging (The last x scans are summed up and averaged) + 1 = Floating Averaging ( The new scan is added to the averaged scans) Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Save slit positions operation successful + VI_SUCCESS Setting the Averaging successful Vendor Specific Codes @@ -1137,19 +1223,25 @@ For error codes and descriptions see <Error Message>. - + - Gets the current operating positions of the slits in the ROI mode. + Returns the mode of a slit which is used to reconstruct the beam profile. - - Array of positions with maximal MEAS_WINDOW_COUNT entries. + + The reconstruction mode of the slit identified by the index. + Slit index range: 0 to BP2_MAX_SLIT_COUNT - 1 + + + Mode how the scans are reconstructed. + 0 = Slit scanning + 1 = Knife-Edge Mode Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Slit positions roi query successful + VI_SUCCESS Reconstruction mode query successful Vendor Specific Codes @@ -1157,20 +1249,25 @@ For error codes and descriptions see <Error Message>. - + - Sets the current operating slit positions in the ROI mode. - These values are only available until unplugging the instrument. + Sets the mode of a slit which is used to reconstruct the beam profile. - - Array of ROI positions of the slits with MEAS_WINDOW_COUNT entries. + + The reconstruction mode of the slit identified by the index. + Slit index range: 0 to BP2_MAX_SLIT_COUNT - 1 + + + Mode how the scans are reconstructed. + 0 = Slit scanning + 1 = Derivated Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set slit positions roi operation successful + VI_SUCCESS Setting the reconstruction mode successful Vendor Specific Codes @@ -1178,20 +1275,19 @@ For error codes and descriptions see <Error Message>. - + - Sets the current operating slit positions for the ROI in digits and stores them into the eeprom. - The service mode has to be enabled to use this function. + Returns the clip level where the calculations are made. - - Array with positions of the ROI slits. Array has MEAS_WINDOW_COUNT entries. + + Clip Level in a range from 0.0 to 1.0. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Save slit positions operation successful + VI_SUCCESS Clip Level query successful Vendor Specific Codes @@ -1199,25 +1295,19 @@ For error codes and descriptions see <Error Message>. - + - Gets the motor dac range the instruments supports. - - + Set the clip level where the beam width is calculated. - - Lower bound of the motor dac value in digits. - - - Upper bound of the motor dac value in digits. + + Set the Clip Level in ragen from 0.0 to 1.0. 0.135 and 0.50 are common values. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Motor dac range query successful - + VI_SUCCESS Setting the clip level successful Vendor Specific Codes @@ -1225,19 +1315,21 @@ For error codes and descriptions see <Error Message>. - + - Gets the current operating motor dac value. + Returns the use of the max hold function for a slit. - - DAC value for the motor. + + Is the max hold mode used? + ON = Max hold is active + OFF = Max hold is inactive Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Motor dac value query successful + VI_SUCCESS Max Hold use query successful Vendor Specific Codes @@ -1245,19 +1337,19 @@ For error codes and descriptions see <Error Message>. - + - Set the DAC value for the motor. + Sets if only the maximum values of all scans are used for the calculation. - - Set the DAC value for the motor. + + Set the Use of Max Hold. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set motor DAC value operation successful. + VI_SUCCESS Setting the use of Max Hold successful Vendor Specific Codes @@ -1265,22 +1357,32 @@ For error codes and descriptions see <Error Message>. - + - Gets the current stored DAC value where the drum has a rotation frequency of 5 and 20 Hz. + Set the Auto Base Line Correction if the slit measurement contains a lot of ambient light. This measurement will reduce the influence of the ambient light. + + The base line calculated from the dark windows will be placed by the mean of the first 10 samples of the slit measurement. + Be sure that the beam profile is in the middle of the slit window and only the ambient light is measured within the first 10 samples. - - Calibrated dac value for a drum rotation of 5 Hz. + + Index of the slit. - - Calibrated dac value for a drum rotation of 20 Hz. + + Returns the mode how the base line is calculated. + + Mean of the intensities of the dark window. (0) + Mean of the first 10 samples of the slit window (1) + Fixed user base line value (2) + + + Returns the used base line fo the mode 'User Base Level'. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS calibrated dac value query successful + VI_SUCCESS Success of the base line query. Vendor Specific Codes @@ -1288,23 +1390,34 @@ For error codes and descriptions see <Error Message>. - + - Sets the DAC value where the drum has a rotation frequency of 5 and 20 Hz. - The service mode has to be enabled to use this function. + Sets a digit value for the base line or automatic. - - Calibrated dac value where the drum rotates with 5 Hz. + + Index of the slit. - - Calibrated dac value where the drum rotates with 20Hz. + + Change the mode how the base line is calculated. + + Mean of the intensities of the dark window. (0) + Mean of the first 10 samples of the slit window (1) + Fixed user base line value (2) + + + + Manual digit value for the base line. This parameter has to be set if the mode is set to "User Base Level". Fo all other modes, this parameter is ignored. + + BaseLine <= 0.1: The base line is calculated automatically from the dark windows. + + Base Line > 0.1: The base line from the dark window is replaced by the Base Line value. The Base Line value is up to 65.535 digits. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Calibrated dac values operation successful. + VI_SUCCESS Setting the base line successful Vendor Specific Codes @@ -1312,25 +1425,22 @@ For error codes and descriptions see <Error Message>. - + - Gets the current stored DAC value where the drum has a rotation frequency of 2, 5 and 20 Hz. + Gets a correction for beam width smaller than the slit with. - - Calibrated dac value for a drum rotation of 2 Hz. - - - Calibrated dac value for a drum rotation of 5 Hz. + + Index of the slit. - - Calibrated dac value for a drum rotation of 20 Hz. + + Enables the correction. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS calibrated dac value query successful + VI_SUCCESS Query the beam width correction successful Vendor Specific Codes @@ -1338,26 +1448,22 @@ For error codes and descriptions see <Error Message>. - + - Sets the DAC value where the drum has a rotation frequency of 2, 5 and 20 Hz. - The service mode has to be enabled to use this function. + Sets a correction for beam width smaller than the slit with. - - Calibrated dac value where the drum rotates with 2 Hz. - - - Calibrated dac value where the drum rotates with 5 Hz. + + Index of the slit. - - Calibrated dac value where the drum rotates with 20Hz. + + Enables the correction. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Calibrated dac values operation successful. + VI_SUCCESS Setting the beam width correction successful Vendor Specific Codes @@ -1365,25 +1471,35 @@ For error codes and descriptions see <Error Message>. - + - Gets the elapsed time to the last construction date. + Returns the calculation area for the slit where the calculations are made. - - Days to the last construction. + + Index of the slit. - - Hours to the last construction. + + Mode for the calculation area. + VI_ON = automatic (default) + VI_OFF = manual - - MInutes to the last construction. + + Get the clip level for the automatic calculation area. + The clip level is a threshold from the peak intensity to the base line which includes the samples for calculation. + Clip Level in a range from 0.0 to 13.5. + + + Position in ?m where the left border for the calculation area is. + + + Position in ?m where the right border for the calculation area is. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS construction hour query successful + VI_SUCCESS Calculation Area query successful Vendor Specific Codes @@ -1391,25 +1507,43 @@ For error codes and descriptions see <Error Message>. - + - Gets the elapsed time to the last calibration date. + Sets the calculation area for the slit where the calculations are made. - - Elapsed days to the last calibration. + + Index of the slit. - - Elapsed hours to the last calibration. + + Set the calculation area either automatic or manual. + Automatic = 1 = VI_ON = true + Manual = 0 = VI_OFF = false + + If the mode is set to "Automatic" then the parameter "Automatic Mode Clip Level" has to be set. The parameter "Left Border" and "Right Border" are ignored. + + If the mode is set to "Manual" then the parameter "Left Border" and "Right Border" have to be set. The parameter "Automatic Mode Clip Level" is ignored. - - Elapsed minutes to the last calibration. + + Set the clip level for the automatic calculation area. This parameter has to be set with the "Automatic Mode". + The clip level is a threshold in percent between the peak intensity and the base line. + A clip level of 0.01 means that beginning at the peak position and lookking in both directions to the edges of the measurement window, all samples that have an intensity higher than 1% of the range between the peak and the base line are used for calculations. With the first sample in each direction that is below the threshold, all further samples are not used. + + + + Position in ?m where the left border of the calculation area is. + The range for the left border is from 0 to 9000?m. Sample intensitiey that are below the border are not used for the calculations. + + + Position in ?m where the right border for the calculation area is. + The range for the right border is from 0 to 9000?m. Samples that are greater the border are not used for the calculations. + The right border has to be a greater value than the left border. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS calibration hour query successful + VI_SUCCESS Setting the Calculation Area successful Vendor Specific Codes @@ -1417,16 +1551,22 @@ For error codes and descriptions see <Error Message>. - + - Resets the calibration date to the current date. + Gets a correction for the centroid and peak position. The correction translates the centroid and peak position under the influence of the bandwidth, gain and drum speed. + + Enables the position correction. + + ON = Position correction is active + OFF = Position correction is deactive + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set calibration date operation successful. + VI_SUCCESS Query the position correction successful Vendor Specific Codes @@ -1434,16 +1574,22 @@ For error codes and descriptions see <Error Message>. - + - Resets the construction date to the current date. + Sets a correction for the centroid and peak position. The correction translates the centroid and peak position under the influence of the bandwidth, gain and drum speed. This correction is used for this calculation result: + - centroid position + - peak position + - positions arrays for the slits + + Enables the position correction. + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set construction date operation successful. + VI_SUCCESS Setting the position correction successful Vendor Specific Codes @@ -1451,19 +1597,19 @@ For error codes and descriptions see <Error Message>. - + - Get the Power Correction Factor from the eeprom of the device. + Return all positions in the coordinate system like Thorlabs Beam from -4500 ?m to 4500?m - - Get the Power Correction Factor. + + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Power factor query successful + VI_SUCCESS Query the reference position successful Vendor Specific Codes @@ -1471,20 +1617,19 @@ For error codes and descriptions see <Error Message>. - + - Set the Power Correction Factor and stores the value in the eeprom of the device. - The service mode needs to be enabled to use this function. + Return all positions in the coordinate system like Thorlabs Beam from -4500 ?m to 4500?m - - Set the Power Correction Factor. + + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set power factor operation successful + VI_SUCCESS Setting the reference position successful Vendor Specific Codes @@ -1492,28 +1637,25 @@ For error codes and descriptions see <Error Message>. - + - This function queries the status register of the BP2. - - + Flips the axis of the specific slit - - This parameter returns the instruments status. - - // a new scan is available - BP2_STATUS_SCAN_AVAILABLE 0x00000001 - - // the drum speed has been stabilized - BP2_STATUS_DRUM_STABILIZED 0x00000002 + + Index of the slit. + + + Flip state: + VI_ON: flip axis + VI_OFF: don't flip axis Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS device status query successful + VI_SUCCESS Query the reference position successful Vendor Specific Codes @@ -1521,24 +1663,25 @@ For error codes and descriptions see <Error Message>. - + - Gets the range of sample counts the instrument supports. - The sample count depends on the drum speed and the sample frequency. + Flips the axis of the specific slit - - Lower bound of the sample count. + + Index of the slit. - - Upper bound of the sample count. + + Flip state: + + VI_ON: flip axis + VI_OFF: don't flip axis Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Sample count range query successful - + VI_SUCCESS Query the reference position successful Vendor Specific Codes @@ -1546,20 +1689,31 @@ For error codes and descriptions see <Error Message>. - + - Gets the current operating slit sample buffer. + Gets the position offset which is added to the centroid and peak position. - - Buffer which contains the sample count for each slit. - Size of the buffer is BP2_MAX_SLIT_COUNT * 2 bytes = 8 bytes. + + Index of the slit. + + + Either fix the offset to a calulation parameter or set a user defined offset. + 0 = Sensor Center + 1 = Roi Center + 2 = Peak Position + 3 = Centroid Position + 4 = User Position + + + Offset to the calculation parameter centroid and peak position in ?m. + Corrected Centroid Position = Reference Position - Centroid position Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Sample count buffer query successful + VI_SUCCESS Query the reference position successful Vendor Specific Codes @@ -1567,23 +1721,34 @@ For error codes and descriptions see <Error Message>. - + - Sets the current operating sample count for each slit. - Setting the sample count may change the sample frequency. - - Remark: Using the function "Set Drum Speed Extended" will overwrite the manual set sample count. + Gets the position offset which is added to the centroid and peak position. + This parameter only is used if the positin correction is activated with the function "set_position_correction(VI_TRUE)". - - Buffer which contains the sample count for each slit. - Size of the buffer is BP2_MAX_SLIT_COUNT * 2 bytes = 8 bytes. - + + Index of the slit. + + + Either fix the offset to a calulation parameter or set a user defined offset. + 0 = Sensor Center + 1 = Roi Center + 2 = Peak Position + 3 = Centroid Position + 4 = User Position + + + Offset to the calculation parameter centroid and peak position in ?m. + Corrected Centroid Position = Centroid position - Reference Position. + + Origin of the reference position is always top left corner (0,0) like in Thorlabs Beam. + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set sample count buffer operation successful. + VI_SUCCESS Setting the reference position successful Vendor Specific Codes @@ -1591,25 +1756,31 @@ For error codes and descriptions see <Error Message>. - + - Gets the sample frequency range the instruments supports in kHz. + This function queries the status register of the BP2. - - Lower bound of the samples frequency in kHz. - - - Upper bound of the samples frequency in kHz. + + This parameter returns the instruments status. + + // a new scan is available + BP2_STATUS_SCAN_AVAILABLE 0x0001 + + // the drum speed has been stabilized + BP2_STATUS_DRUM_STABILIZED 0x0002 + + // the drum speed has been stabilized + BP2_STATUS_DRUM_DESTABILIZED 0x0004 + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Samples frequency range query successful. - + VI_SUCCESS device status query successful Vendor Specific Codes @@ -1617,19 +1788,39 @@ For error codes and descriptions see <Error Message>. - + - Gets the current operating samples frequency for each slit in kHz. + This function reads out the processed scan data. + The beam profile is analyzed for each of the maximal BP2_MAX_SLIT_COUNT slits independently. - - Buffer for the samples frequencies in kHz. + + This buffer contains the data of each of the BP2_MAX_SLIT_COUNT slits. Please provide an array of BP2_MAX_SLIT_COUNT structures of BP2_SLIT_DATA. + + + To identify a slit, please use the function get_slit_parameter. + + + Fills the data buffer with the calculation result for each slit. + The parameter is optional. You may pass VI_NULL if you don't need this parameter. + Please provide an array of BP2_MAX_SLIT_COUNT structures of BP2_CALCULATIONS. + + + Returns the power in mW of the drum segment with the ND filter. + You may pass VI_NULL if you don't need this parameter. + + + Returns the saturation of the power window in percent. + You may pass VI_NULL if you don't need this parameter. + + + Fills a buffer of minimum 2128 entries with the intensities from the power window. You may pass VI_NULL if you don't need this parameter. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Samples frequencies query successful + VI_SUCCESS Get the measurement data operation successful Vendor Specific Codes @@ -1637,21 +1828,39 @@ For error codes and descriptions see <Error Message>. - + - Sets the current operating samples frequency for each slit. - - Remark: Using the function "Set Drum Speed Extended" will overwrite the manual set sample count. + This function calculates the knife edge data from the slit data. - - Frequency for the samples of each slit. + + A buffer of max 7500 entries with the intensites of the slit data. The base level is substracted from the intensities. Max intensity value is 32767. + + + A buffer with the calculation result for each slit. + + + This array contains the information if the knife edge is calculated for this slit. If this parameter is not used, all slits become the knife edge data. This parameter is useful to increase the performance by suppress the calculation on slits that are not of interest. + + + Example for the calculation on the last two slits: + slit_indices[0] = VI_FALSE; + slit_indices[1] = VI_FALSE; + slit_indices[2] = VI_TRUE; + slit_indices[3] = VI_TRUE; + + + Fills the data buffer of max 7500 entries with the intensites of the slit data. The base level is substracted from the intensities. Max intensity value is 32767. + + + Fills the data buffer with the calculation result for each slit. + The parameter is optional. If the calculations are not needed, please use VI_NULL as value instead of the calculations buffer. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set samples frequencies operation successful + VI_SUCCESS Get the measurement data operation successful Vendor Specific Codes @@ -1659,25 +1868,34 @@ For error codes and descriptions see <Error Message>. - + - Gets the offset range to correct the dark level. + This function reads out measured ellipse paramter. + + + Array with the calculation results of all slits. + + + + + Index of the slit of which the peak interests. + + + Index of the slit of which the peak interests. + + - - - Lower bound of the offset range in digits. - - Upper bound of the offset range in digits. + + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Offset range query successful - + VI_SUCCESS Get peak parameter operation successful Vendor Specific Codes @@ -1685,22 +1903,26 @@ For error codes and descriptions see <Error Message>. - + - Gets the currently used offset values for the slits. + This function reads a new measurement from the device and stores the calculation results internally. - - Array of offset value for the slits in digits. + + Returns the power in mW of the drum segment with the ND filter. - - Offset value for the power window in digits. + + Returns the saturation of the power window in percent. + If the parameter is not needed, use VI_NULL as value instead. + + + Fills a buffer of minimum 2128 entries with the intensities from the power window. If the values are not needed please use the value VI_NULL instead of a buffer. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Start Offset query successful + VI_SUCCESS Request measurement successful Vendor Specific Codes @@ -1708,22 +1930,26 @@ For error codes and descriptions see <Error Message>. - + - Sets the currently used offset values for the slits. + This function reads out the processed scan data. - - Array of offset value for the slits in digits. + + Index of the slit which should be analyzed. + To identify a slit, please use the function get_slit_parameter. - - Array of offset value for the power window in digits. + + Number of samples which are taken for the slit during the scan. + + + Dark level intensity in digits. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set Offset operation successful + VI_SUCCESS Get the measurement data operation successful Vendor Specific Codes @@ -1731,22 +1957,26 @@ For error codes and descriptions see <Error Message>. - + - Get the range of the gain the instrument supports. + This function reads out the processed scan data. - - Lower bound of the gain range. + + Index of the slit which data is of interest. + To identify a slit, please use the function get_slit_parameter. - - Upper bound of the gain range. + + Fills the data buffer of max 7500 entries with the intensites of the slit data. The base level is substracted from the intensities. Max intensity value is 65535. + + + Fills the data buffer of max 7500 entries with the positions of the slit data in ?m. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Get gain range operation successful + VI_SUCCESS Get the measurement data operation successful Vendor Specific Codes @@ -1754,22 +1984,28 @@ For error codes and descriptions see <Error Message>. - + - Gets the gains for each slit. + This function reads out measured peak parameter. - - Buffer of BP2_MAX_SLIT_COUNT elements which contains the gain for each slit. + + Index of the slit of which the peak interests. - - Get the gain for the power window. + + Index of the peak in the data intensity buffer. + + + Position of the peak in ?m beginning from the first data in the intensity buffer. + + + Intensity of the peak in digits. The dark level is substracted. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Gain query operation successful + VI_SUCCESS Get peak parameter operation successful Vendor Specific Codes @@ -1777,22 +2013,25 @@ For error codes and descriptions see <Error Message>. - + - Set the gains for each slit. + This function reads out the centroid parameter. - - Buffer of BP2_MAX_SLIT_COUNT elements which contains the gain for each slit. + + The index of the slit which should be analyzed for it's centroid. - - Set the gain for the power window. + + Index of the centroid in the intensity buffer. + + + Position of the centroid in ?m beginning from the first data in the intensity buffer. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set gains operation successful + VI_SUCCESS Get the centroid parameter operation successful Vendor Specific Codes @@ -1800,22 +2039,25 @@ For error codes and descriptions see <Error Message>. - + - Gets the automatic calculation of the gain. - Manual setting of a gain value will fail when auto gain is activated. + This function reads out the beam with measured at the clip level. - - Get the configuration if automatic calculation of the gain is activated. - VI_ON = auto gain is active - VI_OFF = auto gain is inactive + + Index of the slit which should give the beam width. + + + Beam width in ?m measured at the clip level. + + + The sigma width is calculated of all scan data of this slit. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Auto gain query operation successful + VI_SUCCESS Get the beam width operation successful Vendor Specific Codes @@ -1823,22 +2065,31 @@ For error codes and descriptions see <Error Message>. - + - Sets the automatic calculation of the gain. - The gain will be corrected with every measurement and take effect in the next measurement. - - Manual setting of a gain value will fail when auto gain is activated. + This function reads out the gaussian parameter. - - Set the configuration if automatic calculation of the gain has to be activated. + + Index of the slit which is analyzed for it's gaussian parameter. + + + Intensity of the calculated gaussian fit curve. The intensity can be higher than the peak intensity of the beam. + + + Diameter of the gaussian curve. + + + Fit percentage of the gaussian curve to the scan data. + + + Array of maximal 7500 entries which contains the gaussian curve. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set auto gain operation successful + VI_SUCCESS Get the gaussian parameter operation successful Vendor Specific Codes @@ -1846,25 +2097,43 @@ For error codes and descriptions see <Error Message>. - + - Gets the bandwidth range in kHz the instruments supports. - - default: 16.00 to 2500 kHz + This function reads out measured ellipse paramter. - - Lower bound of the bandwith range in kHz. + + Index of the slit of which the peak interests. - - Upper bound of the bandwith range in kHz. + + Index of the slit of which the peak interests. + + + + + + + + + + + + + + + + + + + + + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Bandwidth range query successful - + VI_SUCCESS Get peak parameter operation successful Vendor Specific Codes @@ -1872,19 +2141,25 @@ For error codes and descriptions see <Error Message>. - + - Gets the bandwidth for each slit. + Gets the sample frequency range the instruments supports in kHz. + + - - Buffer which contains the bandwidth for each of the maximal BP2_MAX_SLIT_COUNT slit. + + Lower bound of the samples frequency in kHz. + + + Upper bound of the samples frequency in kHz. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Bandwidth query operation successful + VI_SUCCESS Samples frequency range query successful. + Vendor Specific Codes @@ -1892,19 +2167,19 @@ For error codes and descriptions see <Error Message>. - + - Sets the bandwidth for each slit. + Gets the current operating samples frequency for each slit in kHz. - - Buffer which contains the bandwidth for each of the BP2_MAX_SLIT_COUNT slit. + + Buffer for the samples frequencies in kHz. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set bandwidth operation successful + VI_SUCCESS Samples frequencies query successful Vendor Specific Codes @@ -1912,24 +2187,21 @@ For error codes and descriptions see <Error Message>. - + - Gets the speed range the instruments supports. - Default: 2.0 to 20.0 Hz. + Sets the current operating samples frequency for each slit. + + Remark: Using the function "Set Drum Speed Extended" will overwrite the manual set sample count. - - Lower bound of the speed range in drum rotation per second. - - - Upper bound of the speed range in drum rotation per second. + + Frequency for the samples of each slit. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Speed range query successful. - + VI_SUCCESS Set samples frequencies operation successful Vendor Specific Codes @@ -1937,20 +2209,22 @@ For error codes and descriptions see <Error Message>. - + - Gets the speed of the drum rotation per second. + The protected service functions have to be enabled with this function. + Please enter the access code to enable all the service functions. + For users of the instrument who need some of the functions may find the corresponding function in the tree "Configuration Functions". - - Speed of the drum in rotation per second. + + Password to enable the service functions. + The password is only used for Thorlabs internal production and is not available for customers. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Speed query successful - + VI_SUCCESS Set acces code successful. Vendor Specific Codes @@ -1958,29 +2232,19 @@ For error codes and descriptions see <Error Message>. - + - Sets the speed of the drum in rotations per seconds. - - To use the full slit length (9mm) for your measurements, adopt the sample count and frequency to the new scan rate. - - Set the freqencies with the function "set_samples_frequencies": - sample_frequency_kHz = (sample_count / 1000) * (get_drum_circum / 1000 / slit_length_mm) *drum_speed_Hz. - - sample_frequency_kHz = (7500 / 1000) * ((55800*PI) / sqrt(2.0) / 1000 / 9)*10 - - For a sample count of 7500 and a scan rate of 10 Hz, the samples frequency is 1033 kHz. + Get the model name of the slit beam profiler (e.g. "BP209-VIS"). - - sets the speed of the drum in rotations per seconds. - Range of the speed: 0 to 20 U/sec. + + To get the instrument name the name buffer has to be initialized with 256 bytes and will be filled with the instrument name by this function. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set speed operation successful + VI_SUCCESS Get the instrument name. Vendor Specific Codes @@ -1988,28 +2252,19 @@ For error codes and descriptions see <Error Message>. - + - Sets the speed of the drum in rotations per seconds. - - The sample count and freqency is changed automatically. + Sets the instrument name. The service mode has to be enabled to use this function. - - sets the speed of the drum in rotations per seconds. - Range of the speed: 2 to 20 U/sec. - - - Count of samples for a slit. - - - Mean distance in ?m between two samples. + + Instrument name with a maximal length of 10 characters. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set speed operation successful + VI_SUCCESS Set the instrument name successful. Vendor Specific Codes @@ -2017,20 +2272,20 @@ For error codes and descriptions see <Error Message>. - + - Adds a speed to the current drum speed to correct the motor speed. Please call "Set Drum Speed" to see the effect. With "Clear Drum Offset" the offset can be resetted. + Gets the serial number from the instrument. - - corrects the speed of the drum in rotations per seconds. - Range of the correction speed: -3.0 to 3.0 U/sec. + + Serial number of the instrument. + The buffer for the serial number has to be initialized with 256 bytes. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set correction speed operation successful. + VI_SUCCESS Get the serial number. Vendor Specific Codes @@ -2038,16 +2293,23 @@ For error codes and descriptions see <Error Message>. - + - Clears the drum speed offset. This function is useful if the dum speed has been changed. + Sets the serial number in ASCII format. (e.g. M00123456). + Format of the serial number: M + eight numerics + '\0' + + The service mode has to be enabled to use this function. + + Sets the serial number. + Maximal 10 Bytes: 9 characters + '\0'. + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Clear correction speed operation successful. + VI_SUCCESS Set serial number successful. Vendor Specific Codes @@ -2055,24 +2317,32 @@ For error codes and descriptions see <Error Message>. - + - Gets the automatic correction of the drum speed. - The target drum speed can be set by the function "set_drum_speed". - The drum speed will be corrected if the measured drum speed differs from the target drum speed by more than 0.5Hz. - The drum speed can increase with higher temperature or during longer measurements. + Gets the duration of the use of the device. + The elapsed time is separated into Years, Months, Days, Hours and Minutes. - - Get the configuration if automatic correction of the drum speed is activated. - VI_ON = auto correction is active - VI_OFF = auto correction is inactive + + Get the elapsed years. + + + Get the elapsed months. + + + Get the elapsed days. + + + Get the elapsed hours. + + + Get the elapsed minutes. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Auto correction query operation successful + VI_SUCCESS query of the elapsed time successful. Vendor Specific Codes @@ -2080,19 +2350,17 @@ For error codes and descriptions see <Error Message>. - + - With a higher temperature or longer measurements the drum speed can increase. This causes a complession of the beam profile in the calculation results. Then the beam profile may be clipped and the calculation results have false values. To avoid the drift the speed correction can be activated. If the measured drum speed differs from the target drum speed of more than 0.5 Hz the speed will corrected. This has the effect that the centroid moves to a new position if the speed correction is done. The effect depends on the position of the base line and the noise of the signal. + Updates the elapsed time in the device. + Should be set periodically but not more than every 10 Minutes to protect the EEPROM of the device. - - Activate the automatic correction of the drum speed. - Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set correction operation successful + VI_SUCCESS updating of the elapsed time successful. Vendor Specific Codes @@ -2100,22 +2368,23 @@ For error codes and descriptions see <Error Message>. - + - Gets the speed of the drum rotation per second. - The drum speed is calculated from the 156 segments of the elapsed time measurement. + Sets the supported wavelength for the instrument in ?m. + The service mode has to be enabled to use this function. - - Speed of the drum in rotation per second. - The value is the sum of the 156 elapsed times, divided by 156 and multiplied by 156.25. This value is more stable than the "Get Drum Speed" measurement. + + Minimum wavelength in nm. + + + Maximum wavelength in nm. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Averaged drum speed query successful - + VI_SUCCESS Set Wavelength operation successful Vendor Specific Codes @@ -2123,22 +2392,24 @@ For error codes and descriptions see <Error Message>. - + - Gets the range for the power factor. + Gets the start offset range the instruments supports. + + - - Lower bound of the power factor. + + Lower bound of the offset range in digits. - - Upper bound of the power factor. + + Upper bound of the offset range in digits. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Power factor range query successful + VI_SUCCESS Offset range query successful @@ -2147,21 +2418,19 @@ For error codes and descriptions see <Error Message>. - + - Get the User Power Correction Factor. - This factor takes effect on the calculation of the total power. - Total Power = Measured Power * User Factor. + Gets the programmed start value of the offset where the instrument starts securely. - - Get the Power Correction Factor. + + Start Offset in digits. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Power factor query successful + VI_SUCCESS Start Offset query successful Vendor Specific Codes @@ -2169,28 +2438,20 @@ For error codes and descriptions see <Error Message>. - + - Set the User Power Correction Factor. - This factor takes effect on the calculation of the total power. - Total Power = Power calculated from the slit measurement * User Factor. - - To set the user power factor: - 1. measure the power of your light source with an external power meter - 2. set the user power factor to 1.0 and get the Total Power from the slit measurement. - 3. Calculate the power factor. User power factor = external measured power / slit measured power. - + Sets the start value for the offset where the instrument starts under every conditions. + The service mode has to be enabled to use this function. - - Set the Power Correction Factor. - The power factor can be set in a range from 0.01 to 65.0. + + Offset in digits. Maximal 0xFFFF. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set power factor operation successful + VI_SUCCESS Set Offset operation successful Vendor Specific Codes @@ -2198,19 +2459,19 @@ For error codes and descriptions see <Error Message>. - + - Returns the currently used wavelength in nm. + Gets the current operating drum circum in ?m/sqrt(2). - - Get the currently used wavelength in nm. + + Drum Circum in ?m/sqrt(2). Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Wavelength query successful + VI_SUCCESS Drum Circum query successful Vendor Specific Codes @@ -2218,19 +2479,20 @@ For error codes and descriptions see <Error Message>. - + - Set the wavelength in nm. + Sets the current operating drum circum in ?m/sqrt(2). + The service mode has to be enabled to use this function. - - Set the wavelength in nm for calculations. + + Drum Circum in ?m/sqrt(2). Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Set wavelength operation successful + VI_SUCCESS Set Drum Circum operation successful Vendor Specific Codes @@ -2238,19 +2500,36 @@ For error codes and descriptions see <Error Message>. - + - Returns if the instrument uses a smaller ROI than the slit aperture. + Sets the number of slits, the used slits, the slit lengths and widths. + Maximal BP2_MAX_SLIT_COUNT slits can be used. + The service mode has to be enabled to use this function. - - Get the use of the ROI. + + Sets if the slit has to be used. + + 0 = do not use the slit + 1 = the slit can be used. + + + Set the length in mm of each of the BP2_MAX_SLIT_COUNT slits. + + + Set the width in ?m of each of the BP2_MAX_SLIT_COUNT slits. + + + Set the orientation of the BP2_MAX_SLIT_COUNT slits. + 0 = X + 1 = Y Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Use ROI query successful + VI_SUCCESS Slit parameter query successful + Vendor Specific Codes @@ -2258,19 +2537,32 @@ For error codes and descriptions see <Error Message>. - + - Activates or deactivates the use of the ROI. + This function returns the sensitivity curve for the photidiode in combination with the nd filter for the power measurement. - - Sets the use of the ROI on or off. + + Get the number of valid data. Maximal 20 data can be returned. + + + Get the lowest wavelength in nm. + + + Get the highest wavelength in nm. + + + Get the step in nm between two data. + + + Buffer which contains maximal 20 data. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Setting the ROI Use successful + VI_SUCCESS sensor response query successful + Vendor Specific Codes @@ -2278,27 +2570,34 @@ For error codes and descriptions see <Error Message>. - + - Returns the number of scans which are averaged and the used averaging mode. + Sets sensitivity curve for the photodiode. + The curve for a VIS model differs from a UV model. + The service mode has to be enabled to use this function. - - Get the number of scans that are averaged. - 1 = No Averaing - 2... 100 the intensities are summed over the scans and averaged. - All Calculations are done on the averaged data. + + Set the number of valid data. Maximal 20 data can be set. - - Mode how the scans are averaged. - 0 = Rolling Averaging (The average over the last x measurements is calculated) - 1 = Floating Averaging ( The new scan is added to the averaged scans) + + Set the lowest wavelength in nm. + + + Set the highest wavelength in nm. + + + Set the step in nm between two data. + + + Buffer which contains maximal 20 data. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Averaging query successful + VI_SUCCESS Setting the sensor response successful + Vendor Specific Codes @@ -2306,27 +2605,30 @@ For error codes and descriptions see <Error Message>. - + - Sets the number of scans which are averaged and the avaraging mode. + Gets the date and name of the construction. - - Set the number of scans that are averaged. - 1 = No Averaing - 2... 100 the intensities are summed over the scans and averaged. - All Calculations are done on the averaged data. + + Year of the construction. - - Mode how the scans are averaged. - 0 = Rolling Averaging (The last x scans are summed up and averaged) - 1 = Floating Averaging ( The new scan is added to the averaged scans) + + Month of the construction. + + + Day of the construction. + + + Name of the assembler. + The buffer can be filled with 8 characters. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Setting the Averaging successful + VI_SUCCESS Construction parameter query successful + Vendor Specific Codes @@ -2334,25 +2636,30 @@ For error codes and descriptions see <Error Message>. - + - Returns the mode of a slit which is used to reconstruct the beam profile. + Sets name and date of the construction. + The service mode has to be enabled to use this function. - - The reconstruction mode of the slit identified by the index. - Slit index range: 0 to BP2_MAX_SLIT_COUNT - 1 + + Get the number of mounted slits. - - Mode how the scans are reconstructed. - 0 = Slit scanning - 1 = Knife-Edge Mode + + Get the number of mounted slits. + + + Get the number of mounted slits. + + + Name of the assembler. The buffer can contain up to 8 characters + '\0'. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Reconstruction mode query successful + VI_SUCCESS Setting the construction parameter successful + Vendor Specific Codes @@ -2360,25 +2667,35 @@ For error codes and descriptions see <Error Message>. - + - Sets the mode of a slit which is used to reconstruct the beam profile. + Gets the parameter of the calibration. - - The reconstruction mode of the slit identified by the index. - Slit index range: 0 to BP2_MAX_SLIT_COUNT - 1 + + Year of the calibration. - - Mode how the scans are reconstructed. - 0 = Slit scanning - 1 = Derivated + + Month of the calibration. + + + Day of the calibration. + + + Minimum size of the firmware buffer is 8 characters. + + + Length of the version buffer minimum 8 characters. + + + Name of the assembler with maximal 8 characters. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Setting the reconstruction mode successful + VI_SUCCESS Calibration parameter query successful + Vendor Specific Codes @@ -2386,19 +2703,36 @@ For error codes and descriptions see <Error Message>. - + - Returns the clip level where the calculations are made. + Sets the parameter of the calibration. + The service mode has to be enabled to use this function. - - Clip Level in a range from 0.0 to 1.0. + + Year of the calibration. + + + Month of the calibration. + + + Day of the calibration. + + + Minimum size of the firmware buffer is 8 characters. + + + Minimum size of the firmware buffer is 8 characters. + + + Name of the assembler with maximal 8 characters. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Clip Level query successful + VI_SUCCESS Setting the calibration parameter successful + Vendor Specific Codes @@ -2406,19 +2740,25 @@ For error codes and descriptions see <Error Message>. - + - Set the clip level where the beam width is calculated. + Gets the position range of the slits. + + - - Set the Clip Level in ragen from 0.0 to 1.0. 0.135 and 0.50 are common values. + + Lower bound of the slit position in digits. + + + Upper bound of the slit position in digits. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Setting the clip level successful + VI_SUCCESS Slit position range query successful + Vendor Specific Codes @@ -2426,21 +2766,19 @@ For error codes and descriptions see <Error Message>. - + - Returns the use of the max hold function for a slit. + Gets the current operating positions of the slits. - - Is the max hold mode used? - ON = Max hold is active - OFF = Max hold is inactive + + Array of positions with maximal MEAS_WINDOW_COUNT entries. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Max Hold use query successful + VI_SUCCESS Slit positions query successful Vendor Specific Codes @@ -2448,19 +2786,120 @@ For error codes and descriptions see <Error Message>. - + - Sets if only the maximum values of all scans are used for the calculation. + Sets the current operating slit positions in digits. + These values are used until the device is connected. Unplug the device will reset the positions to the last saved values. + + Default values: + + Slit_Positions[0] = 215; // position of the power window + Slit_Positions[1] = 482; // position of the power dark window + + Slit_Positions[2] = 632; // position of the first slit + Slit_Positions[3] = 898; // position of the first dark window + + Slit_Positions[4] = 1048;// position of the second slit + Slit_Positions[5] = 1315;// position of the second dark window + + Slit_Positions[6] = 1465;// position of the third slit + Slit_Positions[7] = 1732; // position of the third dark window + + Slit_Positions[8] = 1882; // position of the fourth slit + Slit_Positions[9] = 2149; // position of the fourth dark window - - Set the Use of Max Hold. + + Array with positions of the slits. Array has MEAS_WINDOW_COUNT entries. + + + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. + + Completition Codes + ---------------------------------------------------------------- + VI_SUCCESS Set slit positions operation successful + + + Vendor Specific Codes + ---------------------------------------------------------------- + For error codes and descriptions see <Error Message>. + + + + + Sets the current operating slit positions in digits and stores them into the eeprom. + The service mode has to be enabled to use this function. + + + Array with positions of the slits. Array has MEAS_WINDOW_COUNT entries. + + + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. + + Completition Codes + ---------------------------------------------------------------- + VI_SUCCESS Save slit positions operation successful + + + Vendor Specific Codes + ---------------------------------------------------------------- + For error codes and descriptions see <Error Message>. + + + + + Gets the current operating positions of the slits in the ROI mode. + + + Array of positions with maximal MEAS_WINDOW_COUNT entries. + + + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. + + Completition Codes + ---------------------------------------------------------------- + VI_SUCCESS Slit positions roi query successful + + + Vendor Specific Codes + ---------------------------------------------------------------- + For error codes and descriptions see <Error Message>. + + + + + Sets the current operating slit positions in the ROI mode. + These values are only available until unplugging the instrument. + + + Array of ROI positions of the slits with MEAS_WINDOW_COUNT entries. + + + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. + + Completition Codes + ---------------------------------------------------------------- + VI_SUCCESS Set slit positions roi operation successful + + + Vendor Specific Codes + ---------------------------------------------------------------- + For error codes and descriptions see <Error Message>. + + + + + Sets the current operating slit positions for the ROI in digits and stores them into the eeprom. + The service mode has to be enabled to use this function. + + + Array with positions of the ROI slits. Array has MEAS_WINDOW_COUNT entries. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Setting the use of Max Hold successful + VI_SUCCESS Save slit positions operation successful Vendor Specific Codes @@ -2468,32 +2907,25 @@ For error codes and descriptions see <Error Message>. - + - Set the Auto Base Line Correction if the slit measurement contains a lot of ambient light. This measurement will reduce the influence of the ambient light. + Gets the motor dac range the instruments supports. - The base line calculated from the dark windows will be placed by the mean of the first 10 samples of the slit measurement. - Be sure that the beam profile is in the middle of the slit window and only the ambient light is measured within the first 10 samples. - - - Index of the slit. - - - Returns the mode how the base line is calculated. - Mean of the intensities of the dark window. (0) - Mean of the first 10 samples of the slit window (1) - Fixed user base line value (2) + + + Lower bound of the motor dac value in digits. - - Returns the used base line fo the mode 'User Base Level'. + + Upper bound of the motor dac value in digits. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Success of the base line query. + VI_SUCCESS Motor dac range query successful + Vendor Specific Codes @@ -2501,34 +2933,19 @@ For error codes and descriptions see <Error Message>. - + - Sets a digit value for the base line or automatic. + Gets the current operating motor dac value. - - Index of the slit. - - - Change the mode how the base line is calculated. - - Mean of the intensities of the dark window. (0) - Mean of the first 10 samples of the slit window (1) - Fixed user base line value (2) - - - - Manual digit value for the base line. This parameter has to be set if the mode is set to "User Base Level". Fo all other modes, this parameter is ignored. - - BaseLine <= 0.1: The base line is calculated automatically from the dark windows. - - Base Line > 0.1: The base line from the dark window is replaced by the Base Line value. The Base Line value is up to 65.535 digits. + + DAC value for the motor. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Setting the base line successful + VI_SUCCESS Motor dac value query successful Vendor Specific Codes @@ -2536,22 +2953,19 @@ For error codes and descriptions see <Error Message>. - + - Gets a correction for beam width smaller than the slit with. + Set the DAC value for the motor. - - Index of the slit. - - - Enables the correction. + + Set the DAC value for the motor. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Query the beam width correction successful + VI_SUCCESS Set motor DAC value operation successful. Vendor Specific Codes @@ -2559,22 +2973,22 @@ For error codes and descriptions see <Error Message>. - + - Sets a correction for beam width smaller than the slit with. + Gets the current stored DAC value where the drum has a rotation frequency of 5 and 20 Hz. - - Index of the slit. + + Calibrated dac value for a drum rotation of 5 Hz. - - Enables the correction. + + Calibrated dac value for a drum rotation of 20 Hz. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Setting the beam width correction successful + VI_SUCCESS calibrated dac value query successful Vendor Specific Codes @@ -2582,35 +2996,23 @@ For error codes and descriptions see <Error Message>. - + - Returns the calculation area for the slit where the calculations are made. + Sets the DAC value where the drum has a rotation frequency of 5 and 20 Hz. + The service mode has to be enabled to use this function. - - Index of the slit. - - - Mode for the calculation area. - VI_ON = automatic (default) - VI_OFF = manual - - - Get the clip level for the automatic calculation area. - The clip level is a threshold from the peak intensity to the base line which includes the samples for calculation. - Clip Level in a range from 0.0 to 13.5. - - - Position in ?m where the left border for the calculation area is. + + Calibrated dac value where the drum rotates with 5 Hz. - - Position in ?m where the right border for the calculation area is. + + Calibrated dac value where the drum rotates with 20Hz. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Calculation Area query successful + VI_SUCCESS Calibrated dac values operation successful. Vendor Specific Codes @@ -2618,43 +3020,25 @@ For error codes and descriptions see <Error Message>. - + - Sets the calculation area for the slit where the calculations are made. + Gets the current stored DAC value where the drum has a rotation frequency of 2, 5 and 20 Hz. - - Index of the slit. - - - Set the calculation area either automatic or manual. - Automatic = 1 = VI_ON = true - Manual = 0 = VI_OFF = false - - If the mode is set to "Automatic" then the parameter "Automatic Mode Clip Level" has to be set. The parameter "Left Border" and "Right Border" are ignored. - - If the mode is set to "Manual" then the parameter "Left Border" and "Right Border" have to be set. The parameter "Automatic Mode Clip Level" is ignored. - - - Set the clip level for the automatic calculation area. This parameter has to be set with the "Automatic Mode". - The clip level is a threshold in percent between the peak intensity and the base line. - A clip level of 0.01 means that beginning at the peak position and lookking in both directions to the edges of the measurement window, all samples that have an intensity higher than 1% of the range between the peak and the base line are used for calculations. With the first sample in each direction that is below the threshold, all further samples are not used. - + + Calibrated dac value for a drum rotation of 2 Hz. - - Position in ?m where the left border of the calculation area is. - The range for the left border is from 0 to 9000?m. Samples that are below the border are not used for the calculations. + + Calibrated dac value for a drum rotation of 5 Hz. - - Position in ?m where the right border for the calculation area is. - The range for the right border is from 0 to 9000?m. Samples that are greater the border are not used for the calculations. - The right border has to be a greater value than the left border. + + Calibrated dac value for a drum rotation of 20 Hz. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Setting the Calculation Area successful + VI_SUCCESS calibrated dac value query successful Vendor Specific Codes @@ -2662,22 +3046,26 @@ For error codes and descriptions see <Error Message>. - + - Gets a correction for the centroid and peak position. The correction translates the centroid and peak position under the influence of the bandwidth, gain and drum speed. + Sets the DAC value where the drum has a rotation frequency of 2, 5 and 20 Hz. + The service mode has to be enabled to use this function. - - Enables the position correction. - - ON = Position correction is active - OFF = Position correction is deactive + + Calibrated dac value where the drum rotates with 2 Hz. + + + Calibrated dac value where the drum rotates with 5 Hz. + + + Calibrated dac value where the drum rotates with 20Hz. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Query the position correction successful + VI_SUCCESS Calibrated dac values operation successful. Vendor Specific Codes @@ -2685,22 +3073,25 @@ For error codes and descriptions see <Error Message>. - + - Sets a correction for the centroid and peak position. The correction translates the centroid and peak position under the influence of the bandwidth, gain and drum speed. This correction is used for this calculation result: - - centroid position - - peak position - - positions arrays for the slits + Gets the elapsed time to the last construction date. - - Enables the position correction. + + Days to the last construction. + + + Hours to the last construction. + + + MInutes to the last construction. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Setting the position correction successful + VI_SUCCESS construction hour query successful Vendor Specific Codes @@ -2708,31 +3099,25 @@ For error codes and descriptions see <Error Message>. - + - Gets the position offset which is added to the centroid and peak position. + Gets the elapsed time to the last calibration date. - - Index of the slit. + + Elapsed days to the last calibration. - - Either fix the offset to a calulation parameter or set a user defined offset. - 0 = Sensor Center - 1 = Roi Center - 2 = Peak Position - 3 = Centroid Position - 4 = User Position + + Elapsed hours to the last calibration. - - Offset to the calculation parameter centroid and peak position in ?m. - Corrected Centroid Position = Reference Position - Centroid position + + Elapsed minutes to the last calibration. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Query the reference position successful + VI_SUCCESS calibration hour query successful Vendor Specific Codes @@ -2740,32 +3125,16 @@ For error codes and descriptions see <Error Message>. - + - Gets the position offset which is added to the centroid and peak position. - This parameter only is used if the positin correction is activated with the function "set_position_correction(VI_TRUE)". + Resets the calibration date to the current date. - - Index of the slit. - - - Either fix the offset to a calulation parameter or set a user defined offset. - 0 = Sensor Center - 1 = Roi Center - 2 = Peak Position - 3 = Centroid Position - 4 = User Position - - - Offset to the calculation parameter centroid and peak position in ?m. - Corrected Centroid Position = Reference Position - Centroid position - Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Setting the reference position successful + VI_SUCCESS Set calibration date operation successful. Vendor Specific Codes @@ -2773,39 +3142,36 @@ For error codes and descriptions see <Error Message>. - + - This function reads out the processed scan data. - The beam profile is analyzed for each of the maximal BP2_MAX_SLIT_COUNT slits independently. + Resets the construction date to the current date. - - This buffer contains the data of each of the BP2_MAX_SLIT_COUNT slits. Please provide an array of BP2_MAX_SLIT_COUNT structures of BP2_SLIT_DATA. + + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. + Completition Codes + ---------------------------------------------------------------- + VI_SUCCESS Set construction date operation successful. - To identify a slit, please use the function get_slit_parameter. - - - Fills the data buffer with the calculation result for each slit. - The parameter is optional. You may pass VI_NULL if you don't need this parameter. - Please provide an array of BP2_MAX_SLIT_COUNT structures of BP2_CALCULATIONS. - - - Returns the power in mW of the drum segment with the ND filter. - You may pass VI_NULL if you don't need this parameter. - - - Returns the saturation of the power window in percent. - You may pass VI_NULL if you don't need this parameter. - - - Fills a buffer of minimum 2128 entries with the intensities from the power window. You may pass VI_NULL if you don't need this parameter. + + Vendor Specific Codes + ---------------------------------------------------------------- + For error codes and descriptions see <Error Message>. + + + + + Get the Power Correction Factor from the eeprom of the device. + + + Get the Power Correction Factor. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Get the measurement data operation successful + VI_SUCCESS Power factor query successful Vendor Specific Codes @@ -2813,39 +3179,20 @@ For error codes and descriptions see <Error Message>. - + - This function calculates the knife edge data from the slit data. + Set the Power Correction Factor and stores the value in the eeprom of the device. + The service mode needs to be enabled to use this function. - - A buffer of max 7500 entries with the intensites of the slit data. The base level is substracted from the intensities. Max intensity value is 32767. - - - A buffer with the calculation result for each slit. - - - This array contains the information if the knife edge is calculated for this slit. If this parameter is not used, all slits become the knife edge data. This parameter is useful to increase the performance by suppress the calculation on slits that are not of interest. - - - Example for the calculation on the last two slits: - slit_indices[0] = VI_FALSE; - slit_indices[1] = VI_FALSE; - slit_indices[2] = VI_TRUE; - slit_indices[3] = VI_TRUE; - - - Fills the data buffer of max 7500 entries with the intensites of the slit data. The base level is substracted from the intensities. Max intensity value is 32767. - - - Fills the data buffer with the calculation result for each slit. - The parameter is optional. If the calculations are not needed, please use VI_NULL as value instead of the calculations buffer. + + Set the Power Correction Factor. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Get the measurement data operation successful + VI_SUCCESS Set power factor operation successful Vendor Specific Codes @@ -2853,26 +3200,34 @@ For error codes and descriptions see <Error Message>. - + - This function reads out the measured elapsed times between two impulses. 156 Impulses are measured for each drum rotation. - - - Array with the measurement of the elapsed times in ?sec between the 156 impulses per drum rotation. + Gets a list of connected devices. + If this function is called with the parameter "Device_List" as VI_NULL, the function just returns the Device_Count. + The Device_List has to be initialized with Device_Count elements. - The array has ELAPSED_TIME_COUNTS entries. - Size of the buffer: 156 Words = 312 Bytes. + ViUInt32 deviceCount; + ViStatus err = TLBP2_get_connected_deviced(vi, VI_NULL, &deviceCount); - To get the drum rotation frequency multiply the mean of the elapsed times with 156.25. + BP2_DEVICE* deviceList = (BP2_DEVICE*) malloc(sizeof(BP2_DEVICE)*deviceCount); + err = TLBP2_get_connected_deviced(vi, deviceList, &deviceCount); - ( The encoder creates 2500 impulses. Every 16 impulses the elapsed time is measured => 156.25 measurements per drum roration). + ... + + free(deviceList); + + + The initialized list of BP2_DEVICE is filled with the information of the connected devices. If the parameter is VI_NULL, the parameter will be ignored. The list has to be initialized with the number of elements that is given by the Device_Count parameter. Maximal BP2_MAX_DEVICE_COUNT (10) devices can be connected. + + + Returns the number of connected devices. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Read of the elapsed times successful. + VI_SUCCESS Connected devices query successful Vendor Specific Codes @@ -2880,26 +3235,20 @@ For error codes and descriptions see <Error Message>. - + - This function reads a new measurement from the device and stores the calculation results internally. + Gets the speed of the drum rotation per second. - - Returns the power in mW of the drum segment with the ND filter. - - - Returns the saturation of the power window in percent. - If the parameter is not needed, use VI_NULL as value instead. - - - Fills a buffer of minimum 2128 entries with the intensities from the power window. If the values are not needed please use the value VI_NULL instead of a buffer. + + Speed of the drum in rotation per second. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Request measurement successful + VI_SUCCESS Speed query successful + Vendor Specific Codes @@ -2907,26 +3256,29 @@ For error codes and descriptions see <Error Message>. - + - This function reads out the processed scan data. + Sets the speed of the drum in rotations per seconds. + + To use the full slit length (9mm) for your measurements, adopt the sample count and frequency to the new scan rate. + + Set the freqencies with the function "set_samples_frequencies": + sample_frequency_kHz = (sample_count / 1000) * (get_drum_circum / 1000 / slit_length_mm) *drum_speed_Hz. + + sample_frequency_kHz = (7500 / 1000) * ((55800*PI) / sqrt(2.0) / 1000 / 9)*10 + + For a sample count of 7500 and a scan rate of 10 Hz, the samples frequency is 1033 kHz. - - Index of the slit which should be analyzed. - To identify a slit, please use the function get_slit_parameter. - - - Number of samples which are taken for the slit during the scan. - - - Dark level intensity in digits. + + sets the speed of the drum in rotations per seconds. + Range of the speed: 0 to 20 U/sec. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Get the measurement data operation successful + VI_SUCCESS Set speed operation successful Vendor Specific Codes @@ -2934,26 +3286,20 @@ For error codes and descriptions see <Error Message>. - + - This function reads out the processed scan data. + Adds a speed to the current drum speed to correct the motor speed. Please call "Set Drum Speed" to see the effect. With "Clear Drum Offset" the offset can be resetted. - - Index of the slit which data is of interest. - To identify a slit, please use the function get_slit_parameter. - - - Fills the data buffer of max 7500 entries with the intensites of the slit data. The base level is substracted from the intensities. Max intensity value is 65535. - - - Fills the data buffer of max 7500 entries with the positions of the slit data in ?m. + + corrects the speed of the drum in rotations per seconds. + Range of the correction speed: -3.0 to 3.0 U/sec. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Get the measurement data operation successful + VI_SUCCESS Set correction speed operation successful. Vendor Specific Codes @@ -2961,28 +3307,16 @@ For error codes and descriptions see <Error Message>. - + - This function reads out measured peak parameter. + Clears the drum speed offset. This function is useful if the dum speed has been changed. - - Index of the slit of which the peak interests. - - - Index of the peak in the data intensity buffer. - - - Position of the peak in ?m beginning from the first data in the intensity buffer. - - - Intensity of the peak in digits. The dark level is substracted. - Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Get peak parameter operation successful + VI_SUCCESS Clear correction speed operation successful. Vendor Specific Codes @@ -2990,25 +3324,24 @@ For error codes and descriptions see <Error Message>. - + - This function reads out the centroid parameter. + Gets the range of sample counts the instrument supports. + The sample count depends on the drum speed and the sample frequency. - - The index of the slit which should be analyzed for it's centroid. - - - Index of the centroid in the intensity buffer. + + Lower bound of the sample count. - - Position of the centroid in ?m beginning from the first data in the intensity buffer. + + Upper bound of the sample count. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Get the centroid parameter operation successful + VI_SUCCESS Sample count range query successful + Vendor Specific Codes @@ -3016,25 +3349,20 @@ For error codes and descriptions see <Error Message>. - + - This function reads out the beam with measured at the clip level. + Gets the current operating slit sample buffer. - - Index of the slit which should give the beam width. - - - Beam width in ?m measured at the clip level. - - - The sigma width is calculated of all scan data of this slit. + + Buffer which contains the sample count for each slit. + Size of the buffer is BP2_MAX_SLIT_COUNT * 2 bytes = 8 bytes. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Get the beam width operation successful + VI_SUCCESS Sample count buffer query successful Vendor Specific Codes @@ -3042,31 +3370,23 @@ For error codes and descriptions see <Error Message>. - + - This function reads out the gaussian parameter. + Sets the current operating sample count for each slit. + Setting the sample count may change the sample frequency. + + Remark: Using the function "Set Drum Speed Extended" will overwrite the manual set sample count. - - Index of the slit which is analyzed for it's gaussian parameter. - - - Intensity of the calculated gaussian fit curve. The intensity can be higher than the peak intensity of the beam. - - - Diameter of the gaussian curve. - - - Fit percentage of the gaussian curve to the scan data. - - - Array of maximal 7500 entries which contains the gaussian curve. + + Buffer which contains the sample count for each slit. + Size of the buffer is BP2_MAX_SLIT_COUNT * 2 bytes = 8 bytes. Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. Completition Codes ---------------------------------------------------------------- - VI_SUCCESS Get the gaussian parameter operation successful + VI_SUCCESS Set sample count buffer operation successful. Vendor Specific Codes @@ -3074,10 +3394,32 @@ For error codes and descriptions see <Error Message>. - + - Closes the instrument and releases all resources. + This function reads out the measured elapsed times between two impulses. 156 Impulses are measured for each drum rotation. + + Array with the measurement of the elapsed times in ?sec between the 156 impulses per drum rotation. + + The array has ELAPSED_TIME_COUNTS entries. + Size of the buffer: 156 Words = 312 Bytes. + + To get the drum rotation frequency multiply the mean of the elapsed times with 156.25. + + ( The encoder creates 2500 impulses. Every 16 impulses the elapsed time is measured => 156.25 measurements per drum roration). + + + Operational return status. Contains either a completion code or an error code. Instrument driver specific codes that may be returned in addition to the VISA error codes defined in VPP-4.3 and vendor specific codes, are as follows. + + Completition Codes + ---------------------------------------------------------------- + VI_SUCCESS Read of the elapsed times successful. + + + Vendor Specific Codes + ---------------------------------------------------------------- + For error codes and descriptions see <Error Message>. + @@ -3116,6 +3458,37 @@ The new scan is added to the averaged scans + + + Modes for the reference Position + Used for the function set_reference_position + + + + + reference position is the center of the sensor + + + + + reference position is the center of the ROI + + + + + Reference position is the peak postion. The peak position in the calculation results will be (0,0) and the centroid relative to the peak position + + + + + Reference position is the centroid postion. The centroid position in the calculation results will be (0,0) and the peak relative to the centroid position + + + + + The reference position is set by the user in µm + + This class let the VISA Runtime search for connected devices diff --git a/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/obj/Debug/Thorlabs.BP2_CSharpDemo.csproj.FileListAbsolute.txt b/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/obj/Debug/Thorlabs.BP2_CSharpDemo.csproj.FileListAbsolute.txt index e43c143..2ca939b 100644 --- a/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/obj/Debug/Thorlabs.BP2_CSharpDemo.csproj.FileListAbsolute.txt +++ b/C sharp/Thorlabs BP209 Beam Profiler 2D Output/Thorlabs.BP2_CSharpDemo/obj/Debug/Thorlabs.BP2_CSharpDemo.csproj.FileListAbsolute.txt @@ -2,13 +2,55 @@ C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Prof C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.BP2_CSharpDemo.exe C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.BP2_CSharpDemo.pdb C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.csproj.AssemblyReference.cache -C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.csproj.SuggestedBindingRedirects.cache C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.Form1.resources C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.Properties.Resources.resources C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.csproj.GenerateResource.cache C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.csproj.CoreCompileInputs.cache -C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.csproj.CopyComplete C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.exe C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.pdb C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.TLBP2_64.Interop.dll C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.TLBP2_64.Interop.xml +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.exe.config +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.F50C70AC.Up2Date +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\1. SW [Cases and Study]\BP2 2D重构 提高帧率\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.BP2_CSharpDemo.exe.config +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\1. SW [Cases and Study]\BP2 2D重构 提高帧率\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.BP2_CSharpDemo.exe +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\1. SW [Cases and Study]\BP2 2D重构 提高帧率\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.BP2_CSharpDemo.pdb +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\1. SW [Cases and Study]\BP2 2D重构 提高帧率\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.TLBP2_64.Interop.dll +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\1. SW [Cases and Study]\BP2 2D重构 提高帧率\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.TLBP2_64.Interop.xml +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\1. SW [Cases and Study]\BP2 2D重构 提高帧率\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.csproj.AssemblyReference.cache +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\1. SW [Cases and Study]\BP2 2D重构 提高帧率\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.exe.config +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\1. SW [Cases and Study]\BP2 2D重构 提高帧率\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.Form1.resources +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\1. SW [Cases and Study]\BP2 2D重构 提高帧率\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.Properties.Resources.resources +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\1. SW [Cases and Study]\BP2 2D重构 提高帧率\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.csproj.GenerateResource.cache +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\1. SW [Cases and Study]\BP2 2D重构 提高帧率\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.csproj.CoreCompileInputs.cache +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\1. SW [Cases and Study]\BP2 2D重构 提高帧率\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.F50C70AC.Up2Date +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\1. SW [Cases and Study]\BP2 2D重构 提高帧率\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.exe +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\1. SW [Cases and Study]\BP2 2D重构 提高帧率\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.pdb +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp high FPS\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.BP2_CSharpDemo.exe.config +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp high FPS\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.BP2_CSharpDemo.exe +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp high FPS\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.BP2_CSharpDemo.pdb +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp high FPS\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.TLBP2_64.Interop.dll +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp high FPS\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.TLBP2_64.Interop.xml +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp high FPS\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.csproj.AssemblyReference.cache +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp high FPS\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.exe.config +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp high FPS\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.Form1.resources +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp high FPS\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.Properties.Resources.resources +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp high FPS\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.csproj.GenerateResource.cache +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp high FPS\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.csproj.CoreCompileInputs.cache +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp high FPS\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.F50C70AC.Up2Date +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp high FPS\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.exe +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\4. SW Project\BP209 Beam Profile c sharp high FPS\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.pdb +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\GitHub\Light_Analysis_Examples\C sharp\Thorlabs BP209 Beam Profiler 2D Output\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.BP2_CSharpDemo.exe.config +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\GitHub\Light_Analysis_Examples\C sharp\Thorlabs BP209 Beam Profiler 2D Output\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.BP2_CSharpDemo.exe +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\GitHub\Light_Analysis_Examples\C sharp\Thorlabs BP209 Beam Profiler 2D Output\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.BP2_CSharpDemo.pdb +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\GitHub\Light_Analysis_Examples\C sharp\Thorlabs BP209 Beam Profiler 2D Output\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.TLBP2_64.Interop.dll +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\GitHub\Light_Analysis_Examples\C sharp\Thorlabs BP209 Beam Profiler 2D Output\Thorlabs.BP2_CSharpDemo\bin\Debug\Thorlabs.TLBP2_64.Interop.xml +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\GitHub\Light_Analysis_Examples\C sharp\Thorlabs BP209 Beam Profiler 2D Output\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.csproj.AssemblyReference.cache +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\GitHub\Light_Analysis_Examples\C sharp\Thorlabs BP209 Beam Profiler 2D Output\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.exe.config +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\GitHub\Light_Analysis_Examples\C sharp\Thorlabs BP209 Beam Profiler 2D Output\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.Form1.resources +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\GitHub\Light_Analysis_Examples\C sharp\Thorlabs BP209 Beam Profiler 2D Output\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.Properties.Resources.resources +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\GitHub\Light_Analysis_Examples\C sharp\Thorlabs BP209 Beam Profiler 2D Output\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.csproj.GenerateResource.cache +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\GitHub\Light_Analysis_Examples\C sharp\Thorlabs BP209 Beam Profiler 2D Output\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.csproj.CoreCompileInputs.cache +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\GitHub\Light_Analysis_Examples\C sharp\Thorlabs BP209 Beam Profiler 2D Output\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.F50C70AC.Up2Date +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\GitHub\Light_Analysis_Examples\C sharp\Thorlabs BP209 Beam Profiler 2D Output\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.exe +C:\Users\zizhang\OneDrive - THORLABS Inc\Documents\GitHub\Light_Analysis_Examples\C sharp\Thorlabs BP209 Beam Profiler 2D Output\Thorlabs.BP2_CSharpDemo\obj\Debug\Thorlabs.BP2_CSharpDemo.pdb diff --git a/C++/BP209 2D Output/BP209.vcxproj b/C++/BP209 2D Output/BP209.vcxproj index 126ec6b..7afec8b 100644 --- a/C++/BP209 2D Output/BP209.vcxproj +++ b/C++/BP209 2D Output/BP209.vcxproj @@ -18,6 +18,9 @@ x64 + + + 16.0 Win32Proj @@ -71,8 +74,8 @@ - $(IncludePath) - $(LibraryPath) + C:\OpenCV\opencv\build\include;$(IncludePath) + C:\OpenCV\opencv\build\x64\vc16\lib;$(LibraryPath) @@ -111,13 +114,13 @@ true _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true - C:\Program Files\IVI Foundation\VISA\Win64\include + C:\Program Files\IVI Foundation\VISA\Win64\include;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Include Console true C:\Program Files\IVI Foundation\VISA\Win64\Lib_x64\msc;%(AdditionalLibraryDirectories) - TLBP2_64.lib;opencv_world490d.lib;opencv_world490.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) + TLBP2_64.lib;opencv_world4120.lib;opencv_world4120d.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) @@ -136,9 +139,6 @@ true - - - diff --git a/C++/BP209 2D Output/BP209.vcxproj.filters b/C++/BP209 2D Output/BP209.vcxproj.filters index 43f7321..3fc79cc 100644 --- a/C++/BP209 2D Output/BP209.vcxproj.filters +++ b/C++/BP209 2D Output/BP209.vcxproj.filters @@ -15,7 +15,7 @@ - + Source Files diff --git a/C++/BP209 2D Output/BP209_2D_output.cpp b/C++/BP209 2D Output/BP209_2D_output.cpp index 7f52170..c53c740 100644 --- a/C++/BP209 2D Output/BP209_2D_output.cpp +++ b/C++/BP209 2D Output/BP209_2D_output.cpp @@ -1,7 +1,8 @@ -//Example Date of Creation(YYYY - MM - DD) 2024 - 04 - 24 -//Example Date of Last Modification on Github 2024 - 04 - 24 +//Example Date of Creation(YYYY - MM - DD) 2024 - 04 - 24 +//Example Date of Last Modification on Github 2026 - 01 - 29 //Version of C++ used for Testing and IDE: C++ 14, Visual Studio 2022 -//Version of the Thorlabs SDK used : Beam version 9.1.5787.560 +//Version of OpenCV: OpenCV 4.12.0 +//Version of the Thorlabs SDK used : Beam version 9.3 //Example Description: The sample code shows how to control a BP209 beam profiler in C++. //In the example the available beam profilers are found, a connection is established, several parameters are set, //several output values are displayed and a 2D image is shown. @@ -18,7 +19,7 @@ using namespace cv; // forward declaration void print_error_msg(ViStatus err); void Beam_Profile_Reconstruction(); -ViSession m_instrumentHandle; +ViSession m_instrumentHandle = 0; //set the measured laser wavelengh unit: nm double wavelength = 633; @@ -55,50 +56,74 @@ int main(int argc, char* argv) return 0; } + ViChar modelName[256]; + ViChar serialNo[256]; + ViChar manufacturer[256]; + ViBoolean isAvailable; + res = TLBP2_getRsrcInfo(0, 0, modelName, serialNo, manufacturer, &isAvailable); + // connect with the first device res = TLBP2_init(resStr[0].resourceString, VI_TRUE, VI_TRUE, &m_instrumentHandle); - if ((res & _VI_ERROR) > 0) + if (res != VI_SUCCESS) { print_error_msg(res); return 0; } - char serialNo[128]; - res = TLBP2_get_serial_number(m_instrumentHandle, serialNo); - printf("%s is connected. \n", serialNo); + + if (isAvailable) + { + printf("%s (SN: %s) is connected. \n", modelName, serialNo); + } + else + { + printf("%s (SN: %s) is not available.\n", modelName, serialNo); + // release the device + TLBP2_close(m_instrumentHandle); + return 0; + } + // release the buffer for the resource strings delete[] resStr; //set auto gain res = TLBP2_set_auto_gain(m_instrumentHandle, VI_TRUE); - if ((res & _VI_ERROR) > 0) + if (res != VI_SUCCESS) { print_error_msg(res); + // release the device + TLBP2_close(m_instrumentHandle); return 0; } //set bandwidth ViReal64 bw_buffer[4] = { 125,125,125,125 }; res = TLBP2_set_bandwidths(m_instrumentHandle, bw_buffer); - if ((res & _VI_ERROR) > 0) + if (res != VI_SUCCESS) { print_error_msg(res); + // release the device + TLBP2_close(m_instrumentHandle); return 0; } //set wavelength res = TLBP2_set_wavelength(m_instrumentHandle, wavelength); - if ((res & _VI_ERROR) > 0) + if (res != VI_SUCCESS) { print_error_msg(res); + // release the device + TLBP2_close(m_instrumentHandle); return 0; } //set power factor res = TLBP2_set_user_power_factor(m_instrumentHandle, powerCorrectionFactor); - if ((res & _VI_ERROR) > 0) + if (res != VI_SUCCESS) { print_error_msg(res); + // release the device + TLBP2_close(m_instrumentHandle); return 0; } @@ -113,22 +138,26 @@ int main(int argc, char* argv) res = TLBP2_set_scanning_method(m_instrumentHandle, 1, scanningMethod); res = TLBP2_set_scanning_method(m_instrumentHandle, 2, scanningMethod); res = TLBP2_set_scanning_method(m_instrumentHandle, 3, scanningMethod); - if ((res & _VI_ERROR) > 0) + if (res != VI_SUCCESS) { print_error_msg(res); + // release the device + TLBP2_close(m_instrumentHandle); return 0; } } else { - printf("Invalid Input! The scanning method is set to slit scanning mode.\n"); + printf("Invalid Input! The scanning method is set to slit scanning method.\n"); res = TLBP2_set_scanning_method(m_instrumentHandle, 0, 0); res = TLBP2_set_scanning_method(m_instrumentHandle, 1, 0); res = TLBP2_set_scanning_method(m_instrumentHandle, 2, 0); res = TLBP2_set_scanning_method(m_instrumentHandle, 3, 0); - if ((res & _VI_ERROR) > 0) + if (res != VI_SUCCESS) { print_error_msg(res); + // release the device + TLBP2_close(m_instrumentHandle); return 0; } } @@ -140,25 +169,47 @@ int main(int argc, char* argv) res = TLBP2_set_drum_speed_ex(m_instrumentHandle, 10, &sampleCount, &resolution); else //knife edge mode res = TLBP2_set_drum_speed_ex(m_instrumentHandle, 2, &sampleCount, &resolution); - if ((res & _VI_ERROR) > 0) + if (res != VI_SUCCESS) { print_error_msg(res); + // release the device + TLBP2_close(m_instrumentHandle); return 0; } + //set calculation area to auto rectangle, and set the clip level to 1% + res = TLBP2_set_calculation_area(m_instrumentHandle, 0, VI_TRUE, 0.01f, 0.0f, 0.0f); + res = TLBP2_set_calculation_area(m_instrumentHandle, 1, VI_TRUE, 0.01f, 0.0f, 0.0f); + res = TLBP2_set_calculation_area(m_instrumentHandle, 2, VI_TRUE, 0.01f, 0.0f, 0.0f); + res = TLBP2_set_calculation_area(m_instrumentHandle, 3, VI_TRUE, 0.01f, 0.0f, 0.0f); + //set position correction res = TLBP2_set_position_correction(m_instrumentHandle, VI_TRUE); - if ((res & _VI_ERROR) > 0) + if (res != VI_SUCCESS) { print_error_msg(res); + // release the device + TLBP2_close(m_instrumentHandle); + return 0; + } + + //return all position coordinates from -4500 µm to 4500 µm and flip the x scans + res = TLBP2_setThorlabsBeamCompatibleCoordinateSystem(m_instrumentHandle, VI_TRUE); + if (res != VI_SUCCESS) + { + print_error_msg(res); + // release the device + TLBP2_close(m_instrumentHandle); return 0; } //set speed correction res = TLBP2_set_speed_correction(m_instrumentHandle, VI_TRUE); - if ((res & _VI_ERROR) > 0) + if (res != VI_SUCCESS) { print_error_msg(res); + // release the device + TLBP2_close(m_instrumentHandle); return 0; } @@ -169,12 +220,10 @@ int main(int argc, char* argv) res = TLBP2_get_device_status(m_instrumentHandle, &device_status); } - static BP2_SLIT_DATA slit_data[4], slit_data_kinfe[4]; /// BP2_MAX_SLIT_COUNT = 4 - static BP2_CALCULATIONS calculation_result[4], calculation_result_knife[4]; static ViReal64 power_intensities[7500]; static ViBoolean slit_indices[4] = { VI_TRUE, VI_TRUE, VI_TRUE, VI_TRUE}; ViReal64 power; - ViReal32 powerSaturation; + ViReal32 powerSaturation,centroidPositionX, centroidPositionY,gaussianDiameterX,gaussianDiameterY; ViUInt8 gain[4]; ViUInt8 gainPower; @@ -183,7 +232,7 @@ int main(int argc, char* argv) printf("Adjusting Gain...\n"); for (int i = 0; i < 10; i++) { - res = TLBP2_get_slit_scan_data(m_instrumentHandle, slit_data, calculation_result, &power, &powerSaturation, power_intensities); + res = TLBP2_request_scan_data(m_instrumentHandle, &power, &powerSaturation, power_intensities); res = TLBP2_get_gains(m_instrumentHandle, gain, &gainPower); printf("Gain:\n"); printf(" 25um slit x: %d, 25um slit y: %d\n", gain[0],gain[1]); @@ -195,19 +244,25 @@ int main(int argc, char* argv) if (scanningMethod == 0)//slit scanning mode { //Get the slit scan data - res = TLBP2_get_slit_scan_data(m_instrumentHandle, slit_data, calculation_result, &power, &powerSaturation, power_intensities); + res = TLBP2_request_scan_data(m_instrumentHandle, &power, &powerSaturation, power_intensities); if (res == VI_SUCCESS) { + TLBP2_get_slit_centroid(m_instrumentHandle, 2, VI_NULL, ¢roidPositionX); + TLBP2_get_slit_centroid(m_instrumentHandle, 3, VI_NULL, ¢roidPositionY); + TLBP2_get_slit_gaussian_fit(m_instrumentHandle, 2, VI_NULL, &gaussianDiameterX, VI_NULL, VI_NULL); + TLBP2_get_slit_gaussian_fit(m_instrumentHandle, 3, VI_NULL, &gaussianDiameterY, VI_NULL, VI_NULL); printf("Corrected Power value: %.2f mW\n", power); - printf("5um Slit X Centroid Position: %.2f\n", calculation_result[2].centroidPosition); - printf("5um Slit Y Centroid Position: %.2f\n", calculation_result[3].centroidPosition); - printf("5um Slit X Gaussian Fit Diameter: %.2f\n", calculation_result[2].gaussianFitDiameter); - printf("5um Slit Y Gaussian Fit Diameter: %.2f\n", calculation_result[3].gaussianFitDiameter); + printf("5um Slit X Centroid Position: %.2f\n", centroidPositionX); + printf("5um Slit Y Centroid Position: %.2f\n", centroidPositionY); + printf("5um Slit X Gaussian Fit Diameter: %.2f\n", gaussianDiameterX); + printf("5um Slit Y Gaussian Fit Diameter: %.2f\n", gaussianDiameterY); Beam_Profile_Reconstruction(); } } else//knife edge mode { + static BP2_SLIT_DATA slit_data[4], slit_data_kinfe[4]; /// BP2_MAX_SLIT_COUNT = 4 + static BP2_CALCULATIONS calculation_result[4], calculation_result_knife[4]; //Calculate the knife edge data from the slit data. res = TLBP2_get_slit_scan_data(m_instrumentHandle, slit_data, calculation_result, &power, &powerSaturation, power_intensities); res = TLBP2_get_knife_edge_reconstruction(m_instrumentHandle, slit_data, calculation_result, slit_indices, slit_data_kinfe, calculation_result_knife); @@ -220,7 +275,7 @@ int main(int argc, char* argv) printf("25um Slit Y Gaussian Fit Diameter: %f\n", calculation_result_knife[1].gaussianFitDiameter); } else - printf("Fail to reconstruct the knife edge data\n"); + printf("Fail to reconstrucion the knife edge data\n"); } // release the device @@ -241,8 +296,6 @@ void Beam_Profile_Reconstruction() static ViReal64 gaussianFitIntensitiesY[7500]; ViReal32 gaussianFitPercentageX, gaussianFitPercentageY; - //Request the scan data - TLBP2_request_scan_data(m_instrumentHandle, VI_NULL, VI_NULL, VI_NULL); //Get the intensities from the 5um X slit and the 5um Y slit res = TLBP2_get_sample_intensities(m_instrumentHandle, 2, sampleIntensitiesX, samplePositionsX); res = TLBP2_get_sample_intensities(m_instrumentHandle, 3, sampleIntensitiesY, samplePositionsY); @@ -314,10 +367,12 @@ void Beam_Profile_Reconstruction() reconstructionImage.at(col, row) = (uchar)(255 * intensityTemp[row][col] / intensityMax); } } + imshow("X Intensity", IntensityXImage); imshow("X Gaussian Fit Intensity", GaussianXImage); imshow("2D Reconstruction", reconstructionImage); - waitKey(0); + + waitKey(8000); } // prints the error message from an error code diff --git a/Matlab/CCT Spectrometers/CCT_example.m b/Matlab/CCT Spectrometers/CCT_example.m new file mode 100644 index 0000000..27b8e61 --- /dev/null +++ b/Matlab/CCT Spectrometers/CCT_example.m @@ -0,0 +1,76 @@ +%% Header +% Title: CCT_example.m +% Created Date: 2025-12-10 +% Last modified date: 2025-12-10 +% Matlab Version:R2023a +% Thorlabs DLL version:1.0.20.4045 +%% Notes: The example shows how to connect to a CCT spectrometer, set the exposure time and acquire a spectrum +% Tested with CCT11 +% + +% Load the Compact Spectrometer SDK DLLs +dll_path='C:\Program Files\Thorlabs\ThorSpectra'; +NET.addAssembly(fullfile(dll_path, 'Thorlabs.ManagedDevice.CompactSpectrographDriver.dll')); +NET.addAssembly(fullfile(dll_path, 'Thorlabs.ManagedDevice.dll')); +NET.addAssembly(fullfile(dll_path, 'Microsoft.Extensions.Logging.Abstractions.dll')); +NET.addAssembly('System.Runtime'); + +import Thorlabs.ManagedDevice.CompactSpectrographDriver.Workflow.StartupHelperCompactSpectrometer.*; +import Thorlabs.ManagedDevice.Trace.ExampleLogger.*; +import Microsoft.Extensions.Logging.Abstractions.*; +import Thorlabs.ManagedDevice.CompactSpectrographDriver.ICompactSpectrographDriver.*; + +logger = Thorlabs.ManagedDevice.Trace.ExampleLogger('ML',Microsoft.Extensions.Logging.LogLevel.Trace,1==1,'MatLab'); +startupHelper = Thorlabs.ManagedDevice.CompactSpectrographDriver.Workflow.StartupHelperCompactSpectrometer(logger); + +cts = System.Threading.CancellationTokenSource(); +cancellationToken = cts.Token; + +%find devices +discoveredDevicestask=startupHelper.GetKnownDevicesAsync(cancellationToken); +discoveredDevicestask.Wait(); +discoveredDevices=discoveredDevicestask.Result; + +for i=0:discoveredDevices.Count-1 + disp("discovered devices:") + disp(discoveredDevices.Item(i)); +end + +%if spectrometers are found +if(discoveredDevices.Count>0) + + disp("connecting to first device ...") + + Deviceid=discoveredDevices.Item(0); + + spectrometer=startupHelper.GetCompactSpectrographById(Deviceid); + + %set exposure time + exposure=500; %exposure time in milliseconds + exposure_result=spectrometer.SetManualExposureAsync(exposure,cancellationToken).Result; + if exposure_result==1 + disp(['exposure time is set to ',num2str(exposure),' ms']); + end + + %acquire spectrum + spectrumtask=spectrometer.AcquireSingleSpectrumAsync(cancellationToken); + spectrumtask.Wait(); + spectrum=spectrumtask.Result; + + %dispose startup helper + startupHelper.Dispose(); + + %plot spectrum + figure; plot(spectrum.Wavelength,spectrum.Intensity) + + +else + disp("No CCT spectrometer connected") +end + + + + + + + diff --git a/Matlab/Powermeter/PowermeterAppExample.mlapp b/Matlab/Powermeter/PowermeterAppExample.mlapp new file mode 100644 index 0000000..3d55b5e Binary files /dev/null and b/Matlab/Powermeter/PowermeterAppExample.mlapp differ diff --git a/Matlab/Powermeter/README.md b/Matlab/Powermeter/README.md index 0371422..317e288 100644 --- a/Matlab/Powermeter/README.md +++ b/Matlab/Powermeter/README.md @@ -5,7 +5,7 @@ This example shows how to initialize Thorlabs Power Meters that utilize the TLPM The code uses the .NET DLL file for the power meters TLPMX_64.Interop.dll. -### Prerequisites -Make sure to have the latest install of Thorlabs OPM and make sure the file location on line 10 leads directly to the TLPMX dll. +### Power Meter App +This example shows how to use a power meter with a Matlab App. diff --git a/Python/Thorlabs PMxxx Power Meters/SCPI/Readme.md b/Python/Thorlabs PMxxx Power Meters/SCPI/Readme.md index f3297dc..7611e54 100644 --- a/Python/Thorlabs PMxxx Power Meters/SCPI/Readme.md +++ b/Python/Thorlabs PMxxx Power Meters/SCPI/Readme.md @@ -27,7 +27,7 @@ For closer details refer to [Readme](scopeMode). Available for PM6x, PM103, PM10 Minimal template script ```PMxxx_SCPI_OpenAnyvisa.py``` to open a known instrument resource using anyvisa library. ### Search Anyvisa -Minimal template script ```PMxxx_SCPI_SearchAnyvisa.py``` to run instrument search and open one of the devices found using anvisa library. +Minimal template script ```PMxxx_SCPI_SearchAnyvisa.py``` to run instrument search and open one of the devices found using anyvisa library. ## SCPI Command documentation For most of the Thorlabs Powermeter there is a detail [SCPI command documentation](commandDocu) in .html file format available. @@ -52,9 +52,10 @@ python -m pip install anyvisa*.whl ### National Instruments :tm: Visa -If you want to control the Power Meter on Linux, with pyvisa library or with SCPI commands within your CVI or LabView application, -you have to install National Instruments :tm: Visa Runtime (May be installed already if you installed NI LabView or NI CVI). -Once installed you must switch the driver for the Power Meter manually by using Thorlabs Driver Switcher or Windows +If you want to control the Power Meter with the pyvisa library and with SCPI commands, +you have to install National Instruments :tm: Visa Runtime (May be installed already if you installed NI LabView or NI CVI). +This works also on many Linux systems. +On Windows, you must then switch the driver for the Power Meter manually by using Thorlabs Driver Switcher or Windows Device Manager (Experts only). Once the runtime is installed and driver has been switched you can install pyvisa python library via command. @@ -62,4 +63,63 @@ via command. python -m pip install pyvisa ``` -Note: pyvisa does communicate with Thorlabs Ethernet or Bluetooth LE device interfaces. +Note: pyvisa does not communicate with Thorlabs Ethernet or Bluetooth LE device interfaces. + +### Raspberry Pi 4 +On Raspberry Pi with ARM Linux, both TLVisa and NI Visa do not work. Another approach is using the Pyvisa-Py backend. +We tested the following procedure on Raspberry Pi 4, Linux 13 (Trixie), PM100D3. +``` +sudo apt update && sudo apt upgrade -y +``` +Most Raspberry Pi OS versions come with Python pre-installed. Check with: +``` +python3 --version +``` +If Python is not already installed: +``` +sudo apt install python3 python3-pip -y +``` +If libusb is not installed: +``` +sudo apt install libusb-1.0-0-dev +``` +Install Pyvisa and Pyvisa-Py: +``` +sudo apt install python3-pyvisa +sudo apt install python3-pyvisa-py +sudo apt install python3-usb +sudo apt install zeroconf +``` +In order to get the permission to acces the power meter, create usbgroup and add your user: +``` +sudo groupadd usbgroup +sudo usermod -aG usbgroup $USER +``` +then set a udev rule, open the following file to edit: +``` +sudo nano /etc/udev/rules.d/99-usbgroup.rules +``` +(create directory and file if it does not exist) +Insert the following line into the file +``` +SUBSYSTEM=="usb", GROUP="usbgroup", MODE="0666" +``` +(This is for all USB devices. You can also set more specific rules) +Reload and reboot to activate the rules +``` +sudo udevadm control --reload-rules +sudo udevadm trigger +sudo reboot +``` +Plug in the powermeter and check with lsusb, if the device is present. +Run in Python: +``` +import pyvisa +rm = pyvisa.ResourceManager('@py') +print(rm.list_resources()) +inst = rm.open_resource('USB0::4883::32921::P000000064::0::INSTR')#substitute with the actual resource string that you get from the previous command +print(inst.query('*IDN?')) +print(inst.query('MEAS?')) +``` +Also see the above ```PMxxx_SCPI_pyvisa.py``` +