Ejemplo n.º 1
0
        public void Multiscan(IKeithley2400Model keithley2400,
                              IWayneKerr4300Model wayneKerr4300,
                              ICVEnvironment cvEnv,
                              CancellationToken token)
        {
            _keithley2400  = keithley2400;
            _wayneKerr4300 = wayneKerr4300;

            WriteComment(DateTime.Now.ToString());
            string senseMode = "KT24 sensing mode is " + keithley2400.SerialSafeRead(":SYSTem:RSENse?");

            WriteComment(senseMode);
            WriteComment(Description);

            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();

            string f_setstring = ":MEAS:FREQ "; // WK AC probe frequency setup prefix
            string v_setstring = ":MEAS:LEV ";  // WK AC probe amplitude setup prefix

            string setstring = v_setstring += wayneKerr4300.Amplitude.ToString();

            wayneKerr4300.SerialSafeWriteWithDelay(setstring);     // Measuring AC amplitude now also set to operator defined value

            setstring  = ":SENS:CURR:PROT ";
            setstring += keithley2400.CurrentLimit.ToString();
            keithley2400.SerialSafeWriteWithDelay(setstring);            //Now set the Keithley 2400 I limit to configuration value

            int i = 0;

            foreach (double test_frequency in Frequencies)
            {
                if (token.IsCancellationRequested)
                {
                    break;
                }
                string setfrequency = f_setstring + test_frequency.ToString();
                wayneKerr4300.SerialSafeWriteWithDelay(setfrequency);
                Thread.Sleep(2000);     // WK needs a HUGE delay in setting the frequency.
                                        // Without this pause, either the Frequency in not set as requested
                                        // Or the WK times-out when asking for the frequency.

                C_V_Scan(token);
                i++;
            }
            stopWatch.Stop();
            var    elapsed         = stopWatch.Elapsed;
            string completdMessage = $"CV Test Completed: Elapsed time {elapsed.Hours:00}:{elapsed.Minutes:00}:{elapsed.Seconds:00}:{elapsed.Milliseconds / 10:00} ";

            return; // End task;
        }