예제 #1
0
        public GPIB(int ADDR)        //构造函数
        {
            //ADDR为GPIB设备地址
            try
            {
                li      = new LangInt();                     // Contains all GPIB functions
                c       = new GpibConstants();               // Contains all GPIB global constants
                TIMEOUT = c.T3s;

                Dev = li.ibdev(BDINDEX, ADDR, NO_SECONDARY_ADDR, TIMEOUT, EOTMODE, EOSMODE);         //Get the device handle
                if ((li.ibsta & c.ERR) != 0)
                {
                    throw new System.Exception("Unable to open device!\nibsta:" + li.ibsta + "\nERR:" + c.ERR);
                }


                li.ibclr(Dev);
                if ((li.ibsta & c.ERR) != 0)
                {
                    throw new System.Exception("Unable to clear device!\nibsta:" + li.ibsta + "\nERR:" + c.ERR);
                }
            }
            catch (System.Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
예제 #2
0
 static GPIBDevice()
 {
     li = new LangInt();          // Contains all GPIB functions 
     c = new GpibConstants();    // Contains all GPIB global constants 
     TIMEOUT = c.T300ms;
 }
예제 #3
0
 static GPIBDevice()
 {
     li      = new LangInt();       // Contains all GPIB functions
     c       = new GpibConstants(); // Contains all GPIB global constants
     TIMEOUT = c.T300ms;
 }