예제 #1
0
        public double GetLowFreq(string channel)
        {
            HandlerError.ClearErrors();
            double measures = 0;

            try
            {
                //GPIBVisa.WriteCommand("SENS:DIG:DATA:BYTE? (@" + Channel + ")");
                WriteCommand("CONF:FREQ  (@" + channel + ")");
                WriteCommand("SENS:FREQ:RANG:LOW 3,  (@" + channel + ")");
                WriteCommand("INIT");
                WriteCommand("FETCh?");

                //System.Threading.Thread.Sleep(2000);
                ReadCommand(out measures);
                //return measures;
            }
            catch (Exception e)
            {
                HandlerError.ErrorOccurred = true;
                HandlerError.ErrorMsg      = "Data Adquisition Agilent 34970A. " + e.Message;
                throw new Exception(HandlerError.ErrorMsg);
            }
            return(measures);
        }
예제 #2
0
파일: SeaMaxDevice.cs 프로젝트: tomyqg/EPTS
 public virtual void Initialization()
 {
     HandlerError.ClearErrors();
     try
     {
         //SeaMaxDeviceHandler = new SeaMAX();
     }
     catch (Exception e)
     {
         throw new Exception("SEA LEVEL Error: " + e.Message);
     }
 }
예제 #3
0
 public void Close()
 {
     HandlerError.ClearErrors();
     try
     {
         _serialPort.Close();
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Closed port. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
예제 #4
0
 public void Write(string message)
 {
     HandlerError.ClearErrors();
     try
     {
         _serialPort.Write(message);
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Write port. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
예제 #5
0
파일: Visa.cs 프로젝트: tomyqg/EPTS
 /// <summary>
 /// Reset Device
 /// </summary>
 public void Reset()
 {
     HandlerError.ClearErrors();
     try
     {
         WriteCommand("*RST");
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Reset command VisaCom Method. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
예제 #6
0
파일: Visa.cs 프로젝트: tomyqg/EPTS
 /// <summary>
 /// Abort Device
 /// </summary>
 public void Abort()
 {
     HandlerError.ClearErrors();
     try
     {
         ResourceIO.WriteString("ABOR", true);
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Abort command VisaCom Method. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
예제 #7
0
파일: Visa.cs 프로젝트: tomyqg/EPTS
 /// <summary>
 /// Clear Device
 /// </summary>
 public void ClearDevice()
 {
     HandlerError.ClearErrors();
     try
     {
         ResourceIO.IO.Clear();
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Clear Device command VisaCom Method. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
예제 #8
0
파일: Visa.cs 프로젝트: tomyqg/EPTS
 /// <summary>
 /// Poll
 /// </summary>
 public void Poll()
 {
     HandlerError.ClearErrors();
     try
     {
         ResourceIO.WriteString("*STB?", true);
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Find Device command VisaCom Method. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
예제 #9
0
 public virtual void Initialization()
 {
     HandlerError.ClearErrors();
     try
     {
         _serialPort = new SerialPort(PortName, BaudRate, Parity, DataBits, StopBits);
         _serialPort.DataReceived += DataReceivedHandler;
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Open port. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
예제 #10
0
파일: Visa.cs 프로젝트: tomyqg/EPTS
 /// <summary>
 /// Triger Device
 /// </summary>
 public void Trigger()
 {
     HandlerError.ClearErrors();
     try
     {
         ResourceIO.IO.AssertTrigger(Ivi.Visa.Interop.TriggerProtocol.TRIG_PROT_ON);
         HandlerCpu.Delay(1);
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Trigger command VisaCom Method. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
예제 #11
0
파일: Visa.cs 프로젝트: tomyqg/EPTS
 /// <summary>
 /// Clean the Device Buffer
 /// </summary>
 public void Flush()
 {
     HandlerError.ClearErrors();
     try
     {
         ResourceIO.FlushWrite(false);
         ResourceIO.IO.Clear();
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Flush command VisaCom Method. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
예제 #12
0
파일: SeaMaxDevice.cs 프로젝트: tomyqg/EPTS
 public void SM_Close()
 {
     HandlerError.ClearErrors();
     try
     {
         SeaMaxDeviceHandler.SM_Close();
     }
     catch (Exception e)
     {
         HandlerError.ErrorCode     = -1;
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Close Returned Error Code: " + HandlerError.ErrorCode + ", when try to Open Port";
         throw new Exception(e.Message);
     }
 }
예제 #13
0
 public double Fetch()
 {
     HandlerError.ClearErrors();
     try
     {
         WriteCommand("INIT");
         WriteCommand("FETCh?");
         double measure = 0;
         ReadCommand(out measure);
         return(measure);
     }
     catch (Exception e)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Data Adquisition Agilent 34970A. " + e.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
예제 #14
0
        public double GetMeasure(MeasType command, int channel)
        {
            HandlerError.ClearErrors();
            double measures = 0;

            try
            {
                WriteCommand(MeasureType.GetMeasure(command) + " (@" + channel + ")");
                ReadCommand(out measures);
            }
            catch (Exception e)
            {
                HandlerError.ErrorOccurred = true;
                HandlerError.ErrorMsg      = "Data Adquisition Agilent 34970A. " + e.Message;
                throw new Exception(HandlerError.ErrorMsg);
            }
            return(measures);
        }
예제 #15
0
 public void Open()
 {
     HandlerError.ClearErrors();
     try
     {
         if (_serialPort.IsOpen)
         {
             throw new Exception("its Open the ports");
         }
         _serialPort.Open();
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Open port. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
예제 #16
0
파일: Visa.cs 프로젝트: tomyqg/EPTS
        /// <summary>
        /// Device Agilent Initialization
        /// </summary>
        public virtual void Initialization()
        {
            HandlerError.ClearErrors();

            ResourceManager = new ResourceManagerClass();
            ResourceIO      = new FormattedIO488Class();
            try
            {
                ResourceManager.Open(DeviceAddress, AccessMode.NO_LOCK, 0, "");
                ResourceIO.IO = (IMessage)ResourceManager.Open(DeviceAddress, AccessMode.NO_LOCK, 0, "");
            }
            catch (Exception e)
            {
                HandlerError.ErrorOccurred = true;
                HandlerError.ErrorMsg      = "Init resource Agilent Method. " + e.Message;
                throw new Exception(HandlerError.ErrorMsg);
            }
        }