예제 #1
0
        /// <summary>
        /// 初始化USB-4704
        /// </summary>
        private void InitUsb4704()
        {
            //初始化设备
            DialogResult dialogResult = DialogResult.Retry;

            while (dialogResult == DialogResult.Retry)
            {
                dialogResult = DialogResult.OK;
                USB4704      = new DAQNaviHelper("USB-4704,BID#0");
                if (!USB4704.InitDevice(out string message))
                {
                    dialogResult = initError(message, "USB-4704初始化失败");
                    if (dialogResult == DialogResult.Cancel)
                    {
                        Application.Exit();
                    }
                }
            }

            //绑定异常发生事件
            USB4704.BindErrorEvent(new DAQNaviHelper.DelegateErrorEvent(USB4704_EventError));

            //初始化功能模块
            InitFunc();
        }
예제 #2
0
        private void frmDemo_Load(object sender, EventArgs e)
        {
            //初始化设备
            USB4704 = new DAQNaviHelper("USB-4704,BID#0");
            if (!USB4704.InitDevice(out string message))
            {
                initError(message, "USB-4704初始化失败");
            }

            //绑定异常发生事件
            USB4704.BindErrorEvent(new DAQNaviHelper.DelegateErrorEvent(USB4704_EventError));
        }