Ejemplo n.º 1
0
 public override void Close()
 {
     if (driver != null && driver.Initialized)
     {
         // Close the driver
         driver.Close();
         driver = null;
     }
 }
Ejemplo n.º 2
0
        public override bool Initialize(out string outMessage, out IIviDriverIdentity identity)
        {
            identity = null;
            try
            {
                outMessage = string.Empty;
                driver     = new KtRFPowerMeter();
                string initOptions = "QueryInstrStatus=true, Simulate=false, DriverSetup= Model=, Trace=false, TraceName=c:\\temp\\traceOut";

                bool idquery = true;
                bool reset   = true;
                identity = driver.Identity;
                // Initialize the driver.  See driver help topic "Initializing the IVI-COM Driver" for additional information
                driver.Initialize(m_resourceDesc, idquery, reset, initOptions);

                driver.System.Preset();
                // Wait for the preset to complete and wiat for 10 seconds
                driver.System.IOTimeout = 20000;
                // Select Channel A and set INIT:CONT OFF



                ChannelA    = (KtRFPowerMeterChannel)driver.Channels.get_Item("A");
                ChannelB    = (KtRFPowerMeterChannel)driver.Channels.get_Item("B");
                Measurement = driver.Measurements2.get_Item2("1");

                ChannelA.Trigger.ContinuousEnabled = true;
                m_continues = ChannelA.Trigger.ContinuousEnabled;
                return(true);
            }
            catch (Exception ex)
            {
                outMessage = ex.Message;
                return(false);
            }
        }