Example #1
0
        // Hairus added to get more accurate resistance measurement.
        /// <summary>
        /// To configure resistance measurement range and resolution for specific channel
        /// </summary>
        /// <param name="channel">Channel to be configured</param>
        /// <param name="range">Resistance range</param>
        /// <param name="resolution">Resolution</param>
        public static double Measure_Resistance(int channel, string range, string resolution)
        {
            try
            {
                int finalChannel = Res_channel + channel;
                //DAS.WriteLine("ROUTE:SCAN (@)");
                DAS.WriteLine("CONF:RES {0},{1},(@{2})", range, resolution, finalChannel);
                //DAS.WriteLine("ROUT:SCAN (@{0})", channel);
                //Thread.Sleep(3000);
                DAS.WriteLine("ROUT:CHAN:DELAY 5");
                DAS.WriteLine("INIT");
                DAS.WriteLine("FETCH?");
                var reading = DAS.ReadNumberAsDouble();

                return(reading);
            }
            catch (Exception)
            {
                throw;
            }
        }