Example #1
0
        private void comboBox_wavalength_SelectedIndexChanged(object sender, EventArgs e)
        {
            pm100d = new Thorlabs.PM100D.PM100D("USB0::0x1313::0x8075::P5000256::INSTR", false, false);  //  For valid Ressource_Name see NI-Visa documentation.

            double wavelength0 = 780;
            double wavelength1 = 980;
            double wavelength2 = 1064;

            switch (comboBox_wavalength.SelectedIndex)

            {
            case 0:
                pm100d.setWavelength(wavelength0);
                break;

            case 1:
                pm100d.setWavelength(wavelength1);
                break;

            case 2:
                pm100d.setWavelength(wavelength2);
                break;
            }
        }
Example #2
0
        static Thorlabs.PM100D.PM100D SetUpPowerMeter(string deviceName, double wavelength)
        {
            var pm = new Thorlabs.PM100D.PM100D(deviceName, false, true);

            if (pm == null)
            {
                throw new Exception("Error while initializing PM100D power meter device: constructor returned null");
            }
            int err = pm.setWavelength(wavelength);

            if (err != 0)
            {
                throw new Exception("Error while setting wavelength: code " + err);
            }
            return(pm);
        }