当前位置: 首页>>代码示例>>C#>>正文


C# ResourceManager.Open方法代码示例

本文整理汇总了C#中ResourceManager.Open方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceManager.Open方法的具体用法?C# ResourceManager.Open怎么用?C# ResourceManager.Open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ResourceManager的用法示例。


在下文中一共展示了ResourceManager.Open方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GPIBInstrument

        public GPIBInstrument(string address)
        {
            //initalize the resources necessary to communicate
            rMgr = new ResourceManager();
            src = new FormattedIO488();

            //set the address
            GPIBAddress = address;

            //open the connection
            src.IO = (IMessage)rMgr.Open(GPIBAddress, AccessMode.NO_LOCK, 2000, null);
            src.IO.Timeout = 2000;
        }
开发者ID:Marcus10110,项目名称:SaleaeDeviceExerciser,代码行数:13,代码来源:GPIBInstrument.cs

示例2: InitializeAgilent6760

        public FormattedIO488 InitializeAgilent6760()
        {
            try
            {

                ResourceManager pS2RM = new ResourceManager();
                FormattedIO488 pS2 = new FormattedIO488();

                pS2.IO = (IMessage)pS2RM.Open("GPIB0::7::INSTR", AccessMode.NO_LOCK, 20000, "");

                return pS2;
            }
            catch
            {
                MessageBox.Show("Error initializing Agilent PS", "Error!", MessageBoxButtons.OK);
            }

            FormattedIO488 BAD = new FormattedIO488();

            return BAD;
        }
开发者ID:robojames,项目名称:Keithley-DMM,代码行数:21,代码来源:Hardware.cs

示例3: InitializeAgilent6032

        public FormattedIO488 InitializeAgilent6032()
        {
            try
            {
                // Initialization Logic
                ResourceManager pS1RM = new ResourceManager();
                FormattedIO488 pS1 = new FormattedIO488();

                pS1.IO = (IMessage)pS1RM.Open("GPIB0::5::INSTR", AccessMode.NO_LOCK, 20000, "");

                pS1.IO.WriteString("VSET 24.0\n");

                return pS1;
            }
            catch
            {
                MessageBox.Show("Initialization Error", "Error!", MessageBoxButtons.OK);
            }

            FormattedIO488 BAD = new FormattedIO488();
            return BAD;
        }
开发者ID:robojames,项目名称:Keithley-DMM,代码行数:22,代码来源:Hardware.cs

示例4: AgilentU3606A

        /// <summary>
        /// Connect to an instrument with a specific Visa Alias.
        /// </summary>
        /// <param name="_VisaAlias">The visa alias of the instrument you are connecting to, set with Keysight IO Library Suite</param>
        public AgilentU3606A(string _VisaAlias)
        {
            try
            {
                rMgr = new ResourceManager();
                src = new FormattedIO488();

                VisaAlias = _VisaAlias;

                tmr1.Elapsed += new System.Timers.ElapsedEventHandler(tmr1_Elapsed);
                tmr1.AutoReset = false; //Allow the timer to expire once.
                tmr1.Interval=1000; //Default to 1 second timer.
                src.IO = (IMessage)rMgr.Open(VisaAlias);
                src.IO.Timeout = 10000;
                Current = new CurrentMeasurements();
                myWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset);
            }
            catch (Exception)
            {
                throw;
            }
        }
开发者ID:mac1usa1,项目名称:AgilentU3606,代码行数:26,代码来源:U3606.cs

示例5: InitializeDMM

        public Ke37XX InitializeDMM(double timeStep, string channelNumber, double nplc)
        {
            try
            {
                Ke37XX DMM = new Ke37XX();
                FormattedIO488 udT = new FormattedIO488();
                ResourceManager udTR = new ResourceManager();

                if (DMM.Initialized == false)
                {
                    DMM.Initialize("GPIB0::16::INSTR", false, true, "");
                }

                DMM.Channel.Close("2001:2060,6009:6060");

                DMM.Measurement.Nplc = nplc;// 0.0005, 0.11 for accurate ultrafast;
                DMM.Measurement.AutoDelay = Ke37XXAutoDelayEnum.Ke37XXAutoDelayOff;

                DMM.Measurement.Function = Ke37XXMeasurementFunctionEnum.Ke37XXMeasurementFunctionDCVolts;

                DMM.Measurement.AutoRange = true;

                DMM.Measurement.AutoZero = Ke37XXAutoZeroEnum.Ke37XXAutoZeroOnce;

                DMM.Measurement.Configuration.Create("DCVoltsCfg");

                DMM.Scan.CreateScanList(channelNumber, "DCVoltsCfg");

                udT.IO = (IMessage)udTR.Open("GPIB::16::INSTR", AccessMode.NO_LOCK, 10000, "");

               // udT.WriteString("PERIOD = trigger.timer[1]", true);
               // udT.WriteString("PERIOD.delay = " + timeStep, true);

               // udT.WriteString("PERIOD.stimulus = scan.trigger.EVENT_SCAN_START", true);

               // udT.WriteString("PERIOD.count = 1", true);

               // udT.WriteString("scan.trigger.measure.stimulus = PERIOD.EVENT_ID", true);

                DMM.Scan.Mode = Ke37XXScanModeEnum.Ke37XXScanModeOpenAll;

                DMM.Display.Text = "Initialized";

                return DMM;
            }
            catch
            {
                MessageBox.Show("DMM Initialization Failure", "Error!", MessageBoxButtons.OK);
            }

            Ke37XX BAD = new Ke37XX();

            return BAD;
        }
开发者ID:robojames,项目名称:Keithley-DMM,代码行数:54,代码来源:Hardware.cs

示例6: U3606A_Connect

 private bool U3606A_Connect(string connectString)
 {
     try
     {
         // connectString="USB0::2391::16664::MY48470014::0::INSTR";
         // Create the resource manager and open a session with the instrument specified on U2722AtxtAddr
         ResourceManager grm1 = new ResourceManager();
         ioMultiMeterCntrl.IO = (IMessage)grm1.Open(connectString, AccessMode.NO_LOCK, 2000, "");
         ioMultiMeterCntrl.IO.Timeout = 7000;
         // Only return true if previous calls have also returned true
         return true;
     }
     catch
     {
         ioMultiMeterCntrl.IO = null;
         return false;
     }
 }
开发者ID:countrymarmot,项目名称:Cypress,代码行数:18,代码来源:MultiMeter.cs

示例7: U2751A_WellB_Connect

 private bool U2751A_WellB_Connect(string connectString)
 {
     try
     {
         // Create the resource manager and open a session with the instrument specified on txtAddr
         ResourceManager grm4 = new ResourceManager();
         ioRelayWellBCntrl.IO = (IMessage)grm4.Open(connectString, AccessMode.NO_LOCK, 2000, "");
         ioRelayWellBCntrl.IO.Timeout = 7000;
         // Only return true if previous calls have also returned true
         return true;
     }
     catch
     {
         ioRelayWellBCntrl.IO = null;
         return false;
     }
 }
开发者ID:countrymarmot,项目名称:Cypress,代码行数:17,代码来源:Agilent.cs


注:本文中的ResourceManager.Open方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。